@@ -100,8 +100,6 @@ findSuitableWrapperInit(ASTContext &ctx, NominalTypeDecl *nominal,
100
100
Inaccessible,
101
101
};
102
102
103
- auto valueVarType = valueVar->getValueInterfaceType ();
104
-
105
103
SmallVector<std::tuple<ConstructorDecl *, NonViableReason, Type>, 2 >
106
104
nonviable;
107
105
SmallVector<ConstructorDecl *, 2 > viableInitializers;
@@ -183,7 +181,7 @@ findSuitableWrapperInit(ASTContext &ctx, NominalTypeDecl *nominal,
183
181
184
182
// The parameter type must be the same as the type of `valueVar` or an
185
183
// autoclosure thereof.
186
- if (!paramType->isEqual (valueVarType )) {
184
+ if (!paramType->isEqual (valueVar-> getValueInterfaceType () )) {
187
185
nonviable.push_back (std::make_tuple (
188
186
init, NonViableReason::ParameterTypeMismatch, paramType));
189
187
continue ;
@@ -214,7 +212,8 @@ findSuitableWrapperInit(ASTContext &ctx, NominalTypeDecl *nominal,
214
212
215
213
case NonViableReason::ParameterTypeMismatch:
216
214
init->diagnose (diag::property_wrapper_wrong_initial_value_init,
217
- init->getFullName (), paramType, valueVarType);
215
+ init->getFullName (), paramType,
216
+ valueVar->getValueInterfaceType ());
218
217
valueVar->diagnose (diag::decl_declared_here, valueVar->getFullName ());
219
218
break ;
220
219
}
0 commit comments