eee8787a8d
class in a foreign library. This CL changes the predicate which is used to decide whether to generate noSuchMethod forwarders such that it returns true whenever the class in question has a user defined no such method or the enclosing library of the class is different from that of the member. Closes https://github.com/dart-lang/sdk/issues/33727 Change-Id: I0ffcbb8c8bdd69e4261bcefce2251d31babc19cf Reviewed-on: https://dart-review.googlesource.com/c/79209 Commit-Queue: Daniel Hillerström <hillerstrom@google.com> Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
20 lines
726 B
Dart
20 lines
726 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';
|
|
|
|
import './private_method_tearoff_lib.dart';
|
|
|
|
// `Bar' contains a private method `_f'. The function `baz' is declared in the
|
|
// same library as `Bar'. Given an subtype of `Bar', it tearoffs `_f' and
|
|
// returns a string representation of its runtime type. For this code to
|
|
// evaluate correctly, the generated Kernel code for `Foo' must contain a no
|
|
// such method forwarder for `_f'.
|
|
|
|
class Foo implements Bar {}
|
|
|
|
main() {
|
|
Expect.equals("() => void", baz(new Foo()));
|
|
}
|