Index: pkg/analyzer/lib/src/fasta/element_store.dart |
diff --git a/pkg/analyzer/lib/src/fasta/element_store.dart b/pkg/analyzer/lib/src/fasta/element_store.dart |
index 8d90278471a5d78ae013a6ced8d4164fbb332683..c6a1049bb5dbdbbba37df03c3338bdd2b176f55f 100644 |
--- a/pkg/analyzer/lib/src/fasta/element_store.dart |
+++ b/pkg/analyzer/lib/src/fasta/element_store.dart |
@@ -75,7 +75,7 @@ class ElementStoreImplementation implements ElementStore { |
KernelLibraryElement element = new KernelLibraryElement(unit); |
elements[library] = element; |
unit.library = element; |
- library.members.forEach((String name, Builder builder) { |
+ library.forEach((String name, Builder builder) { |
do { |
if (builder is ClassBuilder) { |
elements[builder] = new KernelClassElement(builder); |
@@ -105,12 +105,9 @@ class ElementStoreImplementation implements ElementStore { |
Constructor getCoreClassConstructorReference(String className, |
{String constructorName, String library}) { |
assert(library == null); |
- KernelClassBuilder cls = coreLibrary.members[className]; |
- Constructor constructor = constructorName == null |
- ? cls.cls.constructors.first |
- : cls.cls.constructors |
- .firstWhere((Constructor c) => c.name.name == constructorName); |
- return constructor; |
+ return coreLibrary |
+ .getConstructor(className, constructorName: constructorName) |
+ .target; |
} |
Library getLibraryReference(LibraryElement element) { |