| Index: tests/compiler/dart2js_native/subclassing_4_test.dart
|
| diff --git a/tests/compiler/dart2js_native/subclassing_3_test.dart b/tests/compiler/dart2js_native/subclassing_4_test.dart
|
| similarity index 57%
|
| copy from tests/compiler/dart2js_native/subclassing_3_test.dart
|
| copy to tests/compiler/dart2js_native/subclassing_4_test.dart
|
| index d73f0c82d0de09626ce85484fccfaddd7ae39013..9d25e1a448e09543c0c6cf6847a6144ae949c89e 100644
|
| --- a/tests/compiler/dart2js_native/subclassing_3_test.dart
|
| +++ b/tests/compiler/dart2js_native/subclassing_4_test.dart
|
| @@ -6,26 +6,24 @@ import "package:expect/expect.dart";
|
| import 'dart:_js_helper' show Creates, setNativeSubclassDispatchRecord;
|
| import 'dart:_interceptors' show Interceptor, findInterceptorForType;
|
|
|
| -// Test calling convention of methods introduced on subclasses of native
|
| -// class of mixin.
|
| -
|
| -doFoo(r, x) => '$x,${r.oof()},${r.miz()}';
|
| +// Test calling convention on subclasses of native classes.
|
|
|
| class M {
|
| miz() => 'M';
|
| }
|
|
|
| -class N native "N" {
|
| - foo(x) => (doFoo)(this, x);
|
| -}
|
| +class N native "N" {}
|
|
|
| class A extends N {}
|
|
|
| class B extends A with M {
|
| - // [oof] is introduced only on this subclass of a native class. It should
|
| - // have interceptor calling convention.
|
| - oof() => 'B';
|
| - // [miz] is introduced only on the mixin-application A+M.
|
| + // The call to [miz] has a know type [B]. The call is in an intercepted
|
| + // method and to an intercepted method, so the ambient interceptor can be
|
| + // used. For correct optimization of the interceptor, the compiler needs to
|
| + // (1) correctly determine that B is an intercepted type (because it extends a
|
| + // native class) and (2) realize that the intersection of [B] and subclasses
|
| + // of mixin applications of [M] is non-empty.
|
| + callMiz() => this.miz();
|
| }
|
|
|
| B makeB() native;
|
| @@ -36,7 +34,6 @@ getBPrototype() native;
|
| void setup() native r"""
|
| function B() {}
|
| makeB = function(){return new B;};
|
| -
|
| getBPrototype = function(){return B.prototype;};
|
| """;
|
|
|
| @@ -46,5 +43,5 @@ main() {
|
| setNativeSubclassDispatchRecord(getBPrototype(), findInterceptorForType(B));
|
|
|
| B b = makeB();
|
| - Expect.equals('1,B,M', b.foo(1));
|
| + Expect.equals('M', b.callMiz());
|
| }
|
|
|