| OLD | NEW |
| 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 // TODO(jmesserly): this was ported from package:dev_compiler, and needs to be | 5 // TODO(jmesserly): this was ported from package:dev_compiler, and needs to be |
| 6 // refactored to fit into analyzer. | 6 // refactored to fit into analyzer. |
| 7 library analyzer.src.task.strong.checker; | 7 library analyzer.src.task.strong.checker; |
| 8 | 8 |
| 9 import 'package:analyzer/analyzer.dart'; | 9 import 'package:analyzer/analyzer.dart'; |
| 10 import 'package:analyzer/dart/ast/ast.dart'; | 10 import 'package:analyzer/dart/ast/ast.dart'; |
| (...skipping 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1107 } | 1107 } |
| 1108 } | 1108 } |
| 1109 } | 1109 } |
| 1110 | 1110 |
| 1111 if (n == null || | 1111 if (n == null || |
| 1112 n is NullLiteral || | 1112 n is NullLiteral || |
| 1113 n is BooleanLiteral || | 1113 n is BooleanLiteral || |
| 1114 n is DoubleLiteral || | 1114 n is DoubleLiteral || |
| 1115 n is IntegerLiteral || | 1115 n is IntegerLiteral || |
| 1116 n is StringLiteral || | 1116 n is StringLiteral || |
| 1117 n is SymbolLiteral) { | 1117 n is SymbolLiteral || |
| 1118 n is IndexExpression) { |
| 1118 // Nothing to validate. | 1119 // Nothing to validate. |
| 1119 } else if (n is AwaitExpression) { | 1120 } else if (n is AwaitExpression) { |
| 1120 _validateTopLevelInitializer(name, n.expression); | 1121 _validateTopLevelInitializer(name, n.expression); |
| 1121 } else if (n is ThrowExpression) { | 1122 } else if (n is ThrowExpression) { |
| 1122 // Nothing to validate. | 1123 // Nothing to validate. |
| 1123 } else if (n is ParenthesizedExpression) { | 1124 } else if (n is ParenthesizedExpression) { |
| 1124 _validateTopLevelInitializer(name, n.expression); | 1125 _validateTopLevelInitializer(name, n.expression); |
| 1125 } else if (n is ConditionalExpression) { | 1126 } else if (n is ConditionalExpression) { |
| 1126 _validateTopLevelInitializer(name, n.thenExpression); | 1127 _validateTopLevelInitializer(name, n.thenExpression); |
| 1127 _validateTopLevelInitializer(name, n.elseExpression); | 1128 _validateTopLevelInitializer(name, n.elseExpression); |
| (...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1564 var visited = new Set<InterfaceType>(); | 1565 var visited = new Set<InterfaceType>(); |
| 1565 do { | 1566 do { |
| 1566 visited.add(current); | 1567 visited.add(current); |
| 1567 current.mixins.reversed.forEach( | 1568 current.mixins.reversed.forEach( |
| 1568 (m) => _checkIndividualOverridesFromClass(node, m, seen, true)); | 1569 (m) => _checkIndividualOverridesFromClass(node, m, seen, true)); |
| 1569 _checkIndividualOverridesFromClass(node, current.superclass, seen, true); | 1570 _checkIndividualOverridesFromClass(node, current.superclass, seen, true); |
| 1570 current = current.superclass; | 1571 current = current.superclass; |
| 1571 } while (!current.isObject && !visited.contains(current)); | 1572 } while (!current.isObject && !visited.contains(current)); |
| 1572 } | 1573 } |
| 1573 } | 1574 } |
| OLD | NEW |