Skip to content
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

Test language/map_literal4_test fails on dart2js #12891

Closed
sgjesse opened this issue Aug 29, 2013 · 5 comments
Closed

Test language/map_literal4_test fails on dart2js #12891

sgjesse opened this issue Aug 29, 2013 · 5 comments
Assignees
Milestone

Comments

@sgjesse
Copy link
Contributor

sgjesse commented Aug 29, 2013

First of all this is a checked mode test, but it will also fail in unchecked mode due to the following construct:

    try {
      var m = const <String, int>{"a": 0};
      m[2] = 1; // 2 is not a String.
    } on TypeError catch (error) {
      result += 100000;
    }

Also the static warnings differ from the analyzer:

tests/language/map_literal4_test.dart:14:37: Warning: "int" is not assignable to "String".
      var m = <String, String>{"a": 0}; // 0 is not a String.
                                    ^
tests/language/map_literal4_test.dart:25:32: Warning: "String" is not assignable to "T".
      var m = <String, T>{"a": "b"}; // "b" is not an int.
                               ^^^
tests/language/map_literal4_test.dart:30:32: Warning: "int" is not assignable to "T".
      var m = <String, T>{"a": 0}; // OK.
                               ^
tests/language/map_literal4_test.dart:35:32: Warning: "int" is not assignable to "T".
      var m = <String, T>{"a": 0};
                               ^
vs

[warning] The element type 'int' cannot be assigned to the map value type 'String' (/usr/local/prj/dart/git/dart/tests/language/map_literal4_test.dart, line 14, col 37)
1 warning found.

This test should probably be rewritten to a multi-test.

@kasperl
Copy link

kasperl commented Sep 18, 2013

Added this to the M7 milestone.

@kasperl
Copy link

kasperl commented Sep 30, 2013

Removed Priority-Unassigned label.
Added Priority-Medium label.

@kasperl
Copy link

kasperl commented Oct 2, 2013

Removed this from the M7 milestone.
Added this to the M8 milestone.

@rakudrama
Copy link
Member

https://codereview.chromium.org/228063002/ being reviewed


Set owner to @rakudrama.
Removed this from the M8 milestone.
Added this to the 1.4 milestone.
Added Started label.

@rakudrama
Copy link
Member

Fixed r34841


Added Fixed label.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants