Skip to content

Commit 1afa928

Browse files
committed
Rely on Trait flag to generate interfaces.
1 parent d47f177 commit 1afa928

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

src/dotty/tools/backend/jvm/DottyBackendInterface.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ class DottyBackendInterface()(implicit ctx: Context) extends BackendInterface{
416416
def isLabel: Boolean = sym is Flags.Label
417417
def hasPackageFlag: Boolean = sym is Flags.Package
418418
def isImplClass: Boolean = sym is Flags.ImplClass
419-
def isInterface: Boolean = (sym is Flags.JavaInterface) || (sym is Flags.PureInterface)
419+
def isInterface: Boolean = (sym is Flags.PureInterface) || (sym is Flags.Trait)
420420
def hasGetter: Boolean = false // used only for generaration of beaninfo todo: implement
421421
def isGetter: Boolean = toDenot(sym).isGetter
422422
def isSetter: Boolean = toDenot(sym).isSetter

src/dotty/tools/dotc/transform/Mixin.scala

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,7 @@ class Mixin extends MiniPhaseTransform with SymTransformer { thisTransform =>
7373
override def transformSym(sym: SymDenotation)(implicit ctx: Context): SymDenotation =
7474
if (sym.is(Accessor, butNot = Deferred) && sym.owner.is(Trait))
7575
sym.copySymDenotation(initFlags = sym.flags | Deferred)
76-
else if(sym.is(Trait, JavaDefined)) { // fixup scala2 traits to become interfaces
77-
val info = sym.asClass.classInfo
78-
val parents: List[TypeRef] = defn.ObjectType.asInstanceOf[TypeRef] :: info.parents // new superClass is object
79-
val newInfo = info.derivedClassInfo(classParents = parents)
80-
sym.copySymDenotation(initFlags = sym.flags | JavaInterface, info = newInfo)
81-
} else
76+
else
8277
sym
8378

8479
private def initializer(sym: Symbol)(implicit ctx: Context): TermSymbol = {

0 commit comments

Comments
 (0)