Skip to content

Commit 683ea6d

Browse files
Dan Rubelcommit-bot@chromium.org
authored andcommitted
add fasta extension method test
Change-Id: I8de4f01463aa141ac4104d98b8ba42f970e32021 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103881 Commit-Queue: Dan Rubel <danrubel@google.com> Auto-Submit: Dan Rubel <danrubel@google.com> Reviewed-by: Aske Simon Christensen <askesc@google.com>
1 parent 0ae10fa commit 683ea6d

9 files changed

+698
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
// SharedOptions=--enable-experiment=extension-methods
6+
7+
import 'package:expect/expect.dart';
8+
9+
class C {
10+
int get one => 1;
11+
}
12+
13+
extension E on C {
14+
int get two => 2;
15+
}
16+
17+
main() {
18+
C c = C();
19+
var result = c.one + c.two;
20+
Expect.equals(result, 3);
21+
}

0 commit comments

Comments
 (0)