Commits

Slava Pestov committed 3aacf5d8057
ArchetypeBuilder: Allow generic signature superclass constraints to contain type parameters There was a diagnostic to catch these, but it wasn't triggered reliably, and it sounds like users were already relying on this feature working in the few cases where it did. So instead, just map an archetype's superclass into context when building the archetype. Recursion is still not allowed and is diagnosed, for example <T, U where T : C<U>, U : C<T>>. Note that compiler_crashers_fixed/00022-no-stacktrace.swift no longer produces a diagnostic in Sema, despite the fact that the code is invalid. It does diagnose in IRGen when we map the type into context. Diagnosing in Sema requires fixing the declaration checker to correctly handle recursion through a generic signature. Right now, if recursion is detected, we bail out, but do not always diagnose. Alternatively, we could prohibit unbound generic types from appearing in generic signatures. This is a more principled fix for rdar://problem/24590570.