File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed
compiler/src/dotty/tools/dotc/typer
library/src-bootstrapped/scala/internal Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -2045,12 +2045,11 @@ class Typer extends Namer
2045
2045
val sym = ctx.newPatternBoundSymbol(" ttt" .toTypeName, bindingBounds, expr.span)
2046
2046
val bind = Bind (sym, untpd.Ident (nme.WILDCARD ).withType(bindingBounds)).withSpan(expr.span)
2047
2047
2048
- val bindedType = bind // FIXME need to create a new type
2049
2048
def spliceOwner (ctx : Context ): Symbol =
2050
2049
if (ctx.mode.is(Mode .QuotedPattern )) spliceOwner(ctx.outer) else ctx.owner
2051
2050
val pat = typedPattern(tree.expr, defn.QuotedTypeType .appliedTo(sym.typeRef))(
2052
2051
spliceContext.retractMode(Mode .QuotedPattern ).withOwner(spliceOwner(ctx)))
2053
- Splice (pat)
2052
+ Splice (Typed ( pat, AppliedTypeTree ( TypeTree (defn. QuotedTypeType ), bind :: Nil )) )
2054
2053
}
2055
2054
2056
2055
} else {
Original file line number Diff line number Diff line change @@ -24,5 +24,5 @@ object Quoted {
24
24
/** A splice of a name in a quoted pattern is desugared by wrapping getting this annotation */
25
25
class patternBindHole extends Annotation
26
26
27
- type Hole [T ] = T
27
+ type patternTypeHole [T ] = T
28
28
}
Original file line number Diff line number Diff line change @@ -34,7 +34,8 @@ object Test {
34
34
// case '{ def $ff[T](i: T): Int = $z; 2 } =>
35
35
// val a: quoted.matching.Bind[[T] => T => Int] = ff
36
36
// 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 => ???
38
39
case _ => ???
39
40
}
40
41
You can’t perform that action at this time.
0 commit comments