| Index: runtime/vm/parser.cc
|
| ===================================================================
|
| --- runtime/vm/parser.cc (revision 45377)
|
| +++ runtime/vm/parser.cc (working copy)
|
| @@ -11346,18 +11346,16 @@
|
| }
|
| }
|
| // The referenced class may not have been parsed yet. It would be wrong
|
| - // to resolve it too early to an imported class of the same name.
|
| + // to resolve it too early to an imported class of the same name. Only
|
| + // resolve the class when a finalized type is requested.
|
| if (finalization > ClassFinalizer::kResolveTypeParameters) {
|
| - // Resolve classname in the scope of the current library.
|
| - resolved_type_class = ResolveClassInCurrentLibraryScope(
|
| - unresolved_class_name);
|
| + resolved_type_class = library_.LookupClass(unresolved_class_name);
|
| }
|
| } else {
|
| - LibraryPrefix& lib_prefix =
|
| + // Resolve class name in the scope of the library prefix.
|
| + const LibraryPrefix& lib_prefix =
|
| LibraryPrefix::Handle(Z, unresolved_class.library_prefix());
|
| - // Resolve class name in the scope of the library prefix.
|
| - resolved_type_class =
|
| - ResolveClassInPrefixScope(lib_prefix, unresolved_class_name);
|
| + resolved_type_class = lib_prefix.LookupClass(unresolved_class_name);
|
| }
|
| // At this point, we can only have a parameterized_type.
|
| const Type& parameterized_type = Type::Cast(*type);
|
| @@ -11713,16 +11711,6 @@
|
| }
|
|
|
|
|
| -RawClass* Parser::ResolveClassInCurrentLibraryScope(const String& name) {
|
| - HANDLESCOPE(I);
|
| - const Object& obj = Object::Handle(Z, library_.ResolveName(name));
|
| - if (obj.IsClass()) {
|
| - return Class::Cast(obj).raw();
|
| - }
|
| - return Class::null();
|
| -}
|
| -
|
| -
|
| // Resolve an identifier by checking the global scope of the current
|
| // library. If not found in the current library, then look in the scopes
|
| // of all libraries that are imported without a library prefix.
|
| @@ -11764,17 +11752,6 @@
|
| }
|
|
|
|
|
| -RawClass* Parser::ResolveClassInPrefixScope(const LibraryPrefix& prefix,
|
| - const String& name) {
|
| - HANDLESCOPE(I);
|
| - const Object& obj = Object::Handle(Z, prefix.LookupObject(name));
|
| - if (obj.IsClass()) {
|
| - return Class::Cast(obj).raw();
|
| - }
|
| - return Class::null();
|
| -}
|
| -
|
| -
|
| // Do a lookup for the identifier in the scope of the specified
|
| // library prefix. This means trying to resolve it locally in all of the
|
| // libraries present in the library prefix.
|
|
|