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

24 lines
823 B
D

/*
TEST_OUTPUT:
---
fail_compilation/diag8894.d(20): Error: no property `x` for `f` of type `diag8894.Foo`
fail_compilation/diag8894.d(15): struct `Foo` defined here
fail_compilation/diag8894.d(21): Error: no property `y` for `f` of type `diag8894.Foo`
fail_compilation/diag8894.d(15): struct `Foo` defined here
fail_compilation/diag8894.d(22): Error: no property `x` for `f` of type `diag8894.Foo`
fail_compilation/diag8894.d(15): struct `Foo` defined here
fail_compilation/diag8894.d(23): Error: no property `x` for `f` of type `diag8894.Foo`
fail_compilation/diag8894.d(15): struct `Foo` defined here
---
*/
struct Foo { }
void main()
{
Foo f;
f.x; // UFCS getter1
f.y!int; // UFCS getter2
f.x = 10; // UFCS setter1
f.x!int = 10; // UFCS setter2
}