Add Macro Support For Getter and Setter Methods
Community Note
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.
Feature Spec
I want to be able to add a macro to a getter/setter method.
/**
* Returns the number of elements in the map.
*
* @macro Object.keys($self$).length
*/
public get size(): number {
throw new Error("Macro");
}
Use Cases
Solves issue where we have to use normal methods like size() rather than simply invoke size on plain java objects. As done in this PR: https://github.com/winglang/wing/pull/1653/files#diff-02245bbbc2eb597dd86d8484abff67768e1e36b6af074525abb3fa3c1113ef32
Implementation Notes
No response
Component
Compiler
Once this is implemented we should fix the Map API back to size rather than size() which I changed as part of: https://github.com/winglang/wing/pull/1653
Once this is implemented we should fix the Map API back to
sizerather thansize()which I changed as part of: #1653
I think we should actually keep it uniform across our container types, so it should be .len.
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!