Changelog update for extension method prefix change.

Change-Id: I530e8c0c704da41c49b12a20a7843ecd5e40abb5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124941
Reviewed-by: Michael Thomsen <mit@google.com>
This commit is contained in:
Leaf Petersen 2019-11-12 18:19:44 +00:00
parent 2563a1b2ac
commit 158559bc03

View file

@ -2,6 +2,35 @@
(Add new changes here, and they will be copied to the change section for the
next release)
### Language
* **Breaking Change**: [Static extension members][] are accessible when
imported with a prefix (issue [671][]). In the extension method **preview**
launch, importing a library with a prefix hid all extension members in
addition to hiding the extension name, thereby making them inaccessible
in the importing library except via the explicit override syntax. Based
on user feedback, we have changed this to make extensions methods accessible
even when imported with a prefix.
```dart
// "thing.dart"
class Thing {
}
extension Show on Thing {
void show() {
print("This is a thing");
}
}
// "client.dart"
import "thing.dart" as p;
void test() {
p.Thing().show(); // Previously an error, now resolves to Show.show
}
```
[Static extension members]: https://github.com/dart-lang/language/blob/master/accepted/2.6/static-extension-members/feature-specification.md
[671]: https://github.com/dart-lang/language/issues/671
### Core libraries
#### `dart:io`