Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(980)

Side by Side Diff: tests/compiler/dart2js/kernel/impact_test.dart

Issue 2683403002: Handle equivalence for generic mixins. (Closed)
Patch Set: Updated cf. comment Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | tests/compiler/dart2js/serialization/test_helper.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library dart2js.kernel.impact_test; 5 library dart2js.kernel.impact_test;
6 6
7 import 'package:async_helper/async_helper.dart'; 7 import 'package:async_helper/async_helper.dart';
8 import 'package:compiler/src/commandline_options.dart'; 8 import 'package:compiler/src/commandline_options.dart';
9 import 'package:compiler/src/common.dart'; 9 import 'package:compiler/src/common.dart';
10 import 'package:compiler/src/common/names.dart'; 10 import 'package:compiler/src/common/names.dart';
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 testStaticGenericMethod(); 179 testStaticGenericMethod();
180 testInstanceGenericMethod(); 180 testInstanceGenericMethod();
181 testDynamicPrivateMethodInvoke(); 181 testDynamicPrivateMethodInvoke();
182 testJSCall(); 182 testJSCall();
183 testNativeMethod(); 183 testNativeMethod();
184 testNativeMethodCreates(); 184 testNativeMethodCreates();
185 testNativeMethodReturns(); 185 testNativeMethodReturns();
186 testNativeField(null); 186 testNativeField(null);
187 testMixinInstantiation(); 187 testMixinInstantiation();
188 testNamedMixinInstantiation(); 188 testNamedMixinInstantiation();
189 testGenericMixinInstantiation();
190 testGenericNamedMixinInstantiation();
189 } 191 }
190 192
191 testEmpty() {} 193 testEmpty() {}
192 testNull() => null; 194 testNull() => null;
193 testTrue() => true; 195 testTrue() => true;
194 testFalse() => false; 196 testFalse() => false;
195 testInt() => 42; 197 testInt() => 42;
196 testDouble() => 37.5; 198 testDouble() => 37.5;
197 testString() => 'foo'; 199 testString() => 'foo';
198 testStringInterpolation() => '${0}'; 200 testStringInterpolation() => '${0}';
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 @Native("NativeClass") 625 @Native("NativeClass")
624 class NativeClass { 626 class NativeClass {
625 @annotation_Creates_SerializedScriptValue 627 @annotation_Creates_SerializedScriptValue
626 final Object field; 628 final Object field;
627 629
628 factory NativeClass._() { throw new UnsupportedError("Not supported"); } 630 factory NativeClass._() { throw new UnsupportedError("Not supported"); }
629 } 631 }
630 testNativeField(NativeClass c) => c.field; 632 testNativeField(NativeClass c) => c.field;
631 testMixinInstantiation() => new Sub(); 633 testMixinInstantiation() => new Sub();
632 testNamedMixinInstantiation() => new NamedMixin(); 634 testNamedMixinInstantiation() => new NamedMixin();
635 testGenericMixinInstantiation() => new GenericSub<int, String>();
636 testGenericNamedMixinInstantiation() => new GenericNamedMixin<int, String>();
633 ''', 637 ''',
634 'sdk/tests/compiler/dart2js_native/helper.dart': ''' 638 'sdk/tests/compiler/dart2js_native/helper.dart': '''
635 import 'dart:_js_helper'; 639 import 'dart:_js_helper';
636 class Class { 640 class Class {
637 const Class.generative(); 641 const Class.generative();
638 factory Class.fact() => null; 642 factory Class.fact() => null;
639 const factory Class.redirect() = Class.generative; 643 const factory Class.redirect() = Class.generative;
640 } 644 }
641 class GenericClass<X, Y> { 645 class GenericClass<X, Y> {
642 const GenericClass.generative(); 646 const GenericClass.generative();
643 factory GenericClass.fact() => null; 647 factory GenericClass.fact() => null;
644 const factory GenericClass.redirect() = GenericClass<X, Y>.generative; 648 const factory GenericClass.redirect() = GenericClass<X, Y>.generative;
645 649
646 Map<X, T> genericMethod<T>(T arg) => { null: arg }; 650 Map<X, T> genericMethod<T>(T arg) => { null: arg };
647 } 651 }
648 typedef Typedef(); 652 typedef Typedef();
649 typedef X GenericTypedef<X, Y>(Y y); 653 typedef X GenericTypedef<X, Y>(Y y);
650 654
651 class Super {} 655 class Super {}
652 class Mixin1 {} 656 class Mixin1 {}
653 class Mixin2 {} 657 class Mixin2 {}
654 class Sub extends Super with Mixin1, Mixin2 {} 658 class Sub extends Super with Mixin1, Mixin2 {}
655 class NamedMixin = Super with Mixin1, Mixin2; 659 class NamedMixin = Super with Mixin1, Mixin2;
656 660
661 class GenericSuper<X1, Y1> {}
662 class GenericMixin1<X2, Y2> {}
663 class GenericMixin2<X3, Y3> {}
664 class GenericSub<X4, Y4> extends GenericSuper<X4, Y4>
665 with GenericMixin1<X4, Y4>, GenericMixin2<X4, Y4> {}
666 class GenericNamedMixin<X5, Y5> = GenericSuper<X5, Y5>
667 with GenericMixin1<X5, Y5>, GenericMixin2<X5, Y5>;
668
657 const String _serializedScriptValue = 669 const String _serializedScriptValue =
658 'num|String|bool|' 670 'num|String|bool|'
659 'JSExtendableArray|=Object'; 671 'JSExtendableArray|=Object';
660 const annotation_Creates_SerializedScriptValue = 672 const annotation_Creates_SerializedScriptValue =
661 const Creates(_serializedScriptValue);''', 673 const Creates(_serializedScriptValue);''',
662 }; 674 };
663 675
664 main(List<String> args) { 676 main(List<String> args) {
665 bool fullTest = args.contains('--full'); 677 bool fullTest = args.contains('--full');
666 asyncTest(() async { 678 asyncTest(() async {
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
874 visitList(type.optionalParameterTypes), 886 visitList(type.optionalParameterTypes),
875 type.namedParameters, 887 type.namedParameters,
876 visitList(type.namedParameterTypes)); 888 visitList(type.namedParameterTypes));
877 } 889 }
878 } 890 }
879 891
880 /// Perform unaliasing of all typedefs nested within a [ResolutionDartType]. 892 /// Perform unaliasing of all typedefs nested within a [ResolutionDartType].
881 ResolutionDartType unalias(ResolutionDartType type) { 893 ResolutionDartType unalias(ResolutionDartType type) {
882 return const Unaliaser().visit(type); 894 return const Unaliaser().visit(type);
883 } 895 }
OLDNEW
« no previous file with comments | « no previous file | tests/compiler/dart2js/serialization/test_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698