-
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.
Fail when a poly function value has a different number of type
params than the expected poly function [Cherry-picked c973d9b]
- Loading branch information
1 parent
2baefd5
commit ead0f11
Showing
3 changed files
with
38 additions
and
25 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 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 @@ | ||
-- Error: tests/neg/i20533.scala:5:8 ----------------------------------------------------------------------------------- | ||
5 | [X] => (x, y) => Map(x -> y) // error | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| Provided polymorphic function value doesn't match the expected type [X, Y] => (x$1: X, x$2: Y) => Map[X, Y]. | ||
| Expected type should be a polymorphic function with the same number of type and value parameters. |
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,6 @@ | ||
def mapF(h: [X, Y] => (X, Y) => Map[X, Y]): Unit = ??? | ||
|
||
def test = | ||
mapF( | ||
[X] => (x, y) => Map(x -> y) // error | ||
) |