Files
sdk/tests/language_2/extension_methods/syntax/extension_methods.dart
T
Dan Rubel 445a23a9bc first cut extension methods test
Change-Id: I0fa36916a5cf7f55dc5223c05d7d37211da035f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104020
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-05-30 16:01:22 +00:00

22 lines
468 B
Dart

// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// SharedOptions=--enable-experiment=extension-methods
import 'package:expect/expect.dart';
class C {
int get one => 1;
}
extension E on C {
int get two => 2;
}
main() {
C c = C();
var result = c.one + c.two;
Expect.equals(result, 3);
}