root/cobra/trunk/Tests/240-generics/400-generic-methods/200-generic-method-lib.cobra
| Revision 2281, 220 bytes (checked in by Chuck.Esterbrook, 2 years ago) | |
|---|---|
|
|
| Line | |
|---|---|
| 1 | # .compile-only. |
| 2 | |
| 3 | @args -c -t:lib |
| 4 | |
| 5 | class A<of T> |
| 6 | |
| 7 | def foo<of U>(i as int) as U? |
| 8 | where U must be class |
| 9 | return nil |
| 10 | |
| 11 | def bar<of U>(i as int) as List<of U> |
| 12 | return List<of U>() |
| 13 | |
| 14 | def baz<of U>(t as List<of U>) |
| 15 | pass |
Note: See TracBrowser
for help on using the browser.



