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

Specification should mention that implicit scope for a view includes parts of the types of the arguments.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: Scala 2.9.1
    • Fix Version/s: Scala 2.11.0-RC3
    • Component/s: Specification
    • Labels:
      None

      Description

      This example is really weird

      class O {
        def +(x: O): O = null
      }
      object O {
        implicit def i2o(x: Int): O = null
      }
      object M {
        val o : O = null
        1 + o //1.+(o) won't compile
      }
      

      This shouldn't compile in both cases. According to language specification implicit scope for e.v(args) is type of e. Here type of e is Int, so i2o can't be in implicit scope.
      So this is possibly bug of lang specification, I mean implicit scope actually is bigger then Int.
      However anyway it's compiler bug, because both exmples should be the same (infix operations is just syntactic sugar).

        Activity

        Hide
        Jason Zaugg added a comment -

        Updated link to the unspecified change to the implicit scope:

        https://github.com/scala/scala/commit/7fa4ca91ff

        Show
        Jason Zaugg added a comment - Updated link to the unspecified change to the implicit scope: https://github.com/scala/scala/commit/7fa4ca91ff
        Hide
        Grzegorz Kossakowski added a comment -

        Unassigning and rescheduling to M7 as previous deadline was missed.

        Show
        Grzegorz Kossakowski added a comment - Unassigning and rescheduling to M7 as previous deadline was missed.
        Show
        Adriaan Moors added a comment - https://github.com/adriaanm/scala-ref-markdown/commit/84bba26776a76252a4576947adc15364f5ae8e55
        Hide
        Alexander added a comment -

        When are you planning to publish this markdown version?

        Show
        Alexander added a comment - When are you planning to publish this markdown version?
        Hide
        Adriaan Moors added a comment -

        With 2.11.0 final

        Show
        Adriaan Moors added a comment - With 2.11.0 final

          People

          • Assignee:
            Adriaan Moors
            Reporter:
            Alexander
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development