From 321563940dee1716c19600efd57acb9ed83a7687 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Thu, 5 Mar 2015 13:22:00 +0100 Subject: Compute PureInterface flag after pickling. ElimLocals becomes a slightly less trivial transform: NormalizeFlags. It also computes PureInterface flag, thus relieving Namer and Unpickler from doing the same in two different ways. Besides, the computation in Namer/TreeInfo was flawed because it did not take into account that nested non-static classes are not allowed in an interface (only static classes are, but these would not be members of the interface in the Scala sense). --- src/dotty/tools/dotc/typer/Namer.scala | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/dotty/tools/dotc/typer/Namer.scala') diff --git a/src/dotty/tools/dotc/typer/Namer.scala b/src/dotty/tools/dotc/typer/Namer.scala index 04f648c00..708fb06c1 100644 --- a/src/dotty/tools/dotc/typer/Namer.scala +++ b/src/dotty/tools/dotc/typer/Namer.scala @@ -523,11 +523,7 @@ class Namer { typer: Typer => index(rest)(inClassContext(selfInfo)) denot.info = ClassInfo(cls.owner.thisType, cls, parentRefs, decls, selfInfo) - if (impl.body forall isNoInitMember) { - cls.setFlag(NoInits) - if (cls.is(Trait) && impl.body.forall(isPureInterfaceMember)) - cls.setFlag(PureInterface) - } + if (impl.body forall isNoInitMember) cls.setFlag(NoInits) } } -- cgit v1.2.3