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.
as
1 parent 5627754 commit 1c1ccdeCopy full SHA for 1c1ccde
compiler/src/dotty/tools/dotc/parsing/Parsers.scala
@@ -3495,7 +3495,7 @@ object Parsers {
3495
then paramClauses(givenOnly = true)
3496
else Nil
3497
newLinesOpt()
3498
- if !name.isEmpty || !tparams.isEmpty || !vparamss.isEmpty then
+ if isIdent(nme.as) || !name.isEmpty || !tparams.isEmpty || !vparamss.isEmpty then
3499
accept(nme.as)
3500
def givenAlias(tpt: Tree) =
3501
accept(EQUALS)
tests/run/instances-anonymous.scala
@@ -63,7 +63,7 @@ object Test extends App {
63
val minimum: T
64
}
65
66
- given Ord[Int] {
+ given as Ord[Int] {
67
def (x: Int).compareTo(y: Int) =
68
if (x < y) -1 else if (x > y) +1 else 0
69
val minimum = Int.MinValue
0 commit comments