[Property wrappers] Make sure to canonicalize a type properly in DI.

Fixes a crash/assertion involving sugared types rdar://problem/51581937.
This commit is contained in:
Doug Gregor
2019-06-25 08:53:44 -07:00
parent 7d0357c7b5
commit c0bb33483d
2 changed files with 20 additions and 1 deletions

View File

@@ -1412,7 +1412,8 @@ namespace {
SGF.getModule().getSwiftModule(), ctor);
Type ity = ctor->getInterfaceType();
AnyFunctionType *substIty = ity.subst(subs)->castTo<AnyFunctionType>();
AnyFunctionType *substIty =
ity.subst(subs)->getCanonicalType()->castTo<AnyFunctionType>();
auto initRef = SILDeclRef(ctor, SILDeclRef::Kind::Allocator)
.asForeign(requiresForeignEntryPoint(ctor));