Closed ItsDeltin closed 3 months ago
Anonymous types cannot be assigned to the Any
type for this reason, because it does not know if it may be a struct type. To solve this, type args can be marked as single
, which will not accept parallel structs. Example:
void DoThing<single T>(in T value)
{
Any assignToAny = value;
}
// Not okie dokie, adds a syntax error.
DoThing<Point>({X: 5, Y: 6});
// okie dokie
DoThing<Point%>({X: 5, Y: 6});
This has been resolved with the introduction of single structs
The problem
This struct will be used as an example.
Variables assigned with this data-type will have their workshop variables generated as so:
This has the advantage of avoiding arrays, which is known to be pretty good at hogging server load. There are 2 downsides to this approach, however:
The solution
The solution to this is unparalleled structs, which store the struct data in an array. This is identical to how it structs worked pre-v1.0.
There needs to be a way to mark a struct type as unparalleled, for example, succeeding the type name with the
%
symbol: