diff options
Diffstat (limited to 'src/continuations/plugin/scala/tools/selectivecps/SelectiveANFTransform.scala')
-rw-r--r-- | src/continuations/plugin/scala/tools/selectivecps/SelectiveANFTransform.scala | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/continuations/plugin/scala/tools/selectivecps/SelectiveANFTransform.scala b/src/continuations/plugin/scala/tools/selectivecps/SelectiveANFTransform.scala index ba87cadfeb..8b39bf3961 100644 --- a/src/continuations/plugin/scala/tools/selectivecps/SelectiveANFTransform.scala +++ b/src/continuations/plugin/scala/tools/selectivecps/SelectiveANFTransform.scala @@ -195,9 +195,12 @@ abstract class SelectiveANFTransform extends PluginComponent with Transform with case _ => if (hasAnswerTypeAnn(tree.tpe)) { - if (!cpsAllowed) - unit.error(tree.pos, "cps code not allowed here / " + tree.getClass + " / " + tree) - + if (!cpsAllowed) { + if (tree.symbol.isLazy) + unit.error(tree.pos, "implementation restriction: cps annotations not allowed on lazy value definitions") + else + unit.error(tree.pos, "cps code not allowed here / " + tree.getClass + " / " + tree) + } log(tree) } |