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 1570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1581 } | 1581 } |
1582 | 1582 |
1583 /// If node is a [ClassDeclaration] returns its members, otherwise if node is | 1583 /// If node is a [ClassDeclaration] returns its members, otherwise if node is |
1584 /// a [ClassTypeAlias] this returns an empty list. | 1584 /// a [ClassTypeAlias] this returns an empty list. |
1585 Iterable<ClassMember> _classMembers(Declaration node) { | 1585 Iterable<ClassMember> _classMembers(Declaration node) { |
1586 return node is ClassDeclaration ? node.members : []; | 1586 return node is ClassDeclaration ? node.members : []; |
1587 } | 1587 } |
1588 | 1588 |
1589 /// If node is a [ClassDeclaration] returns its members, otherwise if node is | 1589 /// If node is a [ClassDeclaration] returns its members, otherwise if node is |
1590 /// a [ClassTypeAlias] this returns an empty list. | 1590 /// a [ClassTypeAlias] this returns an empty list. |
| 1591 AstNode _extendsErrorLocation(Declaration node) { |
| 1592 return node is ClassDeclaration |
| 1593 ? node.extendsClause |
| 1594 : (node as ClassTypeAlias).superclass; |
| 1595 } |
| 1596 |
| 1597 /// If node is a [ClassDeclaration] returns its members, otherwise if node is |
| 1598 /// a [ClassTypeAlias] this returns an empty list. |
1591 WithClause _withClause(Declaration node) { | 1599 WithClause _withClause(Declaration node) { |
1592 return node is ClassDeclaration | 1600 return node is ClassDeclaration |
1593 ? node.withClause | 1601 ? node.withClause |
1594 : (node as ClassTypeAlias).withClause; | 1602 : (node as ClassTypeAlias).withClause; |
1595 } | 1603 } |
1596 | |
1597 /// If node is a [ClassDeclaration] returns its members, otherwise if node is | |
1598 /// a [ClassTypeAlias] this returns an empty list. | |
1599 AstNode _extendsErrorLocation(Declaration node) { | |
1600 return node is ClassDeclaration | |
1601 ? node.extendsClause | |
1602 : (node as ClassTypeAlias).superclass; | |
1603 } | |
1604 } | 1604 } |
OLD | NEW |