Fix type annot on method ref in cast ctx

This commit is contained in:
Clément Fournier
2019-07-12 02:53:50 +02:00
parent a64c467293
commit d664b175aa
2 changed files with 16 additions and 1 deletions

View File

@ -2499,7 +2499,7 @@ private void UnaryExprNotPmStart() #void:
// Condensed FIRST set of UnaryExpressionNotPlusMinus // Condensed FIRST set of UnaryExpressionNotPlusMinus
// Avoid looking ahead for a whole UnaryExpressionNotPlusMinus, but just for a token // Avoid looking ahead for a whole UnaryExpressionNotPlusMinus, but just for a token
"~" | "!" | "(" | "switch" | "new" | "this" | "super" | Literal() "~" | "!" | "(" | "switch" | "new" | "this" | "super" | Literal() | "@"
| <IDENTIFIER> | <IDENTIFIER>
| "void" | PrimitiveType() | "void" | PrimitiveType()
} }

View File

@ -209,6 +209,21 @@ class ASTMethodReferenceTest : ParserTestSpec({
it::getTypeArguments shouldBe null it::getTypeArguments shouldBe null
} }
} }
// annotated method ref in cast ctx (lookahead trickery)
"(Foo) @Vernal Date::getDay" should parseAs {
castExpr {
classType("Foo")
methodRef(methodName = "getDay") {
classType("Date") {
annotation("Vernal")
}
it::getTypeArguments shouldBe null
}
}
}
} }
} }
}) })