| 1 | struct App {} |
| 2 | |
| 3 | type AliasApp = App |
| 4 | |
| 5 | fn (app AliasApp) alias_method() int { |
| 6 | return 1 |
| 7 | } |
| 8 | |
| 9 | fn (app App) parent_method() int { |
| 10 | return 2 |
| 11 | } |
| 12 | |
| 13 | fn collect_method_names[T]() []string { |
| 14 | mut names := []string{} |
| 15 | $for method in T.methods { |
| 16 | names << method.name |
| 17 | } |
| 18 | return names |
| 19 | } |
| 20 | |
| 21 | fn test_comptime_for_alias_methods_includes_alias_and_parent_methods() { |
| 22 | names := collect_method_names[AliasApp]() |
| 23 | assert 'alias_method' in names |
| 24 | assert 'parent_method' in names |
| 25 | } |
| 26 |