-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add coercion for optionals that only differ in constness of their inn…
…er types. There are some situations where that's fine to coerce, so adding that. Also adding a coercion for ternary expressions that coerces the 2dn expression into the type of the 1st (which we already assume provides the result type). Closes #1143. Closes #1220.
- Loading branch information
Showing
6 changed files
with
59 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
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 @@ | ||
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. |
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,19 @@ | ||
# @TEST-EXEC: ${SPICYC} -j %INPUT >output | ||
# @TEST-EXEC: btest-diff output | ||
# | ||
# @TEST-DOC: Regression test for #1143. | ||
|
||
module Foo; | ||
|
||
type Bar = struct { | ||
wutang: bytes &optional; | ||
}; | ||
|
||
type BarTuple = tuple< | ||
wutang: optional<bytes> | ||
>; | ||
|
||
public function make_bar_tuple(bar: Bar): BarTuple { | ||
local nope: optional<bytes>; | ||
return tuple(bar?.wutang ? optional(bar.wutang) : nope); | ||
} |