Skip to content

Commit e2db176

Browse files
committed
wip
1 parent 7a8c761 commit e2db176

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2045,12 +2045,11 @@ class Typer extends Namer
20452045
val sym = ctx.newPatternBoundSymbol("ttt".toTypeName, bindingBounds, expr.span)
20462046
val bind = Bind(sym, untpd.Ident(nme.WILDCARD).withType(bindingBounds)).withSpan(expr.span)
20472047

2048-
val bindedType = bind // FIXME need to create a new type
20492048
def spliceOwner(ctx: Context): Symbol =
20502049
if (ctx.mode.is(Mode.QuotedPattern)) spliceOwner(ctx.outer) else ctx.owner
20512050
val pat = typedPattern(tree.expr, defn.QuotedTypeType.appliedTo(sym.typeRef))(
20522051
spliceContext.retractMode(Mode.QuotedPattern).withOwner(spliceOwner(ctx)))
2053-
Splice(pat)
2052+
Splice(Typed(pat, AppliedTypeTree(TypeTree(defn.QuotedTypeType), bind :: Nil)))
20542053
}
20552054

20562055
} else {

library/src-bootstrapped/scala/internal/Quoted.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ object Quoted {
2424
/** A splice of a name in a quoted pattern is desugared by wrapping getting this annotation */
2525
class patternBindHole extends Annotation
2626

27-
type Hole[T] = T
27+
type patternTypeHole[T] = T
2828
}

tests/pos/quotedPatterns.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ object Test {
3434
// case '{ def $ff[T](i: T): Int = $z; 2 } =>
3535
// val a: quoted.matching.Bind[[T] => T => Int] = ff
3636
// z
37-
case '{ poly[$t]($x); 2 } => ???
37+
// case '{ poly[$t]($x); 2 } => ???
38+
case '{ val x: $t = $x; (${scala.quoted.matching.Bind(t2)}: x.type); 4 } if t == t2 => ???
3839
case _ => ???
3940
}
4041

0 commit comments

Comments
 (0)