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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
smarter opened this issue Oct 26, 2018 · 0 comments

Comments

@smarter
Copy link
Member

smarter commented Oct 26, 2018

@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

odersky added a commit that referenced this issue Dec 17, 2018
Fix #5328: Disallow repeated type application
nicolasstucki pushed a commit to dotty-staging/dotty that referenced this issue Jan 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant