Skip to content

Fix #2564: Do not create ill-formed <init> accessors #2904

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
Jul 25, 2017

Conversation

nicolasstucki
Copy link
Contributor

No description provided.

@nicolasstucki
Copy link
Contributor Author

This just a first small step to ensure that the compiler does not crash on inlined private constructors.

accessedType = methPart.tpe.widen,
rhs = (qual, tps, argss) => qual.appliedToTypes(tps).appliedToArgss(argss))
val mSym = methPart.symbol
if (mSym.isConstructor && (mSym.is(Private) || mSym.privateWithin.exists)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to check privateWithin, is it subsumed by the private check?

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 thought so too but when trying it out I found that it was not the case. Should it be? Did I stumble on another bug?

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

@nicolasstucki nicolasstucki Jul 24, 2017

Choose a reason for hiding this comment

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

Actually I should use mSym.isConstructor && needsAccessor(mSym)

@DarkDimius DarkDimius merged commit 611f8ee into scala:master Jul 25, 2017
@allanrenucci allanrenucci deleted the fix-#2564 branch December 14, 2017 19:18
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.

3 participants