mirror of
https://github.com/dlang/dmd.git
synced 2025-04-27 05:30:13 +03:00
Fix Issue 4663 - Wrong 'static' position error message (#15321)
Also detects `extern`, `deprecated`, `ref`, `override` and friends.
This commit is contained in:
parent
342a226833
commit
7643dc6041
2 changed files with 30 additions and 0 deletions
21
compiler/test/fail_compilation/funcpostattr.d
Normal file
21
compiler/test/fail_compilation/funcpostattr.d
Normal file
|
@ -0,0 +1,21 @@
|
|||
/*
|
||||
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 {}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue