Commit Graph

4 Commits

Author SHA1 Message Date
Slava Pestov
2686ce37bb AST: Hack around edge case due to broken abstract conformance representation
A substitution map might store an abstract conformance even if the
replacement type is an archetype that conforms concretely via a
superclass requirement.

This is because when we build the substitution map, if the archetype
is represented by a type parameter, we don't have enough information
to know if it will conform abstractly or concretely.
2022-07-29 11:59:17 -04:00
Slava Pestov
9ec80df97e SIL: Remove curried SILDeclRefs 2020-03-19 02:20:21 -04:00
Slava Pestov
377d22e757 SILGen: Use the correct generic environment in vtable thunks
Make sure we use the generic environment derived from the
generic signature of the vtable thunk itself, which can now
be different than the generic signature of the derived
method.

This allows vtable thunks that re-abstract generic requirements
to lower all the way through to IRGen.
2020-01-08 22:19:15 -05:00
Slava Pestov
652f8ee95b SIL: VTable thunks should use the 'override generic signature'
We recently added some checking to ensure that a method override's
generic signature does not have any generic requirements not
satisfied by the base method.

Loosening requirements in the other direction was allowed, because
it means the derived method can be called on potentially more types
than the base method.

However, if the generic signatures don't match, a thunk must be
emitted. While we correctly determined whether a thunk should be
emitted, the thunk had the wrong generic signature, and therefore
the wrong calling convention, which would cause crashes at runtime.

Fixes <rdar://problem/57429775>.
2020-01-08 22:19:15 -05:00