Skip to content

Commit

Permalink
override is a valid identifier in Java, not a keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
griggt committed Jul 11, 2021
1 parent 7627583 commit 9f346d3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/parsing/JavaTokens.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ object JavaTokens extends TokensCommon {

final val javaOnlyKeywords: TokenSet = tokenRange(INSTANCEOF, ASSERT)
final val sharedKeywords: BitSet = BitSet( IF, FOR, ELSE, THIS, NULL, NEW, SUPER, ABSTRACT, FINAL, PRIVATE, PROTECTED,
OVERRIDE, EXTENDS, TRUE, FALSE, CLASS, IMPORT, PACKAGE, DO, THROW, TRY, CATCH, FINALLY, WHILE, RETURN )
EXTENDS, TRUE, FALSE, CLASS, IMPORT, PACKAGE, DO, THROW, TRY, CATCH, FINALLY, WHILE, RETURN )
final val primTypes: TokenSet = tokenRange(VOID, DOUBLE)
final val keywords: BitSet = sharedKeywords | javaOnlyKeywords | primTypes

Expand Down
3 changes: 3 additions & 0 deletions tests/pos/i13046/A.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
interface A {
public boolean override();
}
3 changes: 3 additions & 0 deletions tests/pos/i13046/B.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class B extends A {
override def `override`: Boolean = true
}

0 comments on commit 9f346d3

Please sign in to comment.