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-10434] Associated Type not recognized in convenience initializer #52834

Closed
swift-ci opened this issue Apr 9, 2019 · 3 comments
Closed

[SR-10434] Associated Type not recognized in convenience initializer #52834

swift-ci opened this issue Apr 9, 2019 · 3 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself regression swift 5.0 type checker Area → compiler: Semantic analysis

Comments

@swift-ci
Copy link
Collaborator

swift-ci commented Apr 9, 2019

Previous ID SR-10434
Radar rdar://49779783
Original Reporter ferranpujolcamins (JIRA User)
Type Bug
Status Resolved
Resolution Done
Environment

Xcode 10.2 swift 5

macOS 10.14.4

Additional Detail from JIRA
Votes 1
Component/s Compiler
Labels Bug, 5.0Regression, TypeChecker
Assignee None
Priority Medium

md5: ba5789f6340c0af044d6b9487a5ed3b9

Issue Description:

The following snippet builds in Swift 4.2, but fails to build in Swift 5, with the error described in the comment:

protocol AProtocol {
    associatedtype V
    func a(_ v: V)
}

extension AProtocol {
    func v(_ v: V) {}
}

class AClass<V>: AProtocol {
    func a(_ v: V) {} 

    init() {}

    convenience init(_ w: V) {
        self.init()
        v(w) // Cannot convert value of type 'V' to expected argument type 'Self.V'
    }
    
    init(_ w: V, _ w2: V) {
        v(w) // This works
    }
}
@belkadan
Copy link
Contributor

Weird. @slavapestov, @xedin, any idea what's going wrong?

@slavapestov
Copy link
Member

That's really odd. Nothing comes to mind, but one of us should take a look.

@slavapestov
Copy link
Member

#24062

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
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 regression swift 5.0 type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

4 participants