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/typer/Namer.scala | |
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/typer/Namer.scala')
-rw-r--r-- | src/dotty/tools/dotc/typer/Namer.scala | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/typer/Namer.scala b/src/dotty/tools/dotc/typer/Namer.scala index 3a1f0a98b..e8bb1b9e7 100644 --- a/src/dotty/tools/dotc/typer/Namer.scala +++ b/src/dotty/tools/dotc/typer/Namer.scala @@ -492,6 +492,13 @@ class Namer { typer: Typer => index(rest)(inClassContext(selfInfo)) denot.info = ClassInfo(cls.owner.thisType, cls, parentRefs, decls, selfInfo) + if (cls is Trait) { + if (body forall isNoInitMember) { + cls.setFlag(NoInits) + if (body forall isPureInterfaceMember) + cls.setFlag(PureInterface) + } + } } } |