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 917599f commit 47962dcCopy full SHA for 47962dc
compiler/src/dotty/tools/dotc/ast/Desugar.scala
@@ -1128,7 +1128,7 @@ object desugar {
1128
case TypeDef(_, rhs) =>
1129
def rhsOK(tree: Tree): Boolean = tree match {
1130
case bounds: TypeBoundsTree => !bounds.alias.isEmpty
1131
- case _: Template => false
+ case _: Template | _: MatchTypeTree => false
1132
case LambdaTypeTree(_, body) => rhsOK(body)
1133
case _ => true
1134
}
tests/neg/6890.scala
@@ -0,0 +1,3 @@
1
+object Test {
2
+ opaque type A[T] = T match { case Int => Int } // error: Modifier `opaque` is not allowed for this definition
3
+}
0 commit comments