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
leta=MutArray<num>[1,2];a.push(3);//succeeds because a is mutabletest"mutability disabled on inflight error message should be improved"{// test syntax currently implies inflight, so referenced preflight expressions are lifted by the compiler a.push(4);//fails because during lifting a was implicitly converted to immutable}
This happened:
Compiler error within the test block:
error: Member "push" doesn't exist in "Array" --> wing/main.w:5:5 |5 | a.push(4); | ^^^^
I expected this:
In #6258 we added the compiler behavior to convert mutable preflight expressions to immutable when lifting them to inflight.
So, I was expecting calling a.push() inflight to fail, but it is unclear from the error message that a is not mutable anymore or what should I do.
I would expect an error message in the spirit of: Preflight "MutArray" object was implicitly converted to "Array" when lifting to inflight - for additional information please see https://www.winglang.io/docs/concepts/inflights#using-preflight-data-from-inflight
Important to note that if I would use a non existing method name (e.g. a.pushhhh()), I would still expect to get the current error message: error: Member "pushhhh" doesn't exist in "Array".
Is there a workaround?
No response
Anything else?
No response
Wing Version
0.74.14
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.
The text was updated successfully, but these errors were encountered:
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!
I tried this:
This happened:
Compiler error within the test block:
I expected this:
In #6258 we added the compiler behavior to convert mutable preflight expressions to immutable when lifting them to inflight.
So, I was expecting calling
a.push()
inflight to fail, but it is unclear from the error message thata
is not mutable anymore or what should I do.I would expect an error message in the spirit of:
Preflight "MutArray" object was implicitly converted to "Array" when lifting to inflight - for additional information please see https://www.winglang.io/docs/concepts/inflights#using-preflight-data-from-inflight
Important to note that if I would use a non existing method name (e.g.
a.pushhhh()
), I would still expect to get the current error message:error: Member "pushhhh" doesn't exist in "Array"
.Is there a workaround?
No response
Anything else?
No response
Wing Version
0.74.14
Node.js Version
No response
Platform(s)
No response
Community Notes
The text was updated successfully, but these errors were encountered: