Allow doc comments on individual struct members, faultdefs and enum values #2427.

This commit is contained in:
Christoffer Lerno
2025-09-06 16:18:33 +02:00
parent 95375a2591
commit bd9bc118db
3 changed files with 61 additions and 1 deletions

View File

@@ -0,0 +1,41 @@
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()
{}