Skip to content

Commit 2d572c5

Browse files
authored
Merge pull request #3192 from dotty-staging/fix-#3189
Fix #3189: Make TreeTypeMap in hoistSuperArgs more robust
2 parents ba01fba + 9740ab8 commit 2d572c5

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,10 @@ class HoistSuperArgs extends MiniPhaseTransform with IdentityDenotTransformer {
128128
case tp: NamedType
129129
if (tp.symbol.owner == cls || tp.symbol.owner == constr) &&
130130
tp.symbol.isParamOrAccessor =>
131-
val mappedSym = origToParam(tp.symbol)
132-
if (tp.symbol.isType) mappedSym.typeRef else mappedSym.termRef
131+
origToParam.get(tp.symbol) match {
132+
case Some(mappedSym) => if (tp.symbol.isType) mappedSym.typeRef else mappedSym.termRef
133+
case None => mapOver(tp)
134+
}
133135
case _ =>
134136
mapOver(tp)
135137
}

tests/pos/i3189.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
class Test[A](action: A => A) {
2+
def this() = this(a => a)
3+
}

0 commit comments

Comments
 (0)