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

Side by Side Diff: tests/compiler/dart2js/simple_inferrer_test.dart

Issue 22916003: Tweak simple_inferrer_test to pass with fix for 12320 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 import 'package:expect/expect.dart'; 5 import 'package:expect/expect.dart';
6 import 6 import
7 '../../../sdk/lib/_internal/compiler/implementation/types/types.dart' 7 '../../../sdk/lib/_internal/compiler/implementation/types/types.dart'
8 show TypeMask; 8 show TypeMask;
9 9
10 import 'compiler_helper.dart'; 10 import 'compiler_helper.dart';
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 checkReturn('testIsCheck20', typesTask.dynamicType.nonNullable()); 537 checkReturn('testIsCheck20', typesTask.dynamicType.nonNullable());
538 checkReturn('returnAsString', 538 checkReturn('returnAsString',
539 new TypeMask.subtype(compiler.stringClass.computeType(compiler))); 539 new TypeMask.subtype(compiler.stringClass.computeType(compiler)));
540 checkReturn('returnIntAsNum', typesTask.intType); 540 checkReturn('returnIntAsNum', typesTask.intType);
541 checkReturn('returnAsTypedef', typesTask.functionType.nullable()); 541 checkReturn('returnAsTypedef', typesTask.functionType.nullable());
542 checkReturn('returnTopLevelGetter', typesTask.intType); 542 checkReturn('returnTopLevelGetter', typesTask.intType);
543 checkReturn('testDeadCode', typesTask.intType); 543 checkReturn('testDeadCode', typesTask.intType);
544 checkReturn('testLabeledIf', typesTask.intType.nullable()); 544 checkReturn('testLabeledIf', typesTask.intType.nullable());
545 checkReturn('testSwitch1', typesTask.intType 545 checkReturn('testSwitch1', typesTask.intType
546 .union(typesTask.doubleType, compiler).nullable().simplify(compiler)); 546 .union(typesTask.doubleType, compiler).nullable().simplify(compiler));
547 checkReturn('testSwitch2', typesTask.intType); 547 // TODO(12320): testSwitch2 should be non-nullable. The quick fix for 12320
548 // models control flow through as though there is an additional empty default
549 // case.
550 checkReturn('testSwitch2', typesTask.intType.nullable());
548 checkReturn('testSwitch3', interceptorType.nullable()); 551 checkReturn('testSwitch3', interceptorType.nullable());
549 checkReturn('testSwitch4', typesTask.intType); 552 checkReturn('testSwitch4', typesTask.intType);
550 checkReturn('testContinue1', interceptorType.nullable()); 553 checkReturn('testContinue1', interceptorType.nullable());
551 checkReturn('testBreak1', interceptorType.nullable()); 554 checkReturn('testBreak1', interceptorType.nullable());
552 checkReturn('testContinue2', interceptorType.nullable()); 555 checkReturn('testContinue2', interceptorType.nullable());
553 checkReturn('testBreak2', typesTask.intType.nullable()); 556 checkReturn('testBreak2', typesTask.intType.nullable());
554 checkReturn('testReturnElementOfConstList1', typesTask.intType); 557 checkReturn('testReturnElementOfConstList1', typesTask.intType);
555 checkReturn('testReturnElementOfConstList2', typesTask.intType); 558 checkReturn('testReturnElementOfConstList2', typesTask.intType);
556 checkReturn('testReturnItselfOrInt', typesTask.intType); 559 checkReturn('testReturnItselfOrInt', typesTask.intType);
557 checkReturn('testReturnInvokeDynamicGetter', typesTask.dynamicType); 560 checkReturn('testReturnInvokeDynamicGetter', typesTask.dynamicType);
(...skipping 24 matching lines...) Expand all
582 checkReturnInClass('B', 'returnInt9', typesTask.intType); 585 checkReturnInClass('B', 'returnInt9', typesTask.intType);
583 586
584 checkFactoryConstructor(String className, String factoryName) { 587 checkFactoryConstructor(String className, String factoryName) {
585 var cls = findElement(compiler, className); 588 var cls = findElement(compiler, className);
586 var element = cls.localLookup(buildSourceString(factoryName)); 589 var element = cls.localLookup(buildSourceString(factoryName));
587 Expect.equals(new TypeMask.nonNullExact(cls.rawType), 590 Expect.equals(new TypeMask.nonNullExact(cls.rawType),
588 typesInferrer.getReturnTypeOfElement(element)); 591 typesInferrer.getReturnTypeOfElement(element));
589 } 592 }
590 checkFactoryConstructor('A', ''); 593 checkFactoryConstructor('A', '');
591 } 594 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698