You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SR-12817 Nested generic typealias extensions apply to the parent type.
Issue Description:
First, some code that does what I would expect:
structGeneric<T> {}
typealiasSpecific = Generic<Int>
extensionGeneric {
funcidentify() { print("Any T") }
}
extensionSpecific {
funcidentify() { print("T is Int") }
}
Generic<String>().identify() // Any TGeneric<Int>().identify() // T is IntSpecific().identify() // T is Int
From this, it seems as if "extension Specific" is correctly interpreted as "extension Generic where T == Int".
However, the mechanism does not seem to generalize properly to typealiases that have only partial constraints:
This error seems to suggest that "extension Specific" is interpreted identically to "extension Generic". The fact that Specific is Generic<_, Int> seems to have gotten lost.
Is this the intended behavior?
The text was updated successfully, but these errors were encountered:
Environment
This is in Swift 5.3, Xcode 12 beta.
Additional Detail from JIRA
md5: 4d67a947e489e53e7164a59f491d1ee0
duplicates:
Issue Description:
First, some code that does what I would expect:
From this, it seems as if "extension Specific" is correctly interpreted as "extension Generic where T == Int".
However, the mechanism does not seem to generalize properly to typealiases that have only partial constraints:
This error seems to suggest that "extension Specific" is interpreted identically to "extension Generic". The fact that Specific is Generic<_, Int> seems to have gotten lost.
Is this the intended behavior?
The text was updated successfully, but these errors were encountered: