Skip to content

Commit 43b5978

Browse files
committed
Fix #2980: Crash when inlining HK type parameters
When we inline we need to construct new trees with new symbols. This is handled by TreeTypeMap which was missing a case for LambdaTypeTree (the parameters of a type lambda are TypeDefs and thus have symbols that need to be replaced). This caused a crash in pickling since we ended up trying to pickle the same symbol twice.
1 parent 8b8baba commit 43b5978

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

compiler/src/dotty/tools/dotc/ast/TreeTypeMap.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ final class TreeTypeMap(
9898
case ann => ann
9999
}
100100
res
101+
case tdef @ LambdaTypeTree(tparams, body) =>
102+
val (tmap1, tparams1) = transformDefs(tparams)
103+
cpy.LambdaTypeTree(tdef)(tparams1, tmap1.transform(body))
101104
case blk @ Block(stats, expr) =>
102105
val (tmap1, stats1) = transformDefs(stats)
103106
val expr1 = tmap1.transform(expr)

0 commit comments

Comments
 (0)