Skip to content

Commit de67c05

Browse files
oderskyDarkDimius
authored andcommitted
Allow FutureDefs in changeOwner
Without it, the previous commit make LazyVals blow up wgen compiling dotc/transform. I could not fugure out why, but here is the stacktrace I saw. dotty.tools.dotc.core.Denotations$NotDefinedHere: demanding denotation of method $anonfun at phase seqLiterals(17) outside defined interval: defined periods are Period(22..22, run = 2) at dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:598) at dotty.tools.dotc.core.Types$NamedType.computeDenot(Types.scala:1221) at dotty.tools.dotc.core.Types$NamedType.denotAt(Types.scala:1206) at dotty.tools.dotc.core.Types$NamedType.denot(Types.scala:1194) at dotty.tools.dotc.ast.Trees$DenotingTree.denot(Trees.scala:270) at dotty.tools.dotc.ast.Trees$Tree.symbol(Trees.scala:187) at dotty.tools.dotc.ast.TypedTreeInfo$$anonfun$localSyms$1.apply(TreeInfo.scala:437) at dotty.tools.dotc.ast.TypedTreeInfo$$anonfun$localSyms$1.apply(TreeInfo.scala:437) at scala.collection.TraversableLike$WithFilter$$anonfun$map$2.apply(TraversableLike.scala:728) at scala.collection.immutable.List.foreach(List.scala:381) at scala.collection.TraversableLike$WithFilter.map(TraversableLike.scala:727) at dotty.tools.dotc.ast.TypedTreeInfo$class.localSyms(TreeInfo.scala:437) at dotty.tools.dotc.ast.tpd$.localSyms(tpd.scala:19) at dotty.tools.dotc.ast.TreeTypeMap.transformDefs(TreeTypeMap.scala:116) at dotty.tools.dotc.ast.TreeTypeMap.transform(TreeTypeMap.scala:98) at dotty.tools.dotc.ast.Trees$Instance$TreeMap$$anonfun$transform$2.apply(Trees.scala:1181) at dotty.tools.dotc.ast.Trees$Instance$TreeMap$$anonfun$transform$2.apply(Trees.scala:1181) at scala.collection.immutable.List.loop$1(List.scala:172) at scala.collection.immutable.List.mapConserve(List.scala:188) at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1181) at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1100) at dotty.tools.dotc.ast.TreeTypeMap.transform(TreeTypeMap.scala:108) at dotty.tools.dotc.ast.Trees$Instance$TreeMap$$anonfun$transform$2.apply(Trees.scala:1181) at dotty.tools.dotc.ast.Trees$Instance$TreeMap$$anonfun$transform$2.apply(Trees.scala:1181) at scala.collection.immutable.List.loop$1(List.scala:172) at scala.collection.immutable.List.mapConserve(List.scala:188) at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1181) at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1100) at dotty.tools.dotc.ast.TreeTypeMap.transform(TreeTypeMap.scala:108) at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1100) at dotty.tools.dotc.ast.TreeTypeMap.transform(TreeTypeMap.scala:108) at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1094) at dotty.tools.dotc.ast.TreeTypeMap.transform(TreeTypeMap.scala:108) at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1100) at dotty.tools.dotc.ast.TreeTypeMap.transform(TreeTypeMap.scala:108) at dotty.tools.dotc.ast.TreeTypeMap.apply(TreeTypeMap.scala:129) at dotty.tools.dotc.ast.tpd$TreeOps$.loop$1(tpd.scala:565) at dotty.tools.dotc.ast.tpd$TreeOps$.changeOwner$extension(tpd.scala:568) at dotty.tools.dotc.transform.LazyVals.transformLocalValDef(LazyVals.scala:110) at dotty.tools.dotc.transform.LazyVals.transformValDef(LazyVals.scala:64)
1 parent b50d209 commit de67c05

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/dotty/tools/dotc/ast/tpd.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
563563
loop(from.owner, from :: froms, to :: tos)
564564
else {
565565
//println(i"change owner ${from :: froms}%, % ==> $tos of $tree")
566-
new TreeTypeMap(oldOwners = from :: froms, newOwners = tos).apply(tree)
566+
new TreeTypeMap(oldOwners = from :: froms, newOwners = tos)(ctx.withMode(Mode.FutureDefsOK)).apply(tree)
567567
}
568568
}
569569
loop(from, Nil, to :: Nil)

0 commit comments

Comments
 (0)