| 1 | struct NestedGeneric { |
| 2 | } |
| 3 | |
| 4 | struct Context { |
| 5 | } |
| 6 | |
| 7 | struct App { |
| 8 | mut: |
| 9 | context Context |
| 10 | } |
| 11 | |
| 12 | fn (ng NestedGeneric) nested_test[T](mut app T) { |
| 13 | app.context = Context{} |
| 14 | } |
| 15 | |
| 16 | fn method_test[T](mut app T) int { |
| 17 | ng := NestedGeneric{} |
| 18 | ng.nested_test[T](mut app) |
| 19 | return 22 |
| 20 | } |
| 21 | |
| 22 | fn test_generics_with_generics_fn() { |
| 23 | mut app := App{} |
| 24 | ret := method_test(mut app) |
| 25 | println('result = ${ret}') |
| 26 | assert ret == 22 |
| 27 | } |
| 28 |