Skip to content

Optional new combined with generic constructor fails #32802

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
dgrove opened this issue Apr 6, 2018 · 1 comment
Closed

Optional new combined with generic constructor fails #32802

dgrove opened this issue Apr 6, 2018 · 1 comment
Assignees
Labels
closed-duplicate Closed in favor of an existing report legacy-area-front-end Legacy: Use area-dart-model instead. P0 A serious issue requiring immediate resolution
Milestone

Comments

@dgrove
Copy link
Contributor

dgrove commented Apr 6, 2018

(Marking as P0 because this will show up a lot for optional new/const)

My current build: 2.0.0-edge.f5da30ef13b9272c0c4a8996e387978765b949eb

Code:

main() {
    final List<Object> children = List<Object>.from([]);
}

yields this error:

./repo/dart-sdk/sdk/out/ReleaseX64/dart --preview-dart-2 ~/tmp/x.dart

tmp/x.dart:2:46: Error: An equality expression can't be an operand of another equality expression.
Try re-writing the expression.
final List children = List.from([]);
^
tmp/x.dart:2:47: Error: Expected an identifier, but got '.'.
final List children = List.from([]);
^
tmp/x.dart:2:47: Error: Getter not found: ''.
final List children = List.from([]);
^
tmp/x.dart:2:39: Error: The method '<' isn't defined for the class 'dart.core::Type'.
Try correcting the name to the name of an existing method, or defining a method named '<'.
final List children = List.from([]);
^
tmp/x.dart:2:46: Error: An equality expression can't be an operand of another equality expression.
Try re-writing the expression.
final List children = List.from([]);
^
tmp/x.dart:2:47: Error: Expected an identifier, but got '.'.
final List children = List.from([]);
^
tmp/x.dart:2:47: Error: Getter not found: ''.
final List children = List.from([]);
^
tmp/x.dart:2:39: Error: The method '<' isn't defined for the class 'dart.core::Type'.
Try correcting the name to the name of an existing method, or defining a method named '<'.
final List children = List.from([]);

@dgrove dgrove added P0 A serious issue requiring immediate resolution legacy-area-front-end Legacy: Use area-dart-model instead. labels Apr 6, 2018
@dgrove dgrove added this to the Dart2 Beta 3 milestone Apr 6, 2018
@peter-ahe-google
Copy link
Contributor

peter-ahe-google commented Apr 6, 2018

This is a duplicate of #30922.

@peter-ahe-google peter-ahe-google added the closed-duplicate Closed in favor of an existing report label Apr 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-duplicate Closed in favor of an existing report legacy-area-front-end Legacy: Use area-dart-model instead. P0 A serious issue requiring immediate resolution
Projects
None yet
Development

No branches or pull requests

3 participants