Skip to content

make immutable map and immutable list exceptions consistent #766

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sigmundch opened this issue Dec 8, 2011 · 3 comments
Closed

make immutable map and immutable list exceptions consistent #766

sigmundch opened this issue Dec 8, 2011 · 3 comments
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.

Comments

@sigmundch
Copy link
Member

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.

@iposva-google
Copy link
Contributor

Set owner to @sgmitrovic.
Added Accepted label.

@ghost
Copy link

ghost commented Mar 16, 2012

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.


Removed the owner.
Removed Area-VM label.
Added Area-Library, Triaged labels.

@floitschG
Copy link
Contributor

This has been fixed some time ago. Both now throw an UnsupportedError.


Added Fixed label.

@sigmundch sigmundch added Type-Defect area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. labels Dec 18, 2012
copybara-service bot pushed a commit that referenced this issue Oct 18, 2022
…ions)

https://dart.googlesource.com/protobuf/+log/1d175bef6043..ba29983968de

2022-10-18 [email protected] protoc_plugin: Reword some of the documentation (#766)
2022-10-18 [email protected] protoc_plugin: Improve "is map field" check (#765)
2022-10-18 [email protected] Update CHANGELOG: mention #751
2022-10-18 [email protected] Add CHANGELOG entry for #760, #763
2022-10-18 [email protected] Fix `null` handling in proto3 JSON deserializer (#763)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/dart-protobuf-dart-sdk
Please CC [email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Dart Protobuf Support: https://github.com/dart-lang/protobuf/issues
To file a bug in Dart SDK: https://github.com/dart-lang/sdk/issues

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Tbr: [email protected]
Change-Id: I5502c8ee170701888956534cbd92473a24435fea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264664
Reviewed-by: Nate Bosch <[email protected]>
Commit-Queue: Nate Bosch <[email protected]>
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.
Projects
None yet
Development

No branches or pull requests

3 participants