Files
sdk/tests/web/no_such_method_strong1_test.dart
T
Nate Biggs d3539374ff Cleanup extra --strong flags being passed in test/web.
Change-Id: Ia00ced1c31ccd49dc883d4dfdc4fe644d8a5e363
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435600
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2025-06-20 20:11:25 -07:00

29 lines
602 B
Dart

// Copyright (c) 2018, 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.
import 'package:expect/expect.dart';
abstract class A {
m(x);
}
class B implements A {
noSuchMethod(Invocation i) {
print("nsm call: ${i.memberName}");
if (i.isGetter) {
throw (" - tearoff");
}
if (i.isMethod) {
print(" - method invocation");
return 42;
}
return 123;
}
}
void main() {
A x = new B();
Expect.equals(42, x.m(3));
}