We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d215be0 commit ad97f7fCopy full SHA for ad97f7f
src/dotty/tools/dotc/transform/ExtensionMethods.scala
@@ -34,7 +34,8 @@ class ExtensionMethods extends MiniPhaseTransform with DenotTransformer with Ful
34
override def transform(ref: SingleDenotation)(implicit ctx: Context): SingleDenotation = ref match {
35
case ref: ClassDenotation if ref is ModuleClass =>
36
ref.linkedClass match {
37
- case origClass: ClassSymbol if isDerivedValueClass(origClass) =>
+ // In Scala 2, extension methods are added before pickling so we should not generate them again
38
+ case origClass: ClassSymbol if isDerivedValueClass(origClass) && !(origClass is Scala2x) =>
39
val cinfo = ref.classInfo
40
val decls1 = cinfo.decls.cloneScope
41
ctx.atPhase(thisTransformer.next) { implicit ctx =>
0 commit comments