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

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

Issue 1239513005: Switch on null-aware operators by default in analyzer. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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) 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 engine.resolver_test; 5 library engine.resolver_test;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/src/context/context.dart' as newContext; 9 import 'package:analyzer/src/context/context.dart' as newContext;
10 import 'package:analyzer/src/generated/ast.dart'; 10 import 'package:analyzer/src/generated/ast.dart';
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 void set analysisOptions(AnalysisOptions options) { 392 void set analysisOptions(AnalysisOptions options) {
393 AnalysisOptions currentOptions = analysisOptions; 393 AnalysisOptions currentOptions = analysisOptions;
394 bool needsRecompute = currentOptions.analyzeFunctionBodiesPredicate != 394 bool needsRecompute = currentOptions.analyzeFunctionBodiesPredicate !=
395 options.analyzeFunctionBodiesPredicate || 395 options.analyzeFunctionBodiesPredicate ||
396 currentOptions.generateImplicitErrors != 396 currentOptions.generateImplicitErrors !=
397 options.generateImplicitErrors || 397 options.generateImplicitErrors ||
398 currentOptions.generateSdkErrors != options.generateSdkErrors || 398 currentOptions.generateSdkErrors != options.generateSdkErrors ||
399 currentOptions.dart2jsHint != options.dart2jsHint || 399 currentOptions.dart2jsHint != options.dart2jsHint ||
400 (currentOptions.hint && !options.hint) || 400 (currentOptions.hint && !options.hint) ||
401 currentOptions.preserveComments != options.preserveComments || 401 currentOptions.preserveComments != options.preserveComments ||
402 currentOptions.enableNullAwareOperators !=
403 options.enableNullAwareOperators ||
404 currentOptions.enableStrictCallChecks != options.enableStrictCallChecks; 402 currentOptions.enableStrictCallChecks != options.enableStrictCallChecks;
405 if (needsRecompute) { 403 if (needsRecompute) {
406 fail( 404 fail(
407 "Cannot set options that cause the sources to be reanalyzed in a test context"); 405 "Cannot set options that cause the sources to be reanalyzed in a test context");
408 } 406 }
409 super.analysisOptions = options; 407 super.analysisOptions = options;
410 } 408 }
411 409
412 @override 410 @override
413 bool exists(Source source) => 411 bool exists(Source source) =>
(...skipping 5993 matching lines...) Expand 10 before | Expand all | Expand 10 after
6407 void set analysisOptions(AnalysisOptions options) { 6405 void set analysisOptions(AnalysisOptions options) {
6408 AnalysisOptions currentOptions = analysisOptions; 6406 AnalysisOptions currentOptions = analysisOptions;
6409 bool needsRecompute = currentOptions.analyzeFunctionBodiesPredicate != 6407 bool needsRecompute = currentOptions.analyzeFunctionBodiesPredicate !=
6410 options.analyzeFunctionBodiesPredicate || 6408 options.analyzeFunctionBodiesPredicate ||
6411 currentOptions.generateImplicitErrors != 6409 currentOptions.generateImplicitErrors !=
6412 options.generateImplicitErrors || 6410 options.generateImplicitErrors ||
6413 currentOptions.generateSdkErrors != options.generateSdkErrors || 6411 currentOptions.generateSdkErrors != options.generateSdkErrors ||
6414 currentOptions.dart2jsHint != options.dart2jsHint || 6412 currentOptions.dart2jsHint != options.dart2jsHint ||
6415 (currentOptions.hint && !options.hint) || 6413 (currentOptions.hint && !options.hint) ||
6416 currentOptions.preserveComments != options.preserveComments || 6414 currentOptions.preserveComments != options.preserveComments ||
6417 currentOptions.enableNullAwareOperators !=
6418 options.enableNullAwareOperators ||
6419 currentOptions.enableStrictCallChecks != options.enableStrictCallChecks; 6415 currentOptions.enableStrictCallChecks != options.enableStrictCallChecks;
6420 if (needsRecompute) { 6416 if (needsRecompute) {
6421 fail( 6417 fail(
6422 "Cannot set options that cause the sources to be reanalyzed in a test context"); 6418 "Cannot set options that cause the sources to be reanalyzed in a test context");
6423 } 6419 }
6424 super.analysisOptions = options; 6420 super.analysisOptions = options;
6425 } 6421 }
6426 6422
6427 @override 6423 @override
6428 bool exists(Source source) => 6424 bool exists(Source source) =>
(...skipping 7614 matching lines...) Expand 10 before | Expand all | Expand 10 after
14043 // check propagated type 14039 // check propagated type
14044 FunctionType propagatedType = node.propagatedType as FunctionType; 14040 FunctionType propagatedType = node.propagatedType as FunctionType;
14045 expect(propagatedType.returnType, test.typeProvider.stringType); 14041 expect(propagatedType.returnType, test.typeProvider.stringType);
14046 } on AnalysisException catch (e, stackTrace) { 14042 } on AnalysisException catch (e, stackTrace) {
14047 thrownException[0] = new CaughtException(e, stackTrace); 14043 thrownException[0] = new CaughtException(e, stackTrace);
14048 } 14044 }
14049 } 14045 }
14050 return null; 14046 return null;
14051 } 14047 }
14052 } 14048 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/generated/parser_test.dart ('k') | pkg/analyzer/test/generated/scanner_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698