Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Not a Bug
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Misc Compiler
    • Labels:
      None

      Description

      When overloading a method with a curried version, the compiler is unable to distinguish, even thought a curried version requires a trailing underscore.

      def foo(b: Bar) {
      // do something
      }

      def foo(b: Bar) (f: (Bar) => Baz) {
      // do something else
      }

      Calling:

      foo(bar)

      causes the compiler to issue an ambiguity error. But had I wanted the curried version, I would (in fact, I'm required to) write:

      foo(bar) _

        Activity

        Hide
        Martin Odersky added a comment -

        That's as speced. To change this, we'd need a proposal for a revised spec, and its diff to the current one. I suspect, however, the new spec would complicate overloading quite a bit, and therefore would most likely be rejected.

        Show
        Martin Odersky added a comment - That's as speced. To change this, we'd need a proposal for a revised spec, and its diff to the current one. I suspect, however, the new spec would complicate overloading quite a bit, and therefore would most likely be rejected.
        Hide
        Nils added a comment -

        I would like to know more. What part of the spec exactly?

        Show
        Nils added a comment - I would like to know more. What part of the spec exactly?

          People

          • Assignee:
            Unassigned
            Reporter:
            Nils
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development