Skip to content

Conversation

@retronym
Copy link
Member

No description provided.

retronym added 2 commits July 27, 2015 14:18
The stack trace and bisection in scala#119 made me notice that we
are failing to typecheck the cast we generated in the fix for scala#74.

The ticket doesn't have a reproduction, so I'm submitting this
without a test case.

Fixes scala#119

(cherry picked from commit a037da1)
Code like:

    val x = if (cond) throw new A else throw new B

Was being transformed to:

    val ifRes = ???
    if (cond) ifRes = throw new A else ifRes = throw new B
    val x = ifRes

by way of the use of `gen.mkZero` which throws `???` if the requested type is `Nothing`

This commit special cases `Nothing` typed expressions in a similar manner to `Unit` type expressions.
The example above is now translated to:

    if (cond) throw new A else throw new B
    val x = throw new IllegalStateException()

Fixes scala#120

(cherry picked from commit 80aaf18)
retronym added a commit that referenced this pull request Jul 27, 2015
Backports for two recently fixed bugs.
@retronym retronym merged commit c770346 into scala:2.10.x Jul 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant