Files
swift-mirror/lib/IRGen/Fulfillment.cpp
Slava Pestov 1adfad0df2 IRGen: Terrible workaround for problem in searchNominalTypeMetadata()
This fixes a regression introduced by e3c8f423bc,
but the root cause was actually a subtle invariant violation
in IRGen.

FulfillmentMap's use of canonical types as keys assumes that
canonical type equality is sufficient for checking if two types
"are the same". However, this is not true when those types
contain type parameters, because two distinct type parameters
might belong to the same equivalence class.

Thus, when we take the type's context substitution map, and
apply it to each type parameter in our given list of
requirements, the substitution operation could output a
different but equivalent type parameter.

As a workaround for this problem, try to preserve the old
behavior of subst() in this specific case.

Fixes rdar://160649141.
2025-11-07 18:26:30 -05:00

20 KiB