Files
swift-mirror/validation-test/compiler_crashers_2_fixed/0163-sr8033.swift
Huon Wilson a21a7798d8 [Sema] Be more resilient about unavailable conditional requirements in error cases.
When we're trying to diagnose something, it's a bad look if we crash
instead. This changes the bad-associated-type recovery path to not require that
the conditional requirements have been computed, and instead detects that as a
possible error.

Fixes https://bugs.swift.org/browse/SR-8033.
2018-06-21 10:53:30 +10:00

10 lines
379 B
Swift

// RUN: %target-typecheck-verify-swift
struct Foo<T> {}
protocol P1 {
associatedtype A // expected-note {{protocol requires nested type 'A'; do you want to add it?}}
}
extension Foo: P1 where A : P1 {} // expected-error {{unsupported recursion for reference to associated type 'A' of type 'Foo<T>'}}
// expected-error@-1 {{type 'Foo<T>' does not conform to protocol 'P1'}}