@@ -296,14 +296,14 @@ bool SILModule::isTypeMetadataForLayoutAccessible(SILType type) {
296296 return ::isTypeMetadataForLayoutAccessible (*this , type);
297297}
298298
299- static bool isUnsupportedKeyPathValueType (Type ty, GenericEnvironment *env ) {
299+ static bool isUnsupportedKeyPathValueType (Type ty) {
300300 // Visit lowered positions.
301301 if (auto tupleTy = ty->getAs <TupleType>()) {
302302 for (auto eltTy : tupleTy->getElementTypes ()) {
303303 if (eltTy->is <PackExpansionType>())
304304 return true ;
305305
306- if (isUnsupportedKeyPathValueType (eltTy, env ))
306+ if (isUnsupportedKeyPathValueType (eltTy))
307307 return true ;
308308 }
309309
@@ -321,19 +321,19 @@ static bool isUnsupportedKeyPathValueType(Type ty, GenericEnvironment *env) {
321321 if (paramTy->is <PackExpansionType>())
322322 return true ;
323323
324- if (isUnsupportedKeyPathValueType (paramTy, env ))
324+ if (isUnsupportedKeyPathValueType (paramTy))
325325 return true ;
326326 }
327327
328- if (isUnsupportedKeyPathValueType (funcTy->getResult (), env ))
328+ if (isUnsupportedKeyPathValueType (funcTy->getResult ()))
329329 return true ;
330330 }
331331
332332 // Noncopyable types aren't supported by key paths in their current form.
333333 // They would also need a new ABI that's yet to be implemented in order to
334334 // be properly supported, so let's suppress the descriptor for now if either
335335 // the container or storage type of the declaration is non-copyable.
336- if (ty->isNoncopyable (env ))
336+ if (ty->isNoncopyable ())
337337 return true ;
338338
339339 return false ;
@@ -398,8 +398,9 @@ bool AbstractStorageDecl::exportsPropertyDescriptor() const {
398398 llvm_unreachable (" should be definition linkage?" );
399399 }
400400
401- auto *env = getDeclContext ()->getGenericEnvironmentOfContext ();
402- if (isUnsupportedKeyPathValueType (getValueInterfaceType (), env)) {
401+ auto typeInContext = getInnermostDeclContext ()->mapTypeIntoContext (
402+ getValueInterfaceType ());
403+ if (isUnsupportedKeyPathValueType (typeInContext)) {
403404 return false ;
404405 }
405406
0 commit comments