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

regression: overloaded == creates spurious warnings #5175

Closed
scabug opened this issue Nov 10, 2011 · 4 comments
Closed

regression: overloaded == creates spurious warnings #5175

scabug opened this issue Nov 10, 2011 · 4 comments
Assignees

Comments

@scabug
Copy link

scabug commented Nov 10, 2011

Works in 2.9.x fails in trunk.

object Test {
  def ==(p: Phase): Int = 0

  def foo {
    ==(new Phase())
  }
}

class Phase

leads to

Test.scala:6: warning: object Test and Phase are unrelated: they will most likely never compare equal
    ==(new Phase())
      ^
one warning found

I guess it gets confused about the receiver of == and doesn't take into consideration that it can be overloaded.

@scabug
Copy link
Author

scabug commented Nov 10, 2011

Imported From: https://issues.scala-lang.org/browse/SI-5175?orig=1
Reporter: @hubertp
Affected Versions: 2.10.0

@scabug
Copy link
Author

scabug commented Nov 10, 2011

@hubertp said:
btw, the bytecode is correct.

@scabug
Copy link
Author

scabug commented Nov 10, 2011

@soc said:
Could this be related to the changes made in SI-4766?

@scabug
Copy link
Author

scabug commented Dec 28, 2011

@paulp said:
Fixed in 33ab1a574af .

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

No branches or pull requests

2 participants