Skip to content

SI-8965 Account for corner case in "unrelated types" warning #4102

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
Nov 10, 2014

Conversation

retronym
Copy link
Member

@retronym retronym commented Nov 7, 2014

It's okay for the two types to LUB to something above Object
if they both individially were its supertype.

@retronym
Copy link
Member Author

retronym commented Nov 7, 2014

Review by @adriaanm

@scala-jenkins scala-jenkins added this to the 2.11.5 milestone Nov 7, 2014
// a.scala:2: warning: Any and Any are unrelated: they will most likely never compare equal
// def f(x: Any with AnyRef, y: Any with AnyRef) = x eq y
// ^
// one warning found
Copy link
Contributor

Choose a reason for hiding this comment

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

Needs -Xfatal-warnings to fail, since IIRC pos tests don't have check files that are checked. Though FSR there are check files under pos.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch, I've pushed a flags file.

It's okay for the two types to LUB to something above `Object`
if they both individially were its supertype.
@som-snytt
Copy link
Contributor

LGTM

lrytz added a commit that referenced this pull request Nov 10, 2014
SI-8965 Account for corner case in "unrelated types" warning
@lrytz lrytz merged commit 60d59ee into scala:2.11.x Nov 10, 2014
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.

5 participants