-
-
Notifications
You must be signed in to change notification settings - Fork 658
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
type return/break/continue expressions with monomorphs instead of Dyn…
…amic (see #10744) (#10745) * type return/break/continue expressions with monomorphs instead of Dynamic (see #10744) this is what we already do for `throw` since 2008 (9cee2fc) * add test (closes #10744) * test throw too (works already, just in case we break it in future) * spawn monos only if we need a value Co-authored-by: Simon Krajewski <[email protected]>
- Loading branch information
Showing
2 changed files
with
32 additions
and
10 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,15 @@ | ||
package unit.issues; | ||
|
||
import unit.HelperMacros.typeString; | ||
|
||
class Issue10744 extends Test { | ||
function test() { | ||
var v:Null<Int> = 10; | ||
eq("Null<Int>", typeString(v ?? return)); | ||
eq("Null<Int>", typeString(v ?? throw true)); | ||
for (i in 0...1) { | ||
eq("Null<Int>", typeString(v ?? break)); | ||
eq("Null<Int>", typeString(v ?? continue)); | ||
} | ||
} | ||
} |