dmd/compiler/test/fail_compilation/funcpostattr.d
Nick Treleaven 7643dc6041
Fix Issue 4663 - Wrong 'static' position error message (#15321)
Also detects `extern`, `deprecated`, `ref`, `override` and friends.
2023-06-14 08:42:32 +03:00

21 lines
629 B
D

/*
TEST_OUTPUT:
---
fail_compilation/funcpostattr.d(11): Error: `deprecated` token is not allowed in postfix position
fail_compilation/funcpostattr.d(11): Error: `extern` token is not allowed in postfix position
fail_compilation/funcpostattr.d(15): Error: `static` token is not allowed in postfix position
fail_compilation/funcpostattr.d(15): Error: `ref` token is not allowed in postfix position
fail_compilation/funcpostattr.d(20): Error: `override` token is not allowed in postfix position
---
*/
void foo() deprecated extern;
void main() {
int i;
int foo() static ref => i;
}
class C
{
void foo() override {}
}