gcc/testsuite/gdc.test/fail_compilation/fail160.d
raw| 1 | /* |
| 2 | TEST_OUTPUT: |
| 3 | --- |
| 4 | fail_compilation/fail160.d(22): Error: `typeid(fail160.Foo).vtbl` is not yet implemented at compile time |
| 5 | --- |
| 6 | */ |
| 7 | |
| 8 | interface Foo |
| 9 | { |
| 10 | void work(); |
| 11 | } |
| 12 | template Wrapper(B, alias Func, int func) |
| 13 | { |
| 14 | alias typeof(&Func) FuncPtr; |
| 15 | |
| 16 | private static FuncPtr get_funcptr() { return func; } |
| 17 | } |
| 18 | |
| 19 | |
| 20 | int main(char[][] args) |
| 21 | { |
| 22 | auto x = new Wrapper!(Foo, Foo.work, cast(int)(Foo.classinfo.vtbl[0]))(); |
| 23 | |
| 24 | return 0; |
| 25 | } |