diff options
author | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2016-04-18 21:44:55 +0200 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2016-06-07 14:18:27 +0200 |
commit | 63eb88da7358f3387b499c36422607564aaa0d47 (patch) | |
tree | c148c1bdc5dc080edcc42dfcce13ec4a570bca66 | |
parent | 27846bb2ba8519decbfe4a152460805e591ec98b (diff) | |
download | dotty-63eb88da7358f3387b499c36422607564aaa0d47.tar.gz dotty-63eb88da7358f3387b499c36422607564aaa0d47.tar.bz2 dotty-63eb88da7358f3387b499c36422607564aaa0d47.zip |
Drop support for @static lazy vals.
It's not clear how they should be implemented.
-rw-r--r-- | src/dotty/tools/dotc/transform/CheckStatic.scala | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/transform/CheckStatic.scala b/src/dotty/tools/dotc/transform/CheckStatic.scala index 2275331a5..d47c88130 100644 --- a/src/dotty/tools/dotc/transform/CheckStatic.scala +++ b/src/dotty/tools/dotc/transform/CheckStatic.scala @@ -32,6 +32,7 @@ import TypeUtils._ * is not allowed to inherit classes that define a term member with name `foo`. * 5. Only `@static` methods and vals are supported in companions of traits. * Java8 supports those, but not vars, and JavaScript does not have interfaces at all. + * 6. `@static` Lazy vals are currently unsupported. */ class CheckStatic extends MiniPhaseTransform { thisTransformer => import ast.tpd._ @@ -65,6 +66,8 @@ class CheckStatic extends MiniPhaseTransform { thisTransformer => ctx.error("companion classes cannot define members with same name as @static member", defn.pos) } else if (defn.symbol.is(Flags.Mutable) && companion.is(Flags.Trait)) { ctx.error("Companions of traits cannot define mutable @static fields") + } else if (defn.symbol.is(Flags.Lazy)) { + ctx.error("Lazy @static fields are not supported") } } else hadNonStaticField = hadNonStaticField || defn.isInstanceOf[ValDef] |