diff options
author | Martin Odersky <odersky@gmail.com> | 2015-07-02 14:36:36 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2015-07-02 14:37:12 +0200 |
commit | f57a6d9db6b8119bef1a78aabef4a527a0f9905c (patch) | |
tree | 7ecdb4b69efc356ef13d2e6196937510fa8245bd /tests/pos/extmethods.scala | |
parent | 257bf52c3d205359896e3c391274091b3fab732e (diff) | |
download | dotty-f57a6d9db6b8119bef1a78aabef4a527a0f9905c.tar.gz dotty-f57a6d9db6b8119bef1a78aabef4a527a0f9905c.tar.bz2 dotty-f57a6d9db6b8119bef1a78aabef4a527a0f9905c.zip |
Check value class member restrictions
According to SIP 15 a value class C must obey the following restrictions:
C may not have secondary constructors.
C may not declare fields (other than the parameter of a value class).
C may not contain object definitions.
C may not have initialization statements.
These are enforced by this commit. We are still missing restrictions on
value class paremeters. We should review what the right set of conditions
is (probably we want to admit non-vals, and maybe even multiple
parameters).
Diffstat (limited to 'tests/pos/extmethods.scala')
-rw-r--r-- | tests/pos/extmethods.scala | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/tests/pos/extmethods.scala b/tests/pos/extmethods.scala index 3edfa2d75..cac1c4ec1 100644 --- a/tests/pos/extmethods.scala +++ b/tests/pos/extmethods.scala @@ -1,7 +1,6 @@ trait That1[A] class T[A, This <: That1[A]](val x: Int) extends AnyVal { self: This => - var next: This = _ final def loop(x: This, cnt: Int): Int = loop(x, cnt + 1) def const[B](): Boolean = return true } |