-
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.
Backport "Fail when a poly function value has a different number of t…
…ype params than the expected poly function" to 3.5.2 (#21459) Backports #21248 to the 3.5.2 branch. PR submitted by the release tooling. [skip ci]
- Loading branch information
Showing
7 changed files
with
1,399 additions
and
29 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
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 | ||
) |
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 @@ | ||
import Z.* | ||
|
||
object A: | ||
val a: Option[AOptions] = ??? | ||
val b: Option[BOptions] = ??? | ||
val c: Option[COptions] = ??? |
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,9 @@ | ||
//> using options -Ytest-pickler-check | ||
|
||
// in the original issue https://github.com/scala/scala3/issues/21154, the non-deterministic tasty | ||
// depends on the order of compilation of files, the use-site (A.scala) has to come first, | ||
// and the file defining the enum has to come second (Z.scala), A.scala in namer will force Z to complete. | ||
enum Z: | ||
case AOptions() | ||
case BOptions() | ||
case COptions() |
Oops, something went wrong.