You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Nested structs should have the same level of support as other fields, but are currently displayed just as nameless offsets, or result in a crash.
To Reproduce
See attached code.
Expected behavior
Structs should be displayed the same as all other fields, and valid code should not crash
Screenshots
If applicable, add screenshots to help explain your problem.
Code being executed
Struct containing a struct
struct X { int x; };
struct Y {
int foo;
struct X x;
};
int main() {
struct Y* a = alloc(struct Y);
a->foo = 1;
a->x.x = 2;
return 0;
}
Array of structs
struct X { int x; };
struct Y {
int foo;
struct X x;
};
int main() {
struct Y[] a = alloc_array(struct Y, 10);
a[0].foo = 3;
a[0].x.x = 0;
a[1].foo = 5;
return 0;
}
Additional context
Not super high prio, but the crashing is not good.
The text was updated successfully, but these errors were encountered:
value: C0Type<C0TypeClass>,// the type "C" in comment above
}|{
type: T,
kind: "struct",
value: string,// If a pointer points to the struct, we record the
offset: number// struct type name and offset
} :
Textends"string" ? {
type: T,
value: "string"
} :
Textends"<unknown>" ? {
type: T// No more type information for unknown
} : never;
This can't be fixed easily without re-writing most of the type inference. I'll rewrite and clean up the type inference in current codebase during winter break. And hopefully by that time this will be fixed.
Describe the bug
Nested structs should have the same level of support as other fields, but are currently displayed just as nameless offsets, or result in a crash.
To Reproduce
See attached code.
Expected behavior
Structs should be displayed the same as all other fields, and valid code should not crash
Screenshots
If applicable, add screenshots to help explain your problem.
Code being executed
Struct containing a struct
Array of structs
Additional context
Not super high prio, but the crashing is not good.
The text was updated successfully, but these errors were encountered: