Skip to content

[Wildcard Variables] Resolution of wildcard import directives #56245

@pq

Description

@pq

As per dart-lang/language#3799, import prefixes named _ are non-binding but will provide access to the non-private extensions in that library.

// a.dart
extension ExtendedString on String {
  bool get isBlank => trim().isEmpty;
}
// b.dart
import 'a.dart' as _; // OK.

main() {
  print(''.isBlank); // Prints `true`.
}

See: https://github.com/dart-lang/language/blob/main/working/wildcards/feature-specification.md#imports

Metadata

Metadata

Assignees

Labels

P2A bug or feature request we're likely to work onfeature-wildcard-variablesImplementation of the wildcard variables featurelegacy-area-analyzerUse area-devexp instead.type-enhancementA request for a change that isn't a bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions