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

Side by Side Diff: pkg/analyzer/test/src/task/dart_test.dart

Issue 1780783002: Don't report redundant type errors in strong mode. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Stop type propagation in test. Created 4 years, 9 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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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.src.task.dart_test; 5 library analyzer.test.src.task.dart_test;
6 6
7 import 'package:analyzer/dart/ast/ast.dart'; 7 import 'package:analyzer/dart/ast/ast.dart';
8 import 'package:analyzer/dart/ast/token.dart'; 8 import 'package:analyzer/dart/ast/token.dart';
9 import 'package:analyzer/dart/ast/visitor.dart'; 9 import 'package:analyzer/dart/ast/visitor.dart';
10 import 'package:analyzer/dart/element/element.dart'; 10 import 'package:analyzer/dart/element/element.dart';
(...skipping 4742 matching lines...) Expand 10 before | Expand all | Expand 10 after
4753 expect(DynamicInvoke.get(idx.target), isNotNull); 4753 expect(DynamicInvoke.get(idx.target), isNotNull);
4754 expect(DynamicInvoke.get(idx.target), isNotNull); 4754 expect(DynamicInvoke.get(idx.target), isNotNull);
4755 expect(DynamicInvoke.get(idx.target), isTrue); 4755 expect(DynamicInvoke.get(idx.target), isTrue);
4756 } 4756 }
4757 4757
4758 void test_perform_verifyError() { 4758 void test_perform_verifyError() {
4759 enableStrongMode(); 4759 enableStrongMode();
4760 AnalysisTarget source = newSource( 4760 AnalysisTarget source = newSource(
4761 '/test.dart', 4761 '/test.dart',
4762 ''' 4762 '''
4763 int topLevel = 3; 4763 class A {}
4764 class C { 4764 class B extends A {}
4765 String field = topLevel; 4765 B b = new A();
4766 }
4767 '''); 4766 ''');
4768 computeResult(new LibrarySpecificUnit(source, source), STRONG_MODE_ERRORS); 4767 computeResult(new LibrarySpecificUnit(source, source), STRONG_MODE_ERRORS);
4769 // validate 4768 // validate
4770 _fillErrorListener(STRONG_MODE_ERRORS); 4769 _fillErrorListener(STRONG_MODE_ERRORS);
4771 4770
4772 var errors = errorListener.errors; 4771 var errors = errorListener.errors;
4773 expect(errors.length, 1); 4772 expect(errors.length, 1);
4774 expect(errors[0].errorCode.name, "STRONG_MODE_STATIC_TYPE_ERROR"); 4773 expect(errors[0].errorCode.name, "STRONG_MODE_STATIC_TYPE_ERROR");
4775 } 4774 }
4776 } 4775 }
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
5037 /** 5036 /**
5038 * Fill [errorListener] with [result] errors in the current [task]. 5037 * Fill [errorListener] with [result] errors in the current [task].
5039 */ 5038 */
5040 void _fillErrorListener(ResultDescriptor<List<AnalysisError>> result) { 5039 void _fillErrorListener(ResultDescriptor<List<AnalysisError>> result) {
5041 List<AnalysisError> errors = task.outputs[result]; 5040 List<AnalysisError> errors = task.outputs[result];
5042 expect(errors, isNotNull, reason: result.name); 5041 expect(errors, isNotNull, reason: result.name);
5043 errorListener = new GatheringErrorListener(); 5042 errorListener = new GatheringErrorListener();
5044 errorListener.addAll(errors); 5043 errorListener.addAll(errors);
5045 } 5044 }
5046 } 5045 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/src/context/mock_sdk.dart ('k') | pkg/analyzer/test/src/task/strong/checker_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698