diff --git a/compiler/src/dotty/tools/dotc/ast/Desugar.scala b/compiler/src/dotty/tools/dotc/ast/Desugar.scala index 27362bff418f..e57b784a8706 100644 --- a/compiler/src/dotty/tools/dotc/ast/Desugar.scala +++ b/compiler/src/dotty/tools/dotc/ast/Desugar.scala @@ -946,7 +946,7 @@ object desugar { tree.withMods(mods) else if tree.name.startsWith("$") && !tree.isBackquoted then report.error( - """Quoted pattern variable names starting with $ are not suported anymore. + """Quoted pattern variable names starting with $ are not supported anymore. |Use lower cases type pattern name instead. |""".stripMargin, tree.srcPos) diff --git a/tests/pos/i9531.scala b/tests/pos/i9531.scala new file mode 100644 index 000000000000..ff82f8e03e43 --- /dev/null +++ b/tests/pos/i9531.scala @@ -0,0 +1,10 @@ +trait Scope: + type Expr[+T] + +def exprQuote[T](x: T)(using s: Scope, dummy: Null = null): s.Expr[T] = ??? +def exprQuote[T <: Singleton](x: T)(using s: Scope): s.Expr[T] = ??? + +def test(using s: Scope): Unit = + val t1: s.Expr[1] = exprQuote(1) + val t2 = exprQuote(1) + val t3: s.Expr[1] = t2