Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-14285] Generic typealiases don't constrain their known types in extensions #56644

Open
hartbit opened this issue Feb 28, 2021 · 1 comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@hartbit
Copy link
Collaborator

hartbit commented Feb 28, 2021

Previous ID SR-14285
Radar rdar://problem/74876586
Original Reporter @hartbit
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug
Assignee None
Priority Medium

md5: 45637aa4240ad1b88bdac3d67539c4b1

Issue Description:

I would expect the following code to compile and to define a secondUppercased property on all Tuple where the U type is a String.

struct Tuple<T, U> {
    let first: T
    let second: U
}

extension Tuple where U == String {
    var secondLowercased: String {
        second.lowercased()
    }
}

typealias TupleString<T> = Tuple<T, String>

extension TupleString {
    var secondUppercased: String {
        second.uppercased()
    }
}
@typesanitizer
Copy link

@swift-ci create

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself
Projects
None yet
Development

No branches or pull requests

2 participants