-
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 "Extra check to avoid converting block expressions on the rh…
…s of an in…" to LTS (#21058) Backports #20043 to the LTS branch. PR submitted by the release tooling. [skip ci]
- Loading branch information
Showing
4 changed files
with
135 additions
and
1 deletion.
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,51 @@ | ||
object Reactions: | ||
def main: Unit = | ||
Reactions += { | ||
case 0 => | ||
case 1 => | ||
} | ||
|
||
Reactions run: | ||
case 0 => | ||
case 1 => | ||
|
||
Reactions run_+ : | ||
case 0 => | ||
case 1 => | ||
|
||
Reactions `+=`: | ||
case 0 => | ||
case 1 => | ||
|
||
def bar: Int = ??? | ||
|
||
bar match | ||
case 0 => | ||
case 1 => | ||
|
||
def partPartial(i: Int): PartialFunction[Int, Unit] = | ||
case `i` => | ||
|
||
Reactions += { | ||
val pp1 = partPartial(1) | ||
val pp2 = partPartial(2) | ||
def codeBlock = | ||
??? | ||
??? | ||
pp1 orElse pp2 | ||
} | ||
|
||
val partialFunction = partPartial(1) orElse partPartial(2) | ||
Reactions += { | ||
partialFunction | ||
} | ||
|
||
def +=(f: PartialFunction[Int, Unit]) = | ||
??? | ||
|
||
def run (f: PartialFunction[Int, Unit]) = | ||
??? | ||
|
||
def run_+ (f: PartialFunction[Int, Unit]) = | ||
??? | ||
|
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,62 @@ | ||
object Reactions { | ||
def main: Unit = { | ||
Reactions += { | ||
case 0 => | ||
case 1 => | ||
} | ||
|
||
Reactions run { | ||
case 0 => | ||
case 1 => | ||
} | ||
|
||
Reactions run_+ { | ||
case 0 => | ||
case 1 => | ||
} | ||
|
||
Reactions `+=` { | ||
case 0 => | ||
case 1 => | ||
} | ||
|
||
def bar: Int = ??? | ||
|
||
bar match { | ||
case 0 => | ||
case 1 => | ||
} | ||
|
||
def partPartial(i: Int): PartialFunction[Int, Unit] = { | ||
case `i` => | ||
} | ||
|
||
Reactions += { | ||
val pp1 = partPartial(1) | ||
val pp2 = partPartial(2) | ||
def codeBlock = { | ||
??? | ||
??? | ||
} | ||
pp1 orElse pp2 | ||
} | ||
|
||
val partialFunction = partPartial(1) orElse partPartial(2) | ||
Reactions += { | ||
partialFunction | ||
} | ||
} | ||
|
||
def +=(f: PartialFunction[Int, Unit]) = { | ||
??? | ||
} | ||
|
||
def run (f: PartialFunction[Int, Unit]) = { | ||
??? | ||
} | ||
|
||
def run_+ (f: PartialFunction[Int, Unit]) = { | ||
??? | ||
} | ||
|
||
} |