Scala Programming Language
  1. Scala Programming Language
  2. SI-5175

regression: overloaded == creates spurious warnings

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: Scala 2.10.0
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      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.

        Activity

        Hide
        Hubert Plociniczak added a comment -

        btw, the bytecode is correct.

        Show
        Hubert Plociniczak added a comment - btw, the bytecode is correct.
        Hide
        Simon Ochsenreither added a comment -

        Could this be related to the changes made in SI-4766?

        Show
        Simon Ochsenreither added a comment - Could this be related to the changes made in SI-4766 ?
        Hide
        Paul Phillips added a comment -

        Fixed in 33ab1a574af .

        Show
        Paul Phillips added a comment - Fixed in 33ab1a574af .

          People

          • Assignee:
            Paul Phillips
            Reporter:
            Hubert Plociniczak
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development