Skip to content

Commit af8ef13

Browse files
committed
fix: erase parameters as Scala 2 too
1 parent a4e1309 commit af8ef13

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ object SourceLanguage:
3232
SourceLanguage.Java
3333
// Scala 2 methods don't have Inline set, except for the ones injected with `patchStdlibClass`
3434
// which are really Scala 3 methods.
35-
else if denot.isClass && denot.is(Scala2x) || (denot.maybeOwner.lastKnownDenotation.is(Scala2x) && !denot.is(Inline)) then
35+
else if denot.isClass && denot.is(Scala2x)
36+
|| (denot.maybeOwner.lastKnownDenotation.is(Scala2x) && !denot.is(Inline))
37+
|| denot.is(Param) && denot.maybeOwner.is(Method) && denot.maybeOwner.maybeOwner.is(Scala2x) then
3638
SourceLanguage.Scala2
3739
else
3840
SourceLanguage.Scala3

0 commit comments

Comments
 (0)