Skip to content

Fix #3364: Name clash in class and its companion object #3368

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
Oct 24, 2017

Conversation

allanrenucci
Copy link
Contributor

No description provided.

@allanrenucci allanrenucci changed the title Fix #3361: Name clash in class and its companion object Fix #3364: Name clash in class and its companion object Oct 23, 2017
@allanrenucci allanrenucci requested a review from smarter October 23, 2017 14:38
if (!cls.owner.is(ModuleClass)) {
def clashes(sym: Symbol) =
sym.name.stripModuleClassSuffix == cls.name.stripModuleClassSuffix &&
(sym.isClass || sym.is(ModuleClass))
Copy link
Member

Choose a reason for hiding this comment

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

A ModuleClass is a class

if (!cls.owner.is(ModuleClass)) {
def clashes(sym: Symbol) =
sym.name.stripModuleClassSuffix == cls.name.stripModuleClassSuffix &&
sym.isClass
Copy link
Member

Choose a reason for hiding this comment

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

I would reverse the order of the conditions since sym.isClass is cheaper to compute

@allanrenucci allanrenucci merged commit ec05239 into scala:master Oct 24, 2017
@allanrenucci allanrenucci deleted the fix-#3364 branch October 24, 2017 11:36
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