| 1 | import mymod { Data, ImpNode } |
| 2 | |
| 3 | fn foobar_mymod[U](inode ImpNode[U]) ImpNode[U] { |
| 4 | return ImpNode{} |
| 5 | } |
| 6 | |
| 7 | fn simple[T]() T { |
| 8 | return T{} |
| 9 | } |
| 10 | |
| 11 | struct Foo {} |
| 12 | |
| 13 | fn (_ Foo) simple[T]() T { |
| 14 | return T{} |
| 15 | } |
| 16 | |
| 17 | struct GenericStruct[A, B] { |
| 18 | v Data[Data[A], B] |
| 19 | } |
| 20 | |
| 21 | fn proper_generics(gs GenericStruct[A, B]) GenericStruct[A, B] { |
| 22 | return gs |
| 23 | } |
| 24 | |
| 25 | fn main() { |
| 26 | simple[int]() |
| 27 | Foo{}.simple[int]() |
| 28 | } |
| 29 |