Skip to content
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

Fix 14682: fix overriding check in mergeSingleDenot #14755

Merged
merged 3 commits into from Mar 23, 2022

Conversation

noti0na1
Copy link
Member

We should relax overriding check in mergeSingleDenot as we did in other places.

I also moved some explicit nulls tests to tests/explicit-nulls folder.

@noti0na1 noti0na1 changed the title Fix 14682: fix verriding check in mergeSingleDenot Fix 14682: fix overriding check in mergeSingleDenot Mar 23, 2022
@noti0na1 noti0na1 requested a review from smarter March 23, 2022 06:54
Copy link
Contributor

@olhotak olhotak left a comment

Choose a reason for hiding this comment

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

I wonder if there is some more modular/systematic way to ensure that all the overriding checks follow the relaxed rules for Java methods. There are many places that need to check this condition and we were missing some of them; is there some way to make sure that we are not missing any now and won't miss some in the future?

compiler/src/dotty/tools/dotc/typer/RefChecks.scala Outdated Show resolved Hide resolved
Copy link
Contributor

@odersky odersky left a comment

Choose a reason for hiding this comment

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

Otherwise LGTM

compiler/src/dotty/tools/dotc/core/Types.scala Outdated Show resolved Hide resolved
compiler/src/dotty/tools/dotc/typer/RefChecks.scala Outdated Show resolved Hide resolved
@noti0na1
Copy link
Member Author

noti0na1 commented Mar 23, 2022

@olhotak This is why I moved the relaxedOverrideContext into the overrides function, which forces users to indicate whether the check should be relaxed.

@olhotak olhotak enabled auto-merge March 23, 2022 18:07
@olhotak olhotak merged commit fb7f900 into scala:main Mar 23, 2022
@olhotak olhotak deleted the fix-14682 branch March 23, 2022 19:25
@Kordyjan Kordyjan added this to the 3.1.3 milestone Aug 1, 2023
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.

Type disambiguation error in safe init checker caused by -Yexplicit-nulls
4 participants