-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix #24573: Add stricter checks for platform SAM compatibility #24624
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
Open
noti0na1
wants to merge
1
commit into
scala:main
Choose a base branch
from
dotty-staging:fix-24573
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+325
−38
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,43 @@ | ||
| 1 | ||
| 2 | ||
| 3 | ||
| 11 | ||
| 12 | ||
| 13 | ||
| 14 | ||
| 15 | ||
| 16 | ||
| 17 | ||
| 18 | ||
| 19 | ||
| 20 | ||
| 21 | ||
| 22 | ||
| 23 | ||
| 24 | ||
| 31 | ||
| 32 | ||
| 33 | ||
| 34 | ||
| 41 | ||
| 42 | ||
| 43 | ||
| 44 | ||
| 45 | ||
| 46 | ||
| 51 | ||
| 52 | ||
| 53 | ||
| 55 | ||
| 56 | ||
| 57 | ||
| 61 | ||
| 62 | ||
| 63 | ||
| 64 | ||
| 71 | ||
| 72 | ||
| 75 | ||
| 76 | ||
| 81 | ||
| 82 |
This file contains hidden or 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,178 @@ | ||
| trait ConTU[-T] extends (T => Unit): | ||
| def apply(t: T): Unit | ||
|
|
||
| trait ConTI[-T] extends (T => Int): | ||
| def apply(t: T): Int | ||
|
|
||
| trait ConTS[-T] extends (T => String): | ||
| def apply(t: T): String | ||
|
|
||
| trait ConIR[+R] extends (Int => R): | ||
| def apply(t: Int): R | ||
|
|
||
| trait ConSR[+R] extends (String => R): | ||
| def apply(t: String): R | ||
|
|
||
| trait ConUR[+R] extends (() => R): | ||
| def apply(): R | ||
|
|
||
| trait ConII extends (Int => Int): | ||
| def apply(t: Int): Int | ||
|
|
||
| trait ConSI extends (String => Int): | ||
| def apply(t: String): Int | ||
|
|
||
| trait ConIS extends (Int => String): | ||
| def apply(t: Int): String | ||
|
|
||
| trait ConUU extends (() => Unit): | ||
| def apply(): Unit | ||
|
|
||
| trait F1[-T, +R]: | ||
| def apply(t: T): R | ||
|
|
||
| trait SFTU[-T] extends F1[T, Unit]: | ||
| def apply(t: T): Unit | ||
|
|
||
| trait SFTI[-T] extends F1[T, Int]: | ||
| def apply(t: T): Int | ||
|
|
||
| trait SFTS[-T] extends F1[T, String]: | ||
| def apply(t: T): String | ||
|
|
||
| trait SFIR [+R] extends F1[Int, R]: | ||
| def apply(t: Int): R | ||
|
|
||
| trait SFSR [+R] extends F1[String, R]: | ||
| def apply(t: String): R | ||
|
|
||
| trait SFII extends F1[Int, Int]: | ||
| def apply(t: Int): Int | ||
|
|
||
| trait SFSI extends F1[String, Int]: | ||
| def apply(t: String): Int | ||
|
|
||
| trait SFIS extends F1[Int, String]: | ||
| def apply(t: Int): String | ||
|
|
||
| trait SFIU extends F1[Int, Unit]: | ||
| def apply(t: Int): Unit | ||
|
|
||
| trait F1U[-T]: | ||
| def apply(t: T): Unit | ||
|
|
||
| trait SF2T[-T] extends F1U[T]: | ||
| def apply(t: T): Unit | ||
|
|
||
| trait SF2I extends F1U[Int]: | ||
| def apply(t: Int): Unit | ||
|
|
||
| trait SF2S extends F1U[String]: | ||
| def apply(t: String): Unit | ||
|
|
||
| object Test: | ||
| def main(args: Array[String]): Unit = | ||
| val fIU: (Int => Unit) = (x: Int) => println(x) // closure by JFunction1 | ||
| fIU(1) | ||
|
|
||
| val fIS: (Int => String) = (x: Int) => x.toString // closure | ||
| println(fIS(2)) | ||
|
|
||
| val fUI: (() => Int) = () => 3 // closure | ||
| println(fUI()) | ||
|
|
||
| val conITU: ConTU[Int] = (x: Int) => println(x) // expanded | ||
| conITU(11) | ||
| val conITI: ConTI[Int] = (x: Int) => x // closure | ||
| println(conITI(12)) | ||
| val conITS: ConTS[Int] = (x: Int) => x.toString // closure | ||
| println(conITS(13)) | ||
| val conSTS: ConTS[String] = (x: String) => x // closure | ||
| println(conSTS("14")) | ||
|
|
||
| val conIRS: ConIR[String] = (x: Int) => x.toString // expanded | ||
| println(conIRS(15)) | ||
| val conIRI: ConIR[Int] = (x: Int) => x // expanded | ||
| println(conIRI(16)) | ||
| val conIRU: ConIR[Unit] = (x: Int) => println(x) // expanded | ||
| conIRU(17) | ||
|
|
||
| val conSRI: ConSR[Int] = (x: String) => x.toInt // closure | ||
| println(conSRI("18")) | ||
| val conURI: ConUR[Int] = () => 19 // closure | ||
| println(conURI()) | ||
| val conURU: ConUR[Unit] = () => println("20") // closure | ||
| conURU() | ||
|
|
||
| val conII: ConII = (x: Int) => x // expanded | ||
| println(conII(21)) | ||
| val conSI: ConSI = (x: String) => x.toInt // closure | ||
| println(conSI("22")) | ||
| val conIS: ConIS = (x: Int) => x.toString // expanded | ||
| println(conIS(23)) | ||
| val conUU: ConUU = () => println("24") // expanded | ||
| conUU() | ||
|
|
||
| val ffIU: F1[Int, Unit] = (x: Int) => println(x) // closure | ||
| ffIU(31) | ||
| val ffIS: F1[Int, String] = (x: Int) => x.toString // closure | ||
| println(ffIS(32)) | ||
| val ffSU: F1[String, Unit] = (x: String) => println(x) // closure | ||
| ffSU("33") | ||
| val ffSI: F1[String, Int] = (x: String) => x.toInt // closure | ||
| println(ffSI("34")) | ||
|
|
||
| val sfITU: SFTU[Int] = (x: Int) => println(x) // expanded | ||
| sfITU(41) | ||
| val sfSTU: SFTU[String] = (x: String) => println(x) // expanded | ||
| sfSTU("42") | ||
|
|
||
| val sfITI: SFTI[Int] = (x: Int) => x // closure | ||
| println(sfITI(43)) | ||
| val sfSTI: SFTI[String] = (x: String) => x.toInt // closure | ||
| println(sfSTI("44")) | ||
|
|
||
| val sfITS: SFTS[Int] = (x: Int) => x.toString // closure | ||
| println(sfITS(45)) | ||
| val sfSTS: SFTS[String] = (x: String) => x // closure | ||
| println(sfSTS("46")) | ||
|
|
||
| val sfIRI: SFIR[Int] = (x: Int) => x // expanded | ||
| println(sfIRI(51)) | ||
| val sfIRS: SFIR[String] = (x: Int) => x.toString // expanded | ||
| println(sfIRS(52)) | ||
| val sfIRU: SFIR[Unit] = (x: Int) => println(x) // expanded | ||
| sfIRU(53) | ||
|
|
||
| val sfSRI: SFSR[Int] = (x: String) => x.toInt // closure | ||
| println(sfSRI("55")) | ||
| val sfSRS: SFSR[String] = (x: String) => x // closure | ||
| println(sfSRS("56")) | ||
| val sfSRU: SFSR[Unit] = (x: String) => println(x) // closure | ||
| sfSRU("57") | ||
|
|
||
| val sfII: SFII = (x: Int) => x // expanded | ||
| println(sfII(61)) | ||
| val sfSI: SFSI = (x: String) => x.toInt // closure | ||
| println(sfSI("62")) | ||
| val sfIS: SFIS = (x: Int) => x.toString // expanded | ||
| println(sfIS(63)) | ||
| val sfIU: SFIU = (x: Int) => println(x) // expanded | ||
| sfIU(64) | ||
|
|
||
| val f2ITU: F1U[Int] = (x: Int) => println(x) // closure | ||
| f2ITU(71) | ||
| val f2STU: F1U[String] = (x: String) => println(x) // closure | ||
| f2STU("72") | ||
|
|
||
| val sf2IT: SF2T[Int] = (x: Int) => println(x) // closure | ||
| sf2IT(75) | ||
| val sf2ST: SF2T[String] = (x: String) => println(x) // closure | ||
| sf2ST("76") | ||
|
|
||
| val sf2I: SF2I = (x: Int) => println(x) // expanded | ||
| sf2I(81) | ||
| val sf2S: SF2S = (x: String) => println(x) // closure | ||
| sf2S("82") | ||
|
|
||
| end Test |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.