struct Query {
bar: str?;
zoo: str?;
}
class Foo {
pub static bar(q: Query) {
if let bar = q.bar {
log(bar);
}
if let zoo = q.zoo {
log(zoo);
}
}
}
Foo.bar();
This happened:
A preflight error:
Failed to compile.
Error: Cannot read properties of undefined (reading 'bar')
I expected this:
No response
Is there a workaround?
Pass an empty object:
Foo.bar({});
Anything else?
No response
Wing Version
No response
Node.js Version
No response
Platform(s)
No response
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.
I tried this:
This happened:
A preflight error:
I expected this:
No response
Is there a workaround?
Pass an empty object:
Anything else?
No response
Wing Version
No response
Node.js Version
No response
Platform(s)
No response
Community Notes