Skip to content

Commit efb38d2

Browse files
committed
Avoid immediate source of crash in TypeErasure for #16368
Fixes #16368 (?)
1 parent 3635303 commit efb38d2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler/src/dotty/tools/dotc/core/TypeErasure.scala

+2-1
Original file line numberDiff line numberDiff line change
@@ -735,9 +735,10 @@ class TypeErasure(sourceLanguage: SourceLanguage, semiEraseVCs: Boolean, isConst
735735
// but potentially re-introduced by ResolveSuper, when we add
736736
// forwarders to mixin methods.
737737
// See doc comment for ElimByName for speculation how we could improve this.
738-
else
738+
else if rt.exists then
739739
MethodType(Nil, Nil,
740740
eraseResult(rt.translateFromRepeated(toArray = sourceLanguage.isJava)))
741+
else rt
741742
case tp1: PolyType =>
742743
eraseResult(tp1.resultType) match
743744
case rt: MethodType => rt

0 commit comments

Comments
 (0)