Added test for generics
This commit is contained in:
parent
a6a944a4fa
commit
34d5f77f65
|
@ -0,0 +1,15 @@
|
|||
type int64 = object {
|
||||
#pragma[magic: "int64"]
|
||||
}
|
||||
|
||||
|
||||
type Test<T: int64>[V: int64] = object {
|
||||
typeObj: T;
|
||||
value: V;
|
||||
}
|
||||
|
||||
|
||||
Test[int64, 1]; # Works
|
||||
# Test[int64, int64]; # Error: expecting an expression of type int64, got typevar[int64] instead
|
||||
# Test[1, int64]; # Error: expecting an expression of type typevar[int64], got int64 instead
|
||||
|
Loading…
Reference in New Issue