Skip to content

Commit 5bcbad2

Browse files
authored
Merge pull request #1969 from dotty-staging/fix/annot-fun
Fix parsing annotation on function type
2 parents e8513e1 + 57ccea1 commit 5bcbad2

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

compiler/src/dotty/tools/dotc/parsing/Parsers.scala

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,11 @@ object Parsers {
713713
if (t.isInstanceOf[ByNameTypeTree])
714714
syntaxError(ByNameParameterNotSupported())
715715
val tuple = atPos(start) { makeTupleOrParens(ts) }
716-
infixTypeRest(refinedTypeRest(withTypeRest(simpleTypeRest(tuple))))
716+
infixTypeRest(
717+
refinedTypeRest(
718+
withTypeRest(
719+
annotTypeRest(
720+
simpleTypeRest(tuple)))))
717721
}
718722
}
719723
}

tests/pos/annot.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,6 @@ class Test {
2424

2525
class C extends A @uncheckedVariance () with B @uncheckedVariance { val x = 10 }
2626

27+
val f: (Int => Int) @uncheckedVariance = ???
2728
}
2829

0 commit comments

Comments
 (0)