Track implicit imports differently from user imports
IBase is imported implicitly, so is types. They should be reflected as
such.
Fixes: 134584967
Test: ./test/run_all_*_tests.sh
Change-Id: Iebabc89ac78a4f259d3c44bab0dc21b5bb0f1560
diff --git a/AST.h b/AST.h
index d570589..47f0846 100644
--- a/AST.h
+++ b/AST.h
@@ -55,6 +55,7 @@
bool setPackage(const char *package);
bool addImport(const char* import, const Location& location);
+ bool addImplicitImport(const FQName& fqName);
// package and version really.
FQName package() const;
@@ -240,6 +241,9 @@
// A list of the FQNames present in the import statements
std::vector<ImportStatement> mImportStatements;
+ // A list of FQNames that are imported implicitly
+ std::vector<FQName> mImplicitImports;
+
// A set of all external interfaces/types that are _actually_ referenced
// in this AST, this is a subset of those specified in import statements.
// Note that this set only resolves to the granularity of either an
@@ -272,6 +276,9 @@
std::set<FQName> mReferencedTypeNames;
+ // importFQName will try to import fqName by parsing any file that might contain it
+ bool importFQName(const FQName& fqName);
+
// Helper functions for lookupType.
Type* lookupTypeLocally(const FQName& fqName, Scope* scope);
status_t lookupAutofilledType(const FQName &fqName, Type **returnedType);