Skip to content

Fix #3916: Fix interpretation of boxed value classes #4025

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 2 commits into from
Feb 26, 2018

Conversation

nicolasstucki
Copy link
Contributor

No description provided.

if (clazz.getCanonicalName != tree.symbol.owner.showFullName) value // Already unboxed
else {
val method = getMethod(clazz, name, Nil)
interpreted(method.invoke(value))
Copy link
Contributor

Choose a reason for hiding this comment

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

A minor irrelevant issue: the name interpreted takes me a little while to realise there's no interpretation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will change the name

env(qualifier.symbol)
val value = env(qualifier.symbol)
val clazz = value.getClass
if (clazz.getCanonicalName != tree.symbol.owner.showFullName) value // Already unboxed
Copy link
Contributor

Choose a reason for hiding this comment

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

If the value class is a nested inner class, I guess this check will fail.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will add a test case and check it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is an issue with inner classes but it is not in this code. I will fix it another PR.

@nicolasstucki nicolasstucki merged commit ad01d69 into scala:master Feb 26, 2018
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