-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14397 from dotty-staging/fix-14367
Infer parameters of eta applications with vararg parameters
- Loading branch information
Showing
5 changed files
with
26 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
-- [E007] Type Mismatch Error: tests/neg/i14367.scala:2:16 ------------------------------------------------------------- | ||
2 |val h2 = i => p(i) // error: Found (i : Seq[Int]), Required: Int | ||
| ^ | ||
| Found: (i : Seq[Int]) | ||
| Required: Int | ||
|
||
longer explanation available when compiling with `-explain` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
def p(i: Int*) = i.sum | ||
val h2 = i => p(i) // error: Found (i : Seq[Int]), Required: Int | ||
// It would be more logical to fail with a "missing parameter type", however. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
def m(i: Int*) = i.sum | ||
val f1 = m | ||
val f2 = i => m(i*) | ||
|
||
def n(i: Seq[Int]) = i.sum | ||
val g1 = n | ||
val g2 = i => n(i) |