[SR-10752] Trouble with Generic Constraints and Associated Types #53142
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
type checker
Area → compiler: Semantic analysis
Environment
Swift 5.1
Additional Detail from JIRA
md5: 9d6ac07735765d370875cf592220ea2b
is duplicated by:
Issue Description:
Given the following parser type:
I can define the following parse function from
inout Substring
:I'd preferably like to work more generically on any
Collection
, but the following doesn't compile.The error is puzzling, but it seems to be that Swift isn't considering the
I
generic andC.SubSequence
equivalent, despite thewhere
clause.We can force-cast our way to another error:
But now we're stuck.
I
is constrained toCollection
but it doesn't seem to think it hasisEmpty
as a member.The text was updated successfully, but these errors were encountered: