File tree Expand file tree Collapse file tree 4 files changed +19
-3
lines changed
compiler/src/dotty/tools/dotc/transform Expand file tree Collapse file tree 4 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -568,8 +568,7 @@ class ReifyQuotes extends MacroTransformWithImplicits with InfoTransformer {
568568 quotation(quotedTree, tree)
569569 case tree : TypeTree if tree.tpe.typeSymbol.isSplice =>
570570 val splicedType = tree.tpe.stripTypeVar.asInstanceOf [TypeRef ].prefix.termSymbol
571- if (levelOf.get(splicedType).contains(level)) tree
572- else splice(ref(splicedType).select(tpnme.UNARY_~ ))
571+ splice(ref(splicedType).select(tpnme.UNARY_~ ).withPos(tree.pos))
573572 case tree : Select if tree.symbol.isSplice =>
574573 splice(tree)
575574 case tree : RefTree if isCaptured(tree.symbol, level) =>
Original file line number Diff line number Diff line change 1+
2+ import scala .quoted ._
3+
4+ object Test {
5+ def loop [T ](x : Expr [T ])(implicit t : Type [T ]): Expr [T ] = ' {
6+ val y : ~ t = ~ x
7+ ~ loop( // error: inferred loop[~t] where T should be used
8+ '(y)
9+ )
10+ }
11+ }
Original file line number Diff line number Diff line change 1+
2+ import scala .quoted ._
3+
4+ object Test {
5+ def loop [T ](x : Expr [T ])(implicit t : Type [T ]): Expr [T ] = ' { val y = ~ x; ~ loop('(y)) }
6+ }
Original file line number Diff line number Diff line change @@ -3,5 +3,5 @@ import scala.quoted._
33
44object Test {
55 def loop [T ](x : Expr [T ])(implicit t : Type [T ]): Expr [T ] =
6- ' { val y : ~ t = ~ x; ~ loop('(y)) }
6+ ' { val y : T = ~ x; ~ loop('(y)) }
77}
You can’t perform that action at this time.
0 commit comments