Skip to content

Dart 2 frontend uses the wrong scope for type annotations #32752

Closed
@rmacnak-google

Description

@rmacnak-google

This is a simplification of an issue encountered with generated FIDL2 bindings in Fuchsia. It blocks enabling Dart 2 in Fuchsia.

import 'dart:math' as math;

class Foo {
  List<math.Point> math;
}

main() {
  print(new Foo());
}

works in Dart, but in Dart 2 yields

a.dart:4:8: Error: 'math.Point' can't be used as a type because 'math' doesn't refer to an import prefix.
  List<math.Point> math;
       ^^^^^^^^^^

@peter-ahe-google @a-siva @zanderso

Metadata

Metadata

Assignees

Labels

area-languageDart language related items (some items might be better tracked at github.com/dart-lang/language).customer-fuchsiatype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions