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

Side by Side Diff: tests/compiler/dart2js/equivalence/check_functions.dart

Issue 2983483002: Check function type equivalence (Closed)
Patch Set: Created 3 years, 5 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
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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 /// Equivalence test functions for data objects. 5 /// Equivalence test functions for data objects.
6 6
7 library dart2js.equivalence.functions; 7 library dart2js.equivalence.functions;
8 8
9 import 'package:expect/expect.dart'; 9 import 'package:expect/expect.dart';
10 import 'package:compiler/src/common/resolution.dart'; 10 import 'package:compiler/src/common/resolution.dart';
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 env2.isDeferredLoadLibraryGetter(member2)); 462 env2.isDeferredLoadLibraryGetter(member2));
463 463
464 checkListEquivalence( 464 checkListEquivalence(
465 member1, 465 member1,
466 member2, 466 member2,
467 'metadata', 467 'metadata',
468 env1.getMemberMetadata(member1), 468 env1.getMemberMetadata(member1),
469 env2.getMemberMetadata(member2), 469 env2.getMemberMetadata(member2),
470 strategy.testConstantValues); 470 strategy.testConstantValues);
471 471
472 // TODO(johnniwinther): Check function type. Currently hitting problems with 472 if (member1 is FunctionEntity && member2 is FunctionEntity) {
473 // return types of generative constructors, function types referring to
474 // typedefs and forwarding constructors.
475 /*if (member1 is FunctionEntity && member2 is FunctionEntity) {
476 check(member1, member2, 'getFunctionType', env1.getFunctionType(member1), 473 check(member1, member2, 'getFunctionType', env1.getFunctionType(member1),
477 env2.getFunctionType(member2), strategy.typeEquivalence); 474 env2.getFunctionType(member2), strategy.typeEquivalence);
478 }*/ 475 }
479 } 476 }
480 477
481 checkSetEquivalence(env1, env2, 'libraries', env1.libraries, env2.libraries, 478 checkSetEquivalence(env1, env2, 'libraries', env1.libraries, env2.libraries,
482 strategy.elementEquivalence, 479 strategy.elementEquivalence,
483 onSameElement: (LibraryEntity lib1, LibraryEntity lib2) { 480 onSameElement: (LibraryEntity lib1, LibraryEntity lib2) {
484 Expect.identical(lib1, env1.lookupLibrary(lib1.canonicalUri)); 481 Expect.identical(lib1, env1.lookupLibrary(lib1.canonicalUri));
485 Expect.identical(lib2, env2.lookupLibrary(lib2.canonicalUri)); 482 Expect.identical(lib2, env2.lookupLibrary(lib2.canonicalUri));
486 483
487 // TODO(johnniwinther): Check libraryName. 484 // TODO(johnniwinther): Check libraryName.
488 485
(...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after
1175 print(' ${js.nodeToString(node1)}'); 1172 print(' ${js.nodeToString(node1)}');
1176 print(' ${js.nodeToString(node2)}'); 1173 print(' ${js.nodeToString(node2)}');
1177 } 1174 }
1178 return expectedValue == label2; 1175 return expectedValue == label2;
1179 } else { 1176 } else {
1180 labelsMap[label1] = label2; 1177 labelsMap[label1] = label2;
1181 return true; 1178 return true;
1182 } 1179 }
1183 } 1180 }
1184 } 1181 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/resolution/resolution_strategy.dart ('k') | tests/compiler/dart2js/kernel/test_helpers.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698