aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Petrashko <dmitry.petrashko@gmail.com>2014-12-05 17:26:09 +0100
committerDmitry Petrashko <dmitry.petrashko@gmail.com>2014-12-16 13:15:03 +0100
commitd498b6a4238a765e23ca320f8360799bee845e52 (patch)
treef05bb4b5343e8819fc8b93b5706bcfb8bf3511d2
parent4eccc1b333cfe85de441bed85f64d77252239e46 (diff)
downloaddotty-d498b6a4238a765e23ca320f8360799bee845e52.tar.gz
dotty-d498b6a4238a765e23ca320f8360799bee845e52.tar.bz2
dotty-d498b6a4238a765e23ca320f8360799bee845e52.zip
Rely on Trait flag to generate interfaces.
-rw-r--r--src/dotty/tools/backend/jvm/DottyBackendInterface.scala2
-rw-r--r--src/dotty/tools/dotc/transform/Mixin.scala7
2 files changed, 2 insertions, 7 deletions
diff --git a/src/dotty/tools/backend/jvm/DottyBackendInterface.scala b/src/dotty/tools/backend/jvm/DottyBackendInterface.scala
index 052e778dc..36dc2d334 100644
--- a/src/dotty/tools/backend/jvm/DottyBackendInterface.scala
+++ b/src/dotty/tools/backend/jvm/DottyBackendInterface.scala
@@ -416,7 +416,7 @@ class DottyBackendInterface()(implicit ctx: Context) extends BackendInterface{
def isLabel: Boolean = sym is Flags.Label
def hasPackageFlag: Boolean = sym is Flags.Package
def isImplClass: Boolean = sym is Flags.ImplClass
- def isInterface: Boolean = (sym is Flags.JavaInterface) || (sym is Flags.PureInterface)
+ def isInterface: Boolean = (sym is Flags.PureInterface) || (sym is Flags.Trait)
def hasGetter: Boolean = false // used only for generaration of beaninfo todo: implement
def isGetter: Boolean = toDenot(sym).isGetter
def isSetter: Boolean = toDenot(sym).isSetter
diff --git a/src/dotty/tools/dotc/transform/Mixin.scala b/src/dotty/tools/dotc/transform/Mixin.scala
index 5e91d1254..230763fae 100644
--- a/src/dotty/tools/dotc/transform/Mixin.scala
+++ b/src/dotty/tools/dotc/transform/Mixin.scala
@@ -73,12 +73,7 @@ class Mixin extends MiniPhaseTransform with SymTransformer { thisTransform =>
override def transformSym(sym: SymDenotation)(implicit ctx: Context): SymDenotation =
if (sym.is(Accessor, butNot = Deferred) && sym.owner.is(Trait))
sym.copySymDenotation(initFlags = sym.flags | Deferred)
- else if(sym.is(Trait, JavaDefined)) { // fixup scala2 traits to become interfaces
- val info = sym.asClass.classInfo
- val parents: List[TypeRef] = defn.ObjectType.asInstanceOf[TypeRef] :: info.parents // new superClass is object
- val newInfo = info.derivedClassInfo(classParents = parents)
- sym.copySymDenotation(initFlags = sym.flags | JavaInterface, info = newInfo)
- } else
+ else
sym
private def initializer(sym: Symbol)(implicit ctx: Context): TermSymbol = {