dmd/compiler/test/fail_compilation/ice10938.d
Nick Treleaven 56b14c11ff
Show type location for 'no property' error (#15586)
* Show type location for 'no property' error

* Remove local path from test output
2023-09-08 16:44:42 +03:00

25 lines
515 B
D

/*
TEST_OUTPUT:
---
fail_compilation/ice10938.d(14): Error: no property `opts` for `this` of type `ice10938.C`
fail_compilation/ice10938.d(14): potentially malformed `opDispatch`. Use an explicit instantiation to get a better error message
fail_compilation/ice10938.d(10): class `C` defined here
---
*/
class C
{
this()
{
this.opts["opts"] = 1;
}
auto opDispatch(string field : "opts")()
{
return this.opts; // ICE -> compile time error
}
}
void main()
{
}