mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
AST: Give all ValueDecls an interface type
Previously, getInterfaceType() would return getType() if no interface type was set. Instead, always set an interface type explicitly. Eventually we want to remove getType() altogether, and this brings us one step closer to this goal. Note that ParamDecls are excempt from this treatment, because they don't have a proper interface type yet. Cleaning this up requires more effort.
This commit is contained in:
@@ -84,6 +84,7 @@ void BuiltinUnit::LookupCache::lookupValue(
|
||||
/*genericparams*/nullptr,
|
||||
const_cast<BuiltinUnit*>(&M));
|
||||
TAD->computeType();
|
||||
TAD->setInterfaceType(TAD->getType());
|
||||
TAD->setAccessibility(Accessibility::Public);
|
||||
Entry = TAD;
|
||||
}
|
||||
@@ -346,6 +347,7 @@ ModuleDecl::ModuleDecl(Identifier name, ASTContext &ctx)
|
||||
ctx.addDestructorCleanup(*this);
|
||||
setImplicit();
|
||||
setType(ModuleType::get(this));
|
||||
setInterfaceType(ModuleType::get(this));
|
||||
setAccessibility(Accessibility::Public);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user