diff options
author | Hubert Plociniczak <hubert.plociniczak@gmail.com> | 2012-09-21 14:10:33 +0200 |
---|---|---|
committer | Hubert Plociniczak <hubert.plociniczak@gmail.com> | 2012-10-18 09:43:16 +0200 |
commit | 4c86dbbc49266684f66b8731d998b5a3ed508f21 (patch) | |
tree | 606db3f2db4c901b752878e89a1504428ce925e9 /test/files/neg/valueclasses-impl-restrictions.check | |
parent | 87c5895d4bae62f1b5bacbd145f2e0fddcccf423 (diff) | |
download | scala-4c86dbbc49266684f66b8731d998b5a3ed508f21.tar.gz scala-4c86dbbc49266684f66b8731d998b5a3ed508f21.tar.bz2 scala-4c86dbbc49266684f66b8731d998b5a3ed508f21.zip |
Closes SI-6358. Move accessor generation for lazy vals to typers.
Until now lazy accessors were handled somehow special because their symbol was created in typers but the corresponding tree was only added in Refchecks. This irregularity caused serious problems for value classes. Also it now looks just better when lazy value is treated in a similar way as other fields.
I needed to adapt reifier so that it handles the new implementation correctly. Previously it had to recreate lazy val only by removing defdef and renaming. Now we basically need to recreate lazy val from scratch.
There is one minor change to cps plugin but that is still fine because lazy vals were never really part of the transformation.
Some range positions needed to be fixed manually. We could do it at the creation time but that would require a lot more "if (symbol.isLazy)" conditions for MethodSyntheis and Symbol/Tree creation and would just unnecessary complicate api. If someone has a better idea, please speak up. Range positions changes were necessary because previously accessors were created at refchecks and they weren't checked by validator (even though they were wrong).
This commit removes lazy val implementation restriction introduced for 2.10.0.
(cherry-picked from 981424b)
Diffstat (limited to 'test/files/neg/valueclasses-impl-restrictions.check')
-rw-r--r-- | test/files/neg/valueclasses-impl-restrictions.check | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/test/files/neg/valueclasses-impl-restrictions.check b/test/files/neg/valueclasses-impl-restrictions.check index 17d07ba960..63924493aa 100644 --- a/test/files/neg/valueclasses-impl-restrictions.check +++ b/test/files/neg/valueclasses-impl-restrictions.check @@ -2,20 +2,16 @@ valueclasses-impl-restrictions.scala:3: error: implementation restriction: neste This restriction is planned to be removed in subsequent releases. object X ^ -valueclasses-impl-restrictions.scala:4: error: implementation restriction: lazy val is not allowed in value class -This restriction is planned to be removed in subsequent releases. - lazy val y = 1 - ^ -valueclasses-impl-restrictions.scala:10: error: implementation restriction: nested trait is not allowed in value class +valueclasses-impl-restrictions.scala:9: error: implementation restriction: nested trait is not allowed in value class This restriction is planned to be removed in subsequent releases. trait I2 { ^ -valueclasses-impl-restrictions.scala:16: error: implementation restriction: nested class is not allowed in value class +valueclasses-impl-restrictions.scala:15: error: implementation restriction: nested class is not allowed in value class This restriction is planned to be removed in subsequent releases. val i2 = new I2 { val q = x.s } ^ -valueclasses-impl-restrictions.scala:22: error: implementation restriction: nested class is not allowed in value class +valueclasses-impl-restrictions.scala:21: error: implementation restriction: nested class is not allowed in value class This restriction is planned to be removed in subsequent releases. private[this] class I2(val q: String) ^ -5 errors found +four errors found |