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
The behavior is unspecified, i.e., it is OK to throw any exception. I am reluctant changing anything in the VM until a common behavior has been agreed upon. Punting it to library area.
Currently the vm throws different exceptions when attempting to update a const array vs a const map:
Code sample:
1 main() {
2 var a = const [1];
3 var b = const {"a" : 1};
4 try {
5 a[0] = 1;
6 } catch (var e) {
7 print (e is UnsupportedOperationException);
8 print (e is IllegalAccessException);
9 }
10 try {
11 b["a"] = 1;
12 } catch (var e) {
13 print (e is UnsupportedOperationException);
14 print (e is IllegalAccessException);
15 }
16 }
This prints:
true
false
false
true
Seems like they should both be IllegalAccessException.
The text was updated successfully, but these errors were encountered: