Skip to content

When using named type arguments and omitting some arguments, we should not be able to pass the missing arguments using a second argument list #5328

Closed
@smarter

Description

@smarter

@odersky said:

I believe this was not intended. In my mind, any missing arguments are inferred, and cannot be specified in a subsequent argument list. Otherwise we'll get an ambiguity with polymorphic apply methods. Example:

class C[X, Y] { def apply[Z](x: X, y: Y, z: Z) = (x, y, z) }
def f[X, Y]: C[X, Y] = new C[X, Y]
f[Int, Boolean][String](1, true, "") // OK
f[X = Int](1, true, "") // OK, Y and Z are inferred
f[X = Int][String](1, true, "") // error: String argument is assumed to specify `Y`, not `Z`:
1 |f[X = Int][String](1, true, "")
  |                      ^^^^
  |                      found:    Boolean(true)
  |                      required: String
  |                      

Originally posted by @odersky in #5326

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions