To reduce bugs with writing code that is reflection heavy and dispatches based on what types have been reflected, it would be preferable to restrict the "kind" field to a fixed set of choices.
Example, instead of:
let t = @type(Array<str>);
assert(t.kind == "array");
it can be:
assert(t.kind == std.reflect.TypeId.ARRAY);
// or
assert(t.kind == .ARRAY);
Proposed Solution
No response
Implementation Notes
No response
Component
Compiler, SDK
Community Notes
Please vote by adding a 👍 reaction to the issue to help us prioritize.
If you are interested to work on this issue, please leave a comment.
If this issue is labeled needs-discussion, it means the spec has not been finalized yet. Please reach out on the #dev channel in the Wing Discord.
Use Case
To reduce bugs with writing code that is reflection heavy and dispatches based on what types have been reflected, it would be preferable to restrict the "kind" field to a fixed set of choices.
Example, instead of:
it can be:
Proposed Solution
No response
Implementation Notes
No response
Component
Compiler, SDK
Community Notes