diff options
author | Martin Odersky <odersky@gmail.com> | 2015-10-22 12:07:14 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2015-10-22 12:21:26 +0200 |
commit | 30e5f322a0fb9c4c43cbeb3231423ac95571a3a7 (patch) | |
tree | 1acdcd668e7f27cdf7d4118cf7708ffa528df046 /src/dotty/tools/dotc/typer/Checking.scala | |
parent | 28193a6c53482cbec36530c25dc1a26438b81a18 (diff) | |
download | dotty-30e5f322a0fb9c4c43cbeb3231423ac95571a3a7.tar.gz dotty-30e5f322a0fb9c4c43cbeb3231423ac95571a3a7.tar.bz2 dotty-30e5f322a0fb9c4c43cbeb3231423ac95571a3a7.zip |
Avoid mutation in checkWellFormed
It's done anyway later in FirstTransform.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Checking.scala')
-rw-r--r-- | src/dotty/tools/dotc/typer/Checking.scala | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/typer/Checking.scala b/src/dotty/tools/dotc/typer/Checking.scala index 1c0274c84..fa417beec 100644 --- a/src/dotty/tools/dotc/typer/Checking.scala +++ b/src/dotty/tools/dotc/typer/Checking.scala @@ -258,10 +258,11 @@ object Checking { fail(i"`abstract override' modifier only allowed for members of traits") if (sym.is(Trait) && sym.is(Final)) fail(i"$sym may not be `final'") - if (sym.hasAnnotation(defn.NativeAnnot)) - if (sym.is(Deferred)) sym.resetFlag(Deferred) - else fail(i"`@native' members may not have implementation") - if (sym.is(Deferred, butNot = Param) && !sym.isSelfSym) { + if (sym.hasAnnotation(defn.NativeAnnot)) { + if (!sym.is(Deferred)) + fail(i"`@native' members may not have implementation") + } + else if (sym.is(Deferred, butNot = Param) && !sym.isSelfSym) { if (!sym.owner.isClass || sym.owner.is(Module) || sym.owner.isAnonymousClass) fail(i"only classes can have declared but undefined members$varNote") checkWithDeferred(Private) |