Files
swift-mirror/test/decl/protocol
Slava Pestov 52e3031bce Sema: Fancier handling of associated type defaults
Consider this code:

    protocol P {
      associatedtype A
      ...
    }

    protocol Q: P {
      associatedtype A = Int
      ...
    }

    struct S: Q {
      ...
    }

If we check the [S: Q] conformance first, we get the right type witness
assignment, but if we check [S: P] first, conformance checking fails.

Instead of looking at an associated type declaration and any associated
types that it overrides, we now look through all associated types with the
same name among the protocols the adoptee conforms to. This allows us to
find the default assignment 'A = Int' from Q regardless of request
evaluation order.

Fixes rdar://problem/119052782.
2023-12-06 14:59:19 -05:00
..
2023-09-11 23:56:38 -07:00