Skip to content

Commit 4038781

Browse files
committed
SIL: Resolve interface types when lowering constant info
This is just a stop-gap until getInterfaceType() becomes a request.
1 parent 83a3bd2 commit 4038781

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/SIL/TypeLowering.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "swift/AST/DiagnosticsSIL.h"
2020
#include "swift/AST/Expr.h"
2121
#include "swift/AST/GenericEnvironment.h"
22+
#include "swift/AST/LazyResolver.h"
2223
#include "swift/AST/Module.h"
2324
#include "swift/AST/NameLookup.h"
2425
#include "swift/AST/Pattern.h"
@@ -1900,6 +1901,10 @@ TypeConverter::getFunctionInterfaceTypeWithCaptures(CanAnyFunctionType funcType,
19001901
CanAnyFunctionType TypeConverter::makeConstantInterfaceType(SILDeclRef c) {
19011902
auto *vd = c.loc.dyn_cast<ValueDecl *>();
19021903

1904+
if (vd && !vd->hasInterfaceType()) {
1905+
Context.getLazyResolver()->resolveDeclSignature(vd);
1906+
}
1907+
19031908
switch (c.kind) {
19041909
case SILDeclRef::Kind::Func: {
19051910
if (auto *ACE = c.loc.dyn_cast<AbstractClosureExpr *>()) {

0 commit comments

Comments
 (0)