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

Side by Side Diff: pkg/analyzer/lib/src/generated/resolver.dart

Issue 1081233002: Issue 23190. Type check with a function type alias is its usage. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/resolver_test.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) 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; 5 library engine.resolver;
6 6
7 import "dart:math" as math; 7 import "dart:math" as math;
8 import 'dart:collection'; 8 import 'dart:collection';
9 9
10 import 'package:analyzer/src/generated/utilities_collection.dart'; 10 import 'package:analyzer/src/generated/utilities_collection.dart';
(...skipping 4548 matching lines...) Expand 10 before | Expand all | Expand 10 after
4559 } 4559 }
4560 // ignore references to an element from itself 4560 // ignore references to an element from itself
4561 if (identical(element, _enclosingClass)) { 4561 if (identical(element, _enclosingClass)) {
4562 return; 4562 return;
4563 } 4563 }
4564 if (identical(element, _enclosingExec)) { 4564 if (identical(element, _enclosingExec)) {
4565 return; 4565 return;
4566 } 4566 }
4567 // ignore places where the element is not actually used 4567 // ignore places where the element is not actually used
4568 if (node.parent is TypeName) { 4568 if (node.parent is TypeName) {
4569 AstNode parent2 = node.parent.parent; 4569 if (element is ClassElement) {
4570 if (parent2 is IsExpression) { 4570 AstNode parent2 = node.parent.parent;
4571 return; 4571 if (parent2 is IsExpression) {
4572 } 4572 return;
4573 // We need to instantiate/extend/implement a class to actually use it. 4573 }
4574 // OTOH, function type aliases are used to define closure structures. 4574 if (parent2 is VariableDeclarationList) {
4575 if (parent2 is VariableDeclarationList && element is ClassElement) { 4575 return;
4576 return; 4576 }
4577 } 4577 }
4578 } 4578 }
4579 // OK 4579 // OK
4580 usedElements.addElement(element); 4580 usedElements.addElement(element);
4581 } 4581 }
4582 4582
4583 static bool _isReadIdentifier(SimpleIdentifier node) { 4583 static bool _isReadIdentifier(SimpleIdentifier node) {
4584 // not reading at all 4584 // not reading at all
4585 if (!node.inGetterContext()) { 4585 if (!node.inGetterContext()) {
4586 return false; 4586 return false;
(...skipping 10822 matching lines...) Expand 10 before | Expand all | Expand 10 after
15409 nonFields.add(node); 15409 nonFields.add(node);
15410 return null; 15410 return null;
15411 } 15411 }
15412 15412
15413 @override 15413 @override
15414 Object visitNode(AstNode node) => node.accept(TypeResolverVisitor_this); 15414 Object visitNode(AstNode node) => node.accept(TypeResolverVisitor_this);
15415 15415
15416 @override 15416 @override
15417 Object visitWithClause(WithClause node) => null; 15417 Object visitWithClause(WithClause node) => null;
15418 } 15418 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/resolver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698