Skip to content

Commit 235e393

Browse files
committed
Fix incorrect owner in ReifyQuotes
The problem is exhibited in the following test case: tests/pos/i7052.scala It is not discovered before, because previously we are using the wrong context for typing ahead annotations.
1 parent 5d41e78 commit 235e393

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/src/dotty/tools/dotc/transform/ReifyQuotes.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ class ReifyQuotes extends MacroTransform {
270270

271271
val tpe = MethodType(defn.SeqType.appliedTo(defn.AnyType) :: Nil, tree.tpe.widen)
272272
val meth = ctx.newSymbol(lambdaOwner, UniqueName.fresh(nme.ANON_FUN), Synthetic | Method, tpe)
273-
Closure(meth, tss => body(tss.head.head)(ctx.withOwner(meth)).changeOwner(ctx.owner, meth)).withSpan(tree.span)
273+
Closure(meth, tss => body(tss.head.head)(ctx.withOwner(meth)).changeNonLocalOwners(meth)).withSpan(tree.span)
274274
}
275275

276276
private def transformWithCapturer(tree: Tree)(capturer: mutable.Map[Symbol, Tree] => Tree => Tree)(implicit ctx: Context): Tree = {

0 commit comments

Comments
 (0)