Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Unified Diff: CHANGELOG.md

Issue 2334413002: follow up for #25578, add `@checked` to package:meta (Closed)
Patch Set: fixed Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/meta/CHANGELOG.md » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: CHANGELOG.md
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 64e4b198511b8365582e2ad2fdb3f9f7b599b571..e1ed14455afada92704cd512a155a9927cb11747 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -39,6 +39,25 @@
}
```
+* New feature - use `@checked` to override a method and tighten a parameter
+ type (SDK issue [25578](https://github.com/dart-lang/sdk/issues/25578)).
+
+ ```dart
+ import 'package:meta/meta.dart' show checked;
+ class View {
+ addChild(View v) {}
+ }
+ class MyView extends View {
+ // this override is legal, it will check at runtime if we actually
+ // got a MyView.
+ addChild(@checked MyView v) {}
+ }
+ main() {
+ dynamic mv = new MyView();
+ mv.addChild(new View()); // runtime error
+ }
+ ```
+
## 1.19.0
### Language changes
« no previous file with comments | « no previous file | pkg/meta/CHANGELOG.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698