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

Side by Side Diff: pkg/analyzer/test/generated/non_error_resolver_test.dart

Issue 1533823006: Constant instance creation dependencies also should be computed. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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 | « pkg/analyzer/lib/src/generated/constant.dart ('k') | 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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 analyzer.test.generated.non_error_resolver_test; 5 library analyzer.test.generated.non_error_resolver_test;
6 6
7 import 'package:analyzer/dart/element/element.dart'; 7 import 'package:analyzer/dart/element/element.dart';
8 import 'package:analyzer/src/generated/ast.dart'; 8 import 'package:analyzer/src/generated/ast.dart';
9 import 'package:analyzer/src/generated/engine.dart'; 9 import 'package:analyzer/src/generated/engine.dart';
10 import 'package:analyzer/src/generated/error.dart'; 10 import 'package:analyzer/src/generated/error.dart';
(...skipping 1444 matching lines...) Expand 10 before | Expand all | Expand 10 after
1455 Source source = addSource(r''' 1455 Source source = addSource(r'''
1456 const app = 0; 1456 const app = 0;
1457 class A { 1457 class A {
1458 A(@app int app) {} 1458 A(@app int app) {}
1459 }'''); 1459 }''');
1460 computeLibrarySourceErrors(source); 1460 computeLibrarySourceErrors(source);
1461 assertNoErrors(source); 1461 assertNoErrors(source);
1462 verify([source]); 1462 verify([source]);
1463 } 1463 }
1464 1464
1465 void test_constWithNonConstantArgument_constField() {
1466 Source source = addSource(r'''
1467 class A {
1468 const A(x);
1469 }
1470 main() {
1471 const A(double.INFINITY);
1472 }''');
1473 computeLibrarySourceErrors(source);
1474 assertNoErrors(source);
1475 verify([source]);
1476 }
1477
1465 void test_constWithNonConstantArgument_literals() { 1478 void test_constWithNonConstantArgument_literals() {
1466 Source source = addSource(r''' 1479 Source source = addSource(r'''
1467 class A { 1480 class A {
1468 const A(a, b, c, d); 1481 const A(a, b, c, d);
1469 } 1482 }
1470 f() { return const A(true, 0, 1.0, '2'); }'''); 1483 f() { return const A(true, 0, 1.0, '2'); }''');
1471 computeLibrarySourceErrors(source); 1484 computeLibrarySourceErrors(source);
1472 assertNoErrors(source); 1485 assertNoErrors(source);
1473 verify([source]); 1486 verify([source]);
1474 } 1487 }
(...skipping 4554 matching lines...) Expand 10 before | Expand all | Expand 10 after
6029 reset(); 6042 reset();
6030 } 6043 }
6031 6044
6032 void _check_wrongNumberOfParametersForOperator1(String name) { 6045 void _check_wrongNumberOfParametersForOperator1(String name) {
6033 _check_wrongNumberOfParametersForOperator(name, "a"); 6046 _check_wrongNumberOfParametersForOperator(name, "a");
6034 } 6047 }
6035 6048
6036 CompilationUnit _getResolvedLibraryUnit(Source source) => 6049 CompilationUnit _getResolvedLibraryUnit(Source source) =>
6037 analysisContext.getResolvedCompilationUnit2(source, source); 6050 analysisContext.getResolvedCompilationUnit2(source, source);
6038 } 6051 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/constant.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698