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

Side by Side Diff: pkg/analyzer/lib/src/task/dart.dart

Issue 1596733002: strong_mode.dart: remove extra asserts and throw (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/task/strong_mode.dart » ('j') | 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) 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.src.task.dart; 5 library analyzer.src.task.dart;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/dart/element/element.dart'; 9 import 'package:analyzer/dart/element/element.dart';
10 import 'package:analyzer/dart/element/type.dart'; 10 import 'package:analyzer/dart/element/type.dart';
(...skipping 3197 matching lines...) Expand 10 before | Expand all | Expand 10 after
3208 visitor.initForIncrementalResolution(); 3208 visitor.initForIncrementalResolution();
3209 initializer.accept(visitor); 3209 initializer.accept(visitor);
3210 3210
3211 // 3211 //
3212 // Record the type of the variable. 3212 // Record the type of the variable.
3213 // 3213 //
3214 DartType newType = initializer.staticType; 3214 DartType newType = initializer.staticType;
3215 if (newType == null || newType.isBottom) { 3215 if (newType == null || newType.isBottom) {
3216 newType = typeProvider.dynamicType; 3216 newType = typeProvider.dynamicType;
3217 } 3217 }
3218 variable.type = newType; 3218 setFieldType(variable, newType);
3219 (variable.initializer as ExecutableElementImpl).returnType = newType;
3220 if (variable is PropertyInducingElementImpl) {
3221 setReturnType(variable.getter, newType);
3222 if (!variable.isFinal && !variable.isConst) {
3223 setParameterType(variable.setter, newType);
3224 }
3225 }
3226 } else { 3219 } else {
3227 // TODO(brianwilkerson) For now we simply don't infer any type for 3220 // TODO(brianwilkerson) For now we simply don't infer any type for
3228 // variables or fields involved in a cycle. We could try to be smarter 3221 // variables or fields involved in a cycle. We could try to be smarter
3229 // by re-resolving the initializer in a context in which the types of all 3222 // by re-resolving the initializer in a context in which the types of all
3230 // of the variables in the cycle are assumed to be `null`, but it isn't 3223 // of the variables in the cycle are assumed to be `null`, but it isn't
3231 // clear to me that this would produce better results often enough to 3224 // clear to me that this would produce better results often enough to
3232 // warrant the extra effort. 3225 // warrant the extra effort.
3233 } 3226 }
3234 // 3227 //
3235 // Record outputs. 3228 // Record outputs.
(...skipping 2208 matching lines...) Expand 10 before | Expand all | Expand 10 after
5444 5437
5445 @override 5438 @override
5446 bool moveNext() { 5439 bool moveNext() {
5447 if (_newSources.isEmpty) { 5440 if (_newSources.isEmpty) {
5448 return false; 5441 return false;
5449 } 5442 }
5450 currentTarget = _newSources.removeLast(); 5443 currentTarget = _newSources.removeLast();
5451 return true; 5444 return true;
5452 } 5445 }
5453 } 5446 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/task/strong_mode.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698