From b4b91dcb58b5804f7ec1513e8f4d1e4534fd8018 Mon Sep 17 00:00:00 2001 From: Iulian Dragos Date: Wed, 27 Jun 2007 14:26:47 +0000 Subject: Merged lazy values branch to trunk. --- test/files/neg/lazyvals.scala | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 test/files/neg/lazyvals.scala (limited to 'test/files/neg/lazyvals.scala') diff --git a/test/files/neg/lazyvals.scala b/test/files/neg/lazyvals.scala new file mode 100644 index 0000000000..8514d42c13 --- /dev/null +++ b/test/files/neg/lazyvals.scala @@ -0,0 +1,26 @@ + +/** Test which should fail compilation */ +class Lazy { + + // no abstract lazy values + lazy val t: Int + + // no lazy var + lazy var p: Int = 100 + + // no lazy defs + lazy def q: Double = 0.0 + + def foo { + lazy val t; + () + } + + // no trait/class/object can be lazy + lazy trait T {} + lazy class C {} + lazy object O {} + + // no lazy modifiers in class parameters + class A(lazy val obj: Object) {} +} -- cgit v1.2.3