File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -2041,10 +2041,14 @@ class Typer extends Namer
2041
2041
ctx.error(i " Type must be fully defined. \n Consider annotating the splice using a type ascription: \n ( $tree: XYZ). " , tree.expr.sourcePos)
2042
2042
tree.withType(UnspecifiedErrorType )
2043
2043
} else {
2044
- val bindedType = defn.NothingType // FIXME need to create a new type
2044
+ val bindingBounds = TypeBounds .apply(defn.NothingType , defn.AnyType )
2045
+ val sym = ctx.newPatternBoundSymbol(" ttt" .toTypeName, bindingBounds, expr.span)
2046
+ val bind = Bind (sym, untpd.Ident (nme.WILDCARD ).withType(bindingBounds)).withSpan(expr.span)
2047
+
2048
+ val bindedType = bind // FIXME need to create a new type
2045
2049
def spliceOwner (ctx : Context ): Symbol =
2046
2050
if (ctx.mode.is(Mode .QuotedPattern )) spliceOwner(ctx.outer) else ctx.owner
2047
- val pat = typedPattern(tree.expr, defn.QuotedTypeType .appliedTo(bindedType ))(
2051
+ val pat = typedPattern(tree.expr, defn.QuotedTypeType .appliedTo(sym.typeRef ))(
2048
2052
spliceContext.retractMode(Mode .QuotedPattern ).withOwner(spliceOwner(ctx)))
2049
2053
Splice (pat)
2050
2054
}
You can’t perform that action at this time.
0 commit comments