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

Unified Diff: dart/tests/compiler/dart2js/concrete_type_inference_test.dart

Issue 10836134: Revert "Infer guaranteed types for static calls that are only called once." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « dart/tests/compiler/dart2js/compiler_helper.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/tests/compiler/dart2js/concrete_type_inference_test.dart
diff --git a/dart/tests/compiler/dart2js/concrete_type_inference_test.dart b/dart/tests/compiler/dart2js/concrete_type_inference_test.dart
deleted file mode 100644
index fe106f909450f9a96b369b674d75267f0af018da..0000000000000000000000000000000000000000
--- a/dart/tests/compiler/dart2js/concrete_type_inference_test.dart
+++ /dev/null
@@ -1,104 +0,0 @@
-// Copyright (c) 2012, 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("dart:uri");
-
-#import('compiler_helper.dart');
-#import('parser_helper.dart');
-
-findElement(var compiler, String name) {
- var element = compiler.mainApp.find(buildSourceString(name));
- Expect.isNotNull(element, 'Could not locate $name.');
- return element;
-}
-
-void compileAndFind(String code, String name,
- check(compiler, element)) {
- Uri uri = new Uri.fromComponents(scheme: 'source');
- var compiler = compilerFor(code, uri);
- compiler.runCompiler(uri);
- var element = findElement(compiler, name);
- return check(compiler, element);
-}
-
-void checkPrintType(String expression, checkType(compiler, type)) {
- compileAndFind(
- 'main() { print($expression); }',
- 'print',
- (compiler, printElement) {
- var parameter =
- printElement.computeSignature(compiler).requiredParameters.head;
- var type = compiler.typesTask.getGuaranteedTypeOfElement(parameter);
- checkType(compiler, type);
- });
-
- compileAndFind(
- 'main() { var x = print; print($expression); }',
- 'print',
- (compiler, printElement) {
- var parameter =
- printElement.computeSignature(compiler).requiredParameters.head;
- var type = compiler.typesTask.getGuaranteedTypeOfElement(parameter);
- Expect.isNull(type);
- });
-
- compileAndFind(
- 'main() { print($expression); print($expression); }',
- 'print',
- (compiler, printElement) {
- var parameter =
- printElement.computeSignature(compiler).requiredParameters.head;
- var type = compiler.typesTask.getGuaranteedTypeOfElement(parameter);
- // TODO(ahe): Should be:
- // checkType(compiler, type);
- Expect.isNull(type);
- });
-}
-
-void testBasicTypes() {
- checkPrintType('true', (compiler, type) {
- Expect.identical(compiler.boolClass, type);
- });
- checkPrintType('1.0', (compiler, type) {
- Expect.identical(compiler.doubleClass, type);
- });
- checkPrintType('1', (compiler, type) {
- Expect.identical(compiler.intClass, type);
- });
- checkPrintType('[]', (compiler, type) {
- Expect.identical(compiler.listClass, type);
- });
- checkPrintType('null', (compiler, type) {
- Expect.identical(compiler.nullClass, type);
- });
- checkPrintType('"foo"', (compiler, type) {
- Expect.identical(compiler.stringClass, type);
- });
-}
-
-void testOptionalParameters() {
- compileAndFind(
- 'fisk(a, [b, c]) {} main() { fisk(1); }',
- 'fisk',
- (compiler, fiskElement) {
- var firstParameter =
- fiskElement.computeSignature(compiler).requiredParameters.head;
- var secondParameter =
- fiskElement.computeSignature(compiler).optionalParameters.head;
- var thirdParameter =
- fiskElement.computeSignature(compiler).optionalParameters.tail.head;
- Expect.identical(
- compiler.intClass,
- compiler.typesTask.getGuaranteedTypeOfElement(firstParameter));
- Expect.isNull(
- compiler.typesTask.getGuaranteedTypeOfElement(secondParameter));
- Expect.isNull(
- compiler.typesTask.getGuaranteedTypeOfElement(thirdParameter));
- });
-}
-
-void main() {
- testBasicTypes();
- testOptionalParameters();
-}
« no previous file with comments | « dart/tests/compiler/dart2js/compiler_helper.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698