-
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.
Merge remote-tracking branch 'origin/topic/robin/gh-1143-optional-coe…
…rce' * origin/topic/robin/gh-1143-optional-coerce: Add coercion on assignment for optionals that only differ in constness of their inner types.
- Loading branch information
Showing
5 changed files
with
45 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,18 @@ | ||
# @TEST-EXEC: ${SPICYC} -j %INPUT >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); | ||
} |