Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Specification
    • Labels:
      None
    • Environment:

      overloading resolution

      Description

      From a discussion on Scala User:

      http://thread.gmane.org/gmane.comp.lang.scala.user/28171
      http://thread.gmane.org/gmane.comp.lang.scala.user/28169

      I think the spec should be updated to replace:

      "If there is precisely one alternative in A which is a (possibly
      polymorphic) method
      type whose arity matches the number of arguments given, that
      alternative is chosen."

      with:

      "If there is precisely one alternative in `A` which is a (possibly
      polymorphic) method
      type which is potentially applicably to the arguments given, that
      alternative is chosen.

      A list of arguments `(e1, ..., em)` is potentially applicable to a
      method `m` in the context of an expected type E if the arguments `(e1', ..., em')` are applicable to `m`, either with the expected type `E` or with
      no expected type. `ei'` is defined as the shape of the argument `ei`.

      The shape of an argument is defined as:

      • for a function expression of `(p1: T1, ..., pn: TN) => body`: `(p1$$: Any,..., pn$$: Any) => shape(body)`
      • for a named argument `name = expr`: name = `shape(expr))`
      • for all other expressions: `nothing$$`, where `nothing$$` an synthetic expression of type `Nothing`.

        Activity

        Hide
        Mark Harrah added a comment -

        Included in updates to the spec in r22427.

        Show
        Mark Harrah added a comment - Included in updates to the spec in r22427.
        Hide
        Paul Phillips added a comment -

        Sure enough.

        Show
        Paul Phillips added a comment - Sure enough.

          People

          • Assignee:
            Martin Odersky
            Reporter:
            Jason Zaugg
            TracCC:
            Mark Harrah, Paul Phillips
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development