mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
When SILGenWitnessTable creates a decl ref for the witness of a derivative function requirement, it is using the requirement's derivative generic signature in the resulting witness decl ref. This is wrong because the witness may have a different derivative generic signature than the requirement, leading to a crash. This bug was never discovered because GSB's dark magic made it "just work", until requirement machine. The fix is to store the matched witness derivative generic signature in `Witness` during type checking, and during witness table generation, use the witness' generic signature to create a witness decl ref. Resolves rdar://84716758, rdar://84213107 and rdar://84987079.
59 KiB
59 KiB