Open harsh9607 opened 1 year ago
@MarkMcCulloh, @tsuf239, @hasanaburayyan, @Chriscbr - would you suggest implementing this similar to:
I am not sure we want to implement this without a broader discussion of reflection and also typeof in javascript is not compatible with strongly typed languages... (where the typeof bucket
could be cloud.Bucket
or maybe some IBucket
- thanks @Chriscbr )
Yea I think for sure its something that would be useful to have and we probably want it. However, its kinda complicated because of the way typeof
works in javascript. Maybe we add this to an upcoming team time discussion? Im not sure how exactly implementation would work, somehow we need to map the javascript back to the Wing type.
Makes sense - I'll add to a next team time so we can discuss it. Marking this issue p3 in the meantime.
@ainvoner After re-reading this issue, if I understand it correctly this might be a separate feature from the typeof
type operator that TypeScript introduces for use inside type annotations and type parameters (e.g. someFunc<typeof otherFunc>()
). Their docs explains it better than I can https://www.typescriptlang.org/docs/handbook/2/typeof-types.html
Hi,
This issue hasn't seen activity in 60 days. Therefore, we are marking this issue as stale for now. It will be closed after 7 days. Feel free to re-open this issue when there's an update or relevant information to be added. Thanks!
Hi,
This issue hasn't seen activity in 60 days. Therefore, we are marking this issue as stale for now. It will be closed after 7 days. Feel free to re-open this issue when there's an update or relevant information to be added. Thanks!
Hi,
This issue hasn't seen activity in 90 days. Therefore, we are marking this issue as stale for now. It will be closed after 7 days. Feel free to re-open this issue when there's an update or relevant information to be added. Thanks!
Feature Spec
I was wondering if we could have a
typeof
Operator like we have in javascript. We could have something likereturns number;
Use Cases
https://www.winglang.io/docs/language-reference
It is part of Roadmap
Reflection: add an extended typeof operator to get type information.
Implementation Notes
It could be built upon the typeof operator of Javascript.
Component
Language Design
Community Notes