Skip to content

Commit f55587b

Browse files
committed
Set defTree properly
In the following test: - tests/pos/i3130b.scala If we add `transparent`, then everything is OK. The reason is that we set `Symbol.defTree` systematically in PostTyper. Now the inlining happens after PostTyper, thus `defTree` is not properly set for inlined definitions. To compensate, add ensure that `defTree` is set in the typer. The inliner calls the typer, thus the inlined definitions will have `defTree` set properly.
1 parent e216eea commit f55587b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2125,7 +2125,7 @@ class Typer extends Namer
21252125
case rhs =>
21262126
typedType(rhs)
21272127
checkFullyAppliedType(rhs1)
2128-
assignType(cpy.TypeDef(tdef)(name, rhs1), sym)
2128+
assignType(cpy.TypeDef(tdef)(name, rhs1), sym).setDefTree
21292129
}
21302130

21312131
def typedClassDef(cdef: untpd.TypeDef, cls: ClassSymbol)(using Context): Tree = {
@@ -2265,7 +2265,7 @@ class Typer extends Namer
22652265
for (deriver <- cdef.removeAttachment(AttachedDeriver))
22662266
cdef1.putAttachment(AttachedDeriver, deriver)
22672267

2268-
cdef1
2268+
cdef1.setDefTree
22692269
}
22702270
}
22712271

0 commit comments

Comments
 (0)