-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix another assertion with anonymous struct constructor.
The struct type's ID could end up not making it across the Spicy-to-HILTI boundary. Closes #1234.
- Loading branch information
Showing
4 changed files
with
24 additions
and
2 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
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,3 @@ | ||
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. | ||
[error] <...>/struct-ctor-init-2.spicy:12:11: type cannot be used as key type for maps (because it is not sortable) | ||
[error] spicyc: aborting after errors |
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 @@ | ||
# @TEST-EXEC-FAIL: spicyc -j %INPUT >output 2>&1 | ||
# @TEST-EXEC: btest-diff output | ||
# | ||
# @TEST-DOC: Regression test for #1234. | ||
|
||
module test; | ||
|
||
type Key = unit {a: uint8;}; | ||
|
||
# The below will be rejeced because units can't be used a key types, but that's | ||
# fine, we just want to make sure type resolution doesn't complain. | ||
global m: map<Key, uint8>; | ||
m[[$a=1]] = 1; | ||
|
||
print m; |