File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
src/dotty/tools/dotc/transform Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -74,7 +74,12 @@ class Mixin extends MiniPhaseTransform with SymTransformer { thisTransform =>
74
74
override def transformSym (sym : SymDenotation )(implicit ctx : Context ): SymDenotation =
75
75
if (sym.is(Accessor , butNot = Deferred ) && sym.owner.is(Trait ))
76
76
sym.copySymDenotation(initFlags = sym.flags | Deferred )
77
- else
77
+ else if (sym.is(Scala2x ) && sym.is(Trait , JavaDefined )) { // fixup scala2 traits to become interfaces
78
+ val info = sym.asClass.classInfo
79
+ val parents : List [TypeRef ] = defn.ObjectType .asInstanceOf [TypeRef ] :: info.parents // new superClass is object
80
+ val newInfo = info.derivedClassInfo(classParents = parents)
81
+ sym.copySymDenotation(initFlags = sym.flags | JavaInterface , info = newInfo)
82
+ } else
78
83
sym
79
84
80
85
private def initializer (sym : Symbol )(implicit ctx : Context ): TermSymbol = {
You can’t perform that action at this time.
0 commit comments