-
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.
Add missing lowering of Spicy unit ctor to HILTI struct ctor.
Closes #1275.
- Loading branch information
Showing
3 changed files
with
28 additions
and
0 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,7 @@ | ||
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. | ||
foo::Y { | ||
x: foo::X { | ||
x: 4 | ||
} | ||
y: 2 | ||
} |
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-DOC: Validates that unit vars can be assigned to with struct initialization. Regression test for #1275. | ||
# | ||
# @TEST-EXEC: spicyc -dj %INPUT -o foo.hlto | ||
# @TEST-EXEC: printf '\x02' | spicy-dump foo.hlto >output 2>&1 | ||
# @TEST-EXEC: btest-diff output | ||
module foo; | ||
|
||
type X = unit { | ||
x: uint8; | ||
}; | ||
|
||
public type Y = unit { | ||
var x: X; | ||
y: uint8 { self.x = [$x = $$ * 2]; } | ||
}; |