Skip to content

Commit

Permalink
Undo example code changes
Browse files Browse the repository at this point in the history
Per @mit-mit's request. Will be addressed in a followup PR.
  • Loading branch information
chalin committed Nov 21, 2019
1 parent 976b6b0 commit 7d17c1e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions examples/misc/bin/try_dart/classes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ class Chest<T> 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() {
Expand Down
4 changes: 2 additions & 2 deletions examples/misc/bin/try_dart/functions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
8 changes: 4 additions & 4 deletions src/_try-dart-examples.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?code-excerpt replace="/ *\/\/\s+ignore_for_file:[^\n]+\n//g; / *\/\/\s+ignore:[^\n]+\n//g"?>
<?code-excerpt replace="/ *\/\/\s+ignore_for_file:[^\n]+\n//g; /(^|\n) *\/\/\s+ignore:[^\n]+\n/$1/g; /(\n[^\n]+) *\/\/\s+ignore:[^\n]+\n/$1\n/g"?>

<div id="try-dart-examples" style="display:none" markdown="1">

Expand Down Expand Up @@ -26,7 +26,7 @@ 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);
}
Expand Down Expand Up @@ -145,14 +145,14 @@ class Chest<T> 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;
}
main() {
Expand Down

0 comments on commit 7d17c1e

Please sign in to comment.