-
-
Save DmytroMitin/257729dddd733527d4445903cd16047c to your computer and use it in GitHub Desktop.
Pattern matching in Dotty 0.24.0-RC1
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
// x match { | |
// case _: Box[Square] | _: Box[Circle] => ??? | |
// } | |
[info] matchResult10[Nothing]: | |
[info] { | |
[info] case val x13: Object = App.x() | |
[info] matchAlts1[Unit]: | |
[info] { | |
[info] matchAlts2[Unit]: | |
[info] { | |
[info] if x13.isInstanceOf[App.App$Box] then | |
[info] return[matchAlts2] () | |
[info] else () | |
[info] if x13.isInstanceOf[App.App$Box] then | |
[info] return[matchAlts2] () | |
[info] else () | |
[info] return[matchAlts1] () | |
[info] } | |
[info] ???() | |
[info] } | |
[info] throw new MatchError(x13) | |
[info] } |
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
// x match { | |
// case _: (Box[Square] | Box[Circle]) => ??? | |
// } | |
[info] matchResult10[Nothing]: | |
[info] { | |
[info] case val x13: Object = App.x() | |
[info] if | |
[info] x13.isInstanceOf[App.App$Box].||( | |
[info] x13.isInstanceOf[App.App$Box] | |
[info] ) | |
[info] then | |
[info] { | |
[info] ???() | |
[info] } | |
[info] else () | |
[info] throw new MatchError(x13) | |
[info] } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment