diff options
author | Martin Odersky <odersky@gmail.com> | 2014-11-09 13:21:06 +0100 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2014-11-10 13:31:00 +0100 |
commit | 540479ad682fae4278f15e9eb7d4a17f084e21b2 (patch) | |
tree | c7f331ff2764ebfdf5fe5d31f94c529eb504268f /src/dotty/tools/dotc/core/pickling | |
parent | 18cd0dde7e949d6ae20f451f98843d48f28e2e26 (diff) | |
download | dotty-540479ad682fae4278f15e9eb7d4a17f084e21b2.tar.gz dotty-540479ad682fae4278f15e9eb7d4a17f084e21b2.tar.bz2 dotty-540479ad682fae4278f15e9eb7d4a17f084e21b2.zip |
Clean up code relating to interfaces.
Previous implementation was confused about the meaning of interface (with default methods
or without?).
Now instead of Interface/JavaInterface we have
PureInterface - all members are abstract methods
NoInits - all members are methods
Diffstat (limited to 'src/dotty/tools/dotc/core/pickling')
3 files changed, 5 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/core/pickling/ClassfileConstants.scala b/src/dotty/tools/dotc/core/pickling/ClassfileConstants.scala index c35b9ca47..158f6b409 100644 --- a/src/dotty/tools/dotc/core/pickling/ClassfileConstants.scala +++ b/src/dotty/tools/dotc/core/pickling/ClassfileConstants.scala @@ -345,7 +345,7 @@ object ClassfileConstants { case JAVA_ACC_SYNTHETIC => Synthetic case JAVA_ACC_STATIC => JavaStatic case JAVA_ACC_ABSTRACT => if (isAnnotation) EmptyFlags else if (isClass) Abstract else Deferred - case JAVA_ACC_INTERFACE => if (isAnnotation) EmptyFlags else JavaInterface + case JAVA_ACC_INTERFACE => if (isAnnotation) EmptyFlags else PureInterfaceCreationFlags | JavaDefined case _ => EmptyFlags } diff --git a/src/dotty/tools/dotc/core/pickling/ClassfileParser.scala b/src/dotty/tools/dotc/core/pickling/ClassfileParser.scala index 67f825502..f2a5e4171 100644 --- a/src/dotty/tools/dotc/core/pickling/ClassfileParser.scala +++ b/src/dotty/tools/dotc/core/pickling/ClassfileParser.scala @@ -503,8 +503,9 @@ class ClassfileParser( parseExceptions(attrLen) case tpnme.CodeATTR => - if (sym.owner is Flags.Interface) { - sym.setFlag(Flags.DefaultMethod) + if (sym.owner is Flags.JavaTrait) { + sym.resetFlag(Flags.Deferred) + sym.owner.resetFlag(Flags.PureInterface) ctx.log(s"$sym in ${sym.owner} is a java8+ default method.") } in.skip(attrLen) diff --git a/src/dotty/tools/dotc/core/pickling/PickleBuffer.scala b/src/dotty/tools/dotc/core/pickling/PickleBuffer.scala index d2a05bf3a..9f8d4fc2d 100644 --- a/src/dotty/tools/dotc/core/pickling/PickleBuffer.scala +++ b/src/dotty/tools/dotc/core/pickling/PickleBuffer.scala @@ -220,7 +220,7 @@ object PickleBuffer { DEFERRED_PKL -> Deferred, FINAL_PKL -> Final, METHOD_PKL -> Method, - INTERFACE_PKL -> Interface, + INTERFACE_PKL -> PureInterface, MODULE_PKL -> Module, IMPLICIT_PKL -> Implicit, SEALED_PKL -> Sealed, |