Skip to content

Optional new combined with generic constructor fails #32802

Closed
@dgrove

Description

@dgrove

(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([]);

Metadata

Metadata

Labels

P0A serious issue requiring immediate resolutionclosed-duplicateClosed in favor of an existing reportlegacy-area-front-endLegacy: Use area-dart-model instead.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions