-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[master] Add extra validation to variant instantiation (#236).
- Loading branch information
Showing
4 changed files
with
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
(import variant) | ||
(import macros) | ||
|
||
(using-namespace std.macros | ||
(def def-ordered-variant (macro intern (name cons) | ||
(qq def-variant (uq name) cons)))) | ||
|
||
(def-ordered-variant Instr | ||
((Doge ((a int))) | ||
Soge | ||
(Quoge ((a int) (b int))))) | ||
|
||
(def main (fn extern-c | ||
int | ||
((argc int) | ||
(argv (p (p char)))) | ||
(return 0))) |
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,2 @@ | ||
variant-member.dt:8:22: error: list required for variant members (see macro at 6:9) | ||
variant-member.dt:6:9: error: macro expansion error (see previous) (see macro at 8:1) |