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

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

Issue 2376463002: Issue 25706. Fix for resolving '@prefix.ClassName.staticVariable.'. (Closed)
Patch Set: Created 4 years, 2 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/test/generated/element_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 analyzer.src.generated.element_resolver; 5 library analyzer.src.generated.element_resolver;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/ast/syntactic_entity.dart'; 10 import 'package:analyzer/dart/ast/syntactic_entity.dart';
(...skipping 1973 matching lines...) Expand 10 before | Expand all | Expand 10 after
1984 if (nameNode1 != null && nameNode2 != null && nameNode3 != null) { 1984 if (nameNode1 != null && nameNode2 != null && nameNode3 != null) {
1985 Element element2 = nameNode2.staticElement; 1985 Element element2 = nameNode2.staticElement;
1986 // element2 should be ClassElement 1986 // element2 should be ClassElement
1987 if (element2 is ClassElement) { 1987 if (element2 is ClassElement) {
1988 String name3 = nameNode3.name; 1988 String name3 = nameNode3.name;
1989 // prefix.Class.CONST 1989 // prefix.Class.CONST
1990 PropertyAccessorElement getter = 1990 PropertyAccessorElement getter =
1991 element2.lookUpGetter(name3, _definingLibrary); 1991 element2.lookUpGetter(name3, _definingLibrary);
1992 if (getter != null) { 1992 if (getter != null) {
1993 nameNode3.staticElement = getter; 1993 nameNode3.staticElement = getter;
1994 annotation.element = element2; 1994 annotation.element = getter;
1995 _resolveAnnotationElementGetter(annotation, getter); 1995 _resolveAnnotationElementGetter(annotation, getter);
1996 return; 1996 return;
1997 } 1997 }
1998 // prefix.Class.constructor(args) 1998 // prefix.Class.constructor(args)
1999 constructor = new InterfaceTypeImpl(element2) 1999 constructor = new InterfaceTypeImpl(element2)
2000 .lookUpConstructor(name3, _definingLibrary); 2000 .lookUpConstructor(name3, _definingLibrary);
2001 nameNode3.staticElement = constructor; 2001 nameNode3.staticElement = constructor;
2002 } 2002 }
2003 } 2003 }
2004 // we need constructor 2004 // we need constructor
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after
2638 2638
2639 @override 2639 @override
2640 Element get staticElement => null; 2640 Element get staticElement => null;
2641 2641
2642 @override 2642 @override
2643 dynamic/*=E*/ accept/*<E>*/(AstVisitor/*<E>*/ visitor) => null; 2643 dynamic/*=E*/ accept/*<E>*/(AstVisitor/*<E>*/ visitor) => null;
2644 2644
2645 @override 2645 @override
2646 void visitChildren(AstVisitor visitor) {} 2646 void visitChildren(AstVisitor visitor) {}
2647 } 2647 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/element_resolver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698