From 7d17c1efba8915eff525683bff6a5f821d776d13 Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Thu, 21 Nov 2019 10:33:13 -0500 Subject: [PATCH] Undo example code changes Per @mit-mit's request. Will be addressed in a followup PR. --- examples/misc/bin/try_dart/classes.dart | 4 ++-- examples/misc/bin/try_dart/functions.dart | 4 ++-- src/_try-dart-examples.md | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/misc/bin/try_dart/classes.dart b/examples/misc/bin/try_dart/classes.dart index fcf361812b..634a98f7cf 100644 --- a/examples/misc/bin/try_dart/classes.dart +++ b/examples/misc/bin/try_dart/classes.dart @@ -16,14 +16,14 @@ class Chest implements Item { } class Sword implements Item { - int get damage => 5; + int damage = 5; use() => print("$this dealt $damage damage."); } // Classes can extend other classes. class DiamondSword extends Sword { - int get damage => 50; + int damage = 50; // ignore: overridden_fields } main() { diff --git a/examples/misc/bin/try_dart/functions.dart b/examples/misc/bin/try_dart/functions.dart index c4dc81e890..5a18f5f2b3 100644 --- a/examples/misc/bin/try_dart/functions.dart +++ b/examples/misc/bin/try_dart/functions.dart @@ -7,9 +7,9 @@ int timesTwo(int x) { int timesFour(int x) => timesTwo(timesTwo(x)); // Functions are objects. -int runTwice(int x, int Function(int) f) { +int runTwice(int x, Function f) { for (var i = 0; i < 2; i++) { - x = f(x); + x = f(x); // ignore: invalid_assignment } return x; } diff --git a/src/_try-dart-examples.md b/src/_try-dart-examples.md index 23941fa356..498ef0da84 100644 --- a/src/_try-dart-examples.md +++ b/src/_try-dart-examples.md @@ -1,4 +1,4 @@ - +