-
Notifications
You must be signed in to change notification settings - Fork 47
Ark doesn't like it when you use the indexing operator on call expressions #719
Comments
In the future, could you include the error log? On Wed, Mar 2, 2016, 03:43 Felix Angell [email protected] wrote:
|
Oop, sorry. This was just a quick issue at 5am before I went to sleep 😉 |
Happens due to most of our access-expressions only working on other access expressions. The fix will be to not force this in the constructor, I think, and then just leave the work to the type checker. |
A bit more cursory coding shows me the underlying issue. We currently only allow struct access/array indexing on access expressions. This is due to mutability only being handled for access expressions, and we wouldn't want people to write to a immutable array/struct. So if we want to fix this we need to move mutability completely into the type system, which is a fair bit of work. |
Eh, I don't think we need to go that far. The result of a call expression should always be mutable. It only becomes immutable when we bind it to an immutable variable. |
The main concern is the case where you return an array. We have no other way to specify that the backing array is immutable, and we need a way to express this. Take this example:
|
The text was updated successfully, but these errors were encountered: