[SR-5440] Typealias in constrained extension misinterprets the where clause #48014
Labels
accepts invalid
Bug: Accepts invalid
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
Additional Detail from JIRA
md5: 64a011da616f479d8c228dd46791be39
relates to:
Issue Description:
The following seemingly invalid program compiles ( ! ), and the result is the same as if the where-clauses had been removed, so it seems like typealiases added in constrained extensions ignores the constraint:
The same is true when using a protocol instead of a struct:
UPDATE:
As the following program shows, it seems like the where-clause is actually misinterpreted rather than ignored:
Note: I have only used (a single) same-type constraint (eg A == Float) in the where-clause here, but there are similar problems when constraining to protocol types (eg A: FloatingPoint).
Tested in Xcode 9 beta 3, same behavior in default toolchain and dev snapshot 2017-07-12.
The text was updated successfully, but these errors were encountered: