Open
Description
The compiler rejects any attempt to use StringBuilder
as a field in a struct or contract, even though this restriction is not documented anywhere.
Reproducible Examples
struct S {
x: StringBuilder;
}
Error: test.tact:2:5: Unsupported type StringBuilder
1 | struct S {
> 2 | x: StringBuilder;
^~~~~~~~~~~~~~~~
contract C {
x: StringBuilder;
}
Error: test.tact:2:5: Unsupported type StringBuilder
1 | contract C {
> 2 | x: StringBuilder;
^~~~~~~~~~~~~~~~
Problem
StringBuilder
is listed as a primitive type in the Tact documentation.- There is no mention that it cannot be used in structs or persistent state.
- Other types work without issue.
Expected Behavior
- If
StringBuilder
is not supported in persistent storage or structs, this should be clearly stated in the documentation. - If it is meant to be supported, this is a compiler bug.
Conclusion
This is a documentation mismatch. The compiler rejects StringBuilder
in valid-looking contexts without warning or mention in the docs. Either support should be added, or the limitation must be explicitly documented.
LLM Fuzzing discovery (see #2490)