mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Yield types are not represented in the AST FunctionType, so when we compute the lowered type of a witness thunk for a 'modify' or 'read' coroutine, we have to compute the yield type from scratch. We do this by applying the witness substitutions computed by Sema to the storage type, and then canonicalizing the resulting substituted type with respect to the storage's own generic signature. However, the right hand sides of the witness substitutions are written with respect to the conformance context, which might be a subclass of the class that the storage is originally defined in. By not using the generic signature of this subclass, we could miss associated types of generic parameters of the base class which were made concrete in the subclass using a 'where' clause. Instead, let's pass down the generic signature of the witness thunk, ensuring we always compute the correct canonical type. Fixes rdar://problem/77737914.
1.5 KiB
1.5 KiB