mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 20:11:17 +00:00
41 lines
511 B
Plaintext
41 lines
511 B
Plaintext
module test;
|
|
import std;
|
|
|
|
struct Foo
|
|
{
|
|
<* hello *>
|
|
int a;
|
|
<* test *>
|
|
union
|
|
{
|
|
<* test2 *>
|
|
int b;
|
|
}
|
|
struct foo
|
|
{
|
|
<* baz *>
|
|
int g;
|
|
}
|
|
}
|
|
|
|
faultdef <* hello *> FOO;
|
|
enum Abc
|
|
{
|
|
<* test *>
|
|
XYZ
|
|
}
|
|
|
|
faultdef <* @require a > 0 *> FOO2; // #error: No constraints are allowed on faults
|
|
enum Abc2
|
|
{
|
|
<* @require a > 0 *> // #error: No constraints are allowed on enum values
|
|
XYZ
|
|
}
|
|
struct Test
|
|
{
|
|
<* @require a > 0 *> // #error: No constraints are allowed on struct/union members
|
|
int a;
|
|
}
|
|
|
|
fn void main()
|
|
{} |