mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Sema: Ban protocol where clauses that place constraints on 'Self'
These will never work properly because of phase ordering issues with the current declaration checker design. Since we can always express the same thing with the protocol inheritance clause instead, just diagnose this as an error instead of trying to hack around it. Fixes <rdar://problem/38077232>, <https://bugs.swift.org/browse/SR-5581>.
This commit is contained in:
@@ -1833,6 +1833,10 @@ WARNING(protocol_composition_with_postfix,none,
|
||||
"protocol-constrained type with postfix '%0' is ambiguous "
|
||||
"and will be rejected in future version of Swift", (StringRef))
|
||||
|
||||
ERROR(protocol_where_clause_self_requirement,none,
|
||||
"constraint with subject type of 'Self' is not supported; "
|
||||
"consider adding requirement to protocol inheritance clause instead", ())
|
||||
|
||||
ERROR(invalid_protocol_composition_member,none,
|
||||
"non-protocol, non-class type %0 cannot be used within a "
|
||||
"protocol-constrained type", (Type))
|
||||
|
||||
Reference in New Issue
Block a user