We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 76a76ee commit da29981Copy full SHA for da29981
compiler/src/dotty/tools/dotc/parsing/Parsers.scala
@@ -2338,7 +2338,8 @@ object Parsers {
2338
(ofClass || ofInstance) && {
2339
val lookahead = in.lookaheadScanner // skips newline on startup
2340
lookahead.nextToken() // skip the `given`
2341
- if (lookahead.token == IDENTIFIER || lookahead.token == BACKQUOTED_IDENT) {
+ if (lookahead.token == IDENTIFIER && lookahead.name != nme.as ||
2342
+ lookahead.token == BACKQUOTED_IDENT) {
2343
lookahead.nextToken()
2344
if (lookahead.token == LBRACKET) {
2345
tests/pos/givens.scala
@@ -0,0 +1,5 @@
1
+class A
2
+class B
3
+
4
+given as A
5
+given as B
0 commit comments