mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 13:10:12 +03:00

* 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
32 lines
434 B
D
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();
|
|
}
|