Skip to content

Commit c0616af

Browse files
committed
Set case on quote pattern type variables while desugaring
1 parent 10b1a74 commit c0616af

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

compiler/src/dotty/tools/dotc/ast/Desugar.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,8 +384,11 @@ object desugar {
384384
case tdef @ untpd.TypeDef(name, _) => !tdef.isBackquoted && name.isVarPattern
385385
case _ => false
386386
}
387+
val untpdCaseTypeVariables = untpdTypeVariables.asInstanceOf[List[untpd.TypeDef]].map {
388+
tdef => tdef.withMods(tdef.mods | Case)
389+
}
387390
val pattern = if otherStats.isEmpty then expr else untpd.cpy.Block(tree)(otherStats, expr)
388-
(untpdTypeVariables.asInstanceOf[List[untpd.TypeDef]], pattern)
391+
(untpdCaseTypeVariables, pattern)
389392
case _ =>
390393
(Nil, tree)
391394

compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,6 @@ trait QuotesAndSplices {
242242
val allTypeBindings = List.newBuilder[Bind]
243243
for tpVar <- typeTypeVariables do
244244
val sym = tpVar.symbol
245-
sym.setFlag(Case)
246245
allTypeBindings += Bind(sym, untpd.Ident(nme.WILDCARD).withType(sym.info)).withSpan(tpVar.span)
247246

248247
val body1 = inContext(patternCtx) {

0 commit comments

Comments
 (0)