diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2015-07-29 19:22:00 +1000 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2015-07-29 19:22:00 +1000 |
commit | 6d44255964092b672accd7784ddc712d30f1d7c4 (patch) | |
tree | 32ba363fcd1416582bf1ebae01837ff4082b33d4 /build.sbt | |
parent | de641dc265f34b06e17dfa7c64be00219f72b670 (diff) | |
download | scala-async-6d44255964092b672accd7784ddc712d30f1d7c4.tar.gz scala-async-6d44255964092b672accd7784ddc712d30f1d7c4.tar.bz2 scala-async-6d44255964092b672accd7784ddc712d30f1d7c4.zip |
Avoid dead code warnings in generated code.
If we blindly splicing `{..$stats, ..$generatedCode}`, and the last
expression in `$stats` is of type `Nothing`, we'll incur a dead
code warning when typechecking the block.
This commit:
- introduces a helper method to augment user-written stats with
synthetic code
- Emit a try/finally in that code (so we advance the state, even if we
are about to exit the state machine in the async-block global
exception handler
- Hide `Nothing` typed expressions from the dead code analysis
by wrapping them in an `expr: Any`
Fixes #150 (the part reported in the comments, not the original ticket.)
Diffstat (limited to 'build.sbt')
0 files changed, 0 insertions, 0 deletions