dmd/compiler/test/fail_compilation/ice20056.d
Dennis c4e84f226e
Improve "need this" error (#15430)
* Improve "need `this`" error for function calls

* Improve "need `this`" error for member variables

* Improve "need this" error for address of variable

* Remove dead error
2023-07-20 12:41:02 +03:00

25 lines
466 B
D

/*
TEST_OUTPUT:
---
fail_compilation/ice20056.d(19): Error: calling non-static function `iter` requires an instance of type `RangeWrapper`
---
*/
struct Def(alias fn)
{
alias func = alias_selector!(fn).VOverloads[0];
}
template alias_selector(alias fn)
{
alias VOverloads = __traits(getOverloads, __traits(parent, fn), __traits(identifier, fn));
}
void init_rangewrapper()
{
Def!(RangeWrapper.iter).func;
}
struct RangeWrapper
{
void iter() { }
}