Skip to content

Commit 37e7d3c

Browse files
authored
[wildcard-variables] Add section on imports. (#3819)
1 parent da009db commit 37e7d3c

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

working/wildcards/feature-specification.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Author: Bob Nystrom
44

55
Status: In-progress
66

7-
Version 1.3
7+
Version 1.4
88

99
## Motivation
1010

@@ -147,7 +147,8 @@ It is currently an error for a record field name to begin with `_`
147147
fields whose name begins with `_` followed by at least one other character
148148
(even if those later character(s) are `_`).
149149

150-
Named fields of record types are unchanged. It is still a compile-time error for a named field name to start with `_`.
150+
Named fields of record types are unchanged. It is still a compile-time error
151+
for a named field name to start with `_`.
151152

152153
### Local function declarations
153154

@@ -161,6 +162,27 @@ void f() {
161162
A local function declaration named `_` is dead code and will produce a warning
162163
because the function is unreachable.
163164

165+
### Imports
166+
167+
```dart
168+
// a.dart
169+
extension on String {
170+
bool get isBlank => trim().isEmpty;
171+
}
172+
```
173+
174+
```dart
175+
// b.dart
176+
import 'a.dart' as _; // OK.
177+
178+
main() {
179+
print(''.isBlank); // Prints `true`.
180+
}
181+
```
182+
183+
Import prefixes named `_` are non-binding and will provide access to the
184+
extensions in that library.
185+
164186
### Other declarations
165187

166188
Top-level variables, top-level function names, type names, member names,
@@ -439,6 +461,9 @@ This lint is included in the core lint set which means that the scale of the bre
439461

440462
## Changelog
441463

464+
### 1.4
465+
- Add section on import prefixes. Discussion: [language/#3799](https://github.com/dart-lang/language/issues/3799)
466+
442467
### 1.3
443468

444469
- Add section on local function declarations. Discussion: [language/#3790](https://github.com/dart-lang/language/issues/3790)

0 commit comments

Comments
 (0)