Skip to content

Commit

Permalink
[Java] Verify illegal type members in local declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
deathaxe committed Oct 21, 2023
1 parent 8e5471d commit 35fe3a3
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions Java/tests/syntax_test_java.java
Original file line number Diff line number Diff line change
Expand Up @@ -4671,6 +4671,22 @@ void declarePrimitiveTypes() {
// ^^^^^ constant.other.java
// ^ punctuation.terminator.java

int.foo bar
// ^^^^^^^^ meta.declaration.type.java
// ^^^ meta.declaration.identifier.java
// ^^^ storage.type.primitive.java
// ^ invalid.illegal.unexpected-accessor.java
// ^^^ invalid.illegal.unexpected-member.java
// ^^^ variable.other.java

int.class foo
// ^^^^^^^^^^ meta.declaration.type.java
// ^^^ meta.declaration.identifier.java
// ^^^ storage.type.primitive.java
// ^ invalid.illegal.unexpected-accessor.java
// ^^^^^ invalid.illegal.unexpected-member.java
// ^^^ variable.other.java

int[]
// ^^^^^^ - meta.declaration
// ^^^ storage.type.primitive.java
Expand All @@ -4688,6 +4704,24 @@ void declarePrimitiveTypes() {
// ^^ storage.modifier.array.java
// ^^^ variable.other.java

int[].foo bar
// ^^^^^^^^^^ meta.declaration.type.java
// ^^^ meta.declaration.identifier.java
// ^^^ storage.type.primitive.java
// ^^ storage.modifier.array.java
// ^ invalid.illegal.unexpected-accessor.java
// ^^^ invalid.illegal.unexpected-member.java
// ^^^ variable.other.java

int[].class foo
// ^^^^^^^^^^^^ meta.declaration.type.java
// ^^^ meta.declaration.identifier.java
// ^^^ storage.type.primitive.java
// ^^ storage.modifier.array.java
// ^ invalid.illegal.unexpected-accessor.java
// ^^^^^ invalid.illegal.unexpected-member.java
// ^^^ variable.other.java

int foo[], [] ;
// ^^^^ meta.declaration.type.java
// ^^^^^ meta.declaration.identifier.java
Expand Down

0 comments on commit 35fe3a3

Please sign in to comment.