Describe the problem. What did you see? What did you expect to see?
All fields and functions of structs are public, even those without the public keyword. I would expect that those without the public keyword are private and inaccessible from outside the struct itself.
If this is a code issue, provide a minimal code example:
struct MyStruct {
var privateInt = 3;
function secretFunction() {
printf("~secrets~\n");
}
}
function main() {
var myStruct: MyStruct = struct MyStruct;
myStruct.secretFunction();
printf("%d\n", myStruct.privateInt);
}
Describe the problem. What did you see? What did you expect to see?
All fields and functions of structs are public, even those without the
public
keyword. I would expect that those without thepublic
keyword are private and inaccessible from outside the struct itself.If this is a code issue, provide a minimal code example:
Environment