When a type needs to be named in an error, anonymous types are just represented by the field's name. This has some overlooked consequences. For example the following code:
struct Foo
{
bitstruct anon : char
{
bool a : 0;
char b : 1..7;
}
}
fn void test()
{
Foo foo;
char x = 32;
foo.anon = x; // Implicit cast not allowed
}
produces an error suggesting a syntactically incorrect fix
Error: Implicitly casting 'char' to 'anon' is not permitted,
but you may do an explicit cast by placing '(anon)' before the expression
Where it should just say that casts to anonymous types are forbidden.
Other error messages might also be affected, although i have not found any.
When a type needs to be named in an error, anonymous types are just represented by the field's name. This has some overlooked consequences. For example the following code:
produces an error suggesting a syntactically incorrect fix
Where it should just say that casts to anonymous types are forbidden.
Other error messages might also be affected, although i have not found any.