Skip to content

Fix null unboxing of primitives (fixes #582) #584

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 17, 2015

Conversation

smarter
Copy link
Member

@smarter smarter commented May 17, 2015

Erasure#isUnbox was incorrect: the unbox methods are defined on the
value classes, not the boxed classes.

Review by @DarkDimius.

Erasure#isUnbox was incorrect: the unbox methods are defined on the
value classes, not the boxed classes.
@@ -1,11 +0,0 @@
object Test {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for future reference, you can just write extends dotty.runtime.LegacyApp and body will be executed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to do this for new tests to? I thought LegacyApp was only a compatiblity hack.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a compatibility adaptor that works only if you do not inspect arguments. And that is the current situation with run tests.

@DarkDimius
Copy link
Contributor

LGTM.

DarkDimius added a commit that referenced this pull request May 17, 2015
Fix null unboxing of primitives (fixes #582)
@DarkDimius DarkDimius merged commit 3dcb286 into scala:master May 17, 2015
@smarter
Copy link
Member Author

smarter commented May 17, 2015

Note that null.asInstanceOf[Unit] is erased to null instead of scala.Unit.unbox(null), so it prints null instead of (). scalac has the same behavior, I don't know if we want to change that or not.

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.

2 participants