Report new restricted identifiers: 'yield' and 'record'.

Fixes IDEA-230808 Disallow usage of 'record' as type name
Fixes IDEA-226604 Disallow using the 'yield' as the class name since Java 14

GitOrigin-RevId: a97753893fd8d0dac98a1a76f499b8c9474c3a7f
This commit is contained in:
Tagir Valeev
2020-01-17 11:12:57 +00:00
committed by intellij-monorepo-bot
parent 42fdba8835
commit 34243206dc
8 changed files with 56 additions and 19 deletions
@@ -1,5 +1,8 @@
import java.lang.annotation.*;
class <error descr="'record' is a restricted identifier and cannot be used for type declarations">record</error> {
void x(<error descr="Illegal reference to restricted type 'record'">record</error> r) {}
}
record <error descr="Record has no header declared">NoComponentList</error> {}
record NoComponents() {}
class ClassWithComponents<error descr="Record header declared for non-record">(int x)</error> {}