dmd/compiler/test/fail_compilation/ice7645.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

32 lines
434 B
D

/*
TEST_OUTPUT:
---
fail_compilation/ice7645.d(28): Error: accessing non-static variable `t` requires an instance of `C2`
fail_compilation/ice7645.d(31): Error: calling non-static function `fn` requires an instance of type `S2`
---
*/
class C
{
class C2()
{
char t;
}
}
struct S
{
struct S2(T)
{
void fn() {}
}
}
void main()
{
C c;
auto v = c.C2!().t;
S s;
s.S2!int.fn();
}