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-9396] Nonsensical error message related to constrained extensions #51862

Closed
jepers opened this issue Dec 1, 2018 · 2 comments
Closed

[SR-9396] Nonsensical error message related to constrained extensions #51862

jepers opened this issue Dec 1, 2018 · 2 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself diagnostics QoI Bug: Diagnostics Quality of Implementation type checker Area → compiler: Semantic analysis

Comments

@jepers
Copy link

jepers commented Dec 1, 2018

Previous ID SR-9396
Radar rdar://problem/46427500
Original Reporter @jepers
Type Bug
Status Closed
Resolution Done
Environment

Xcode 10.1 (10B61)

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, DiagnosticsQoI, TypeChecker
Assignee @jepers
Priority Medium

md5: 967601040ef8513ec74f112ccc075a97

relates to:

  • SR-7046 Autocomplete suggests methods that can't be called on certain instances

Issue Description:

Apart from the possibly related bug (see linked issues) which makes members added in all extensions show up in the list of code completions, selecting one of those invalid code completions and compiling results in a rather strange error message:

struct Thing<Foo, Bar> {
    func methodOnAllThings() {}
}

extension Thing where Foo == Int {
    func methodOnThingsWhereFooIsInt() {}
}

extension Thing where Foo == Bool {
    func methodOnThingsWhereFooIsBool() {}
}

func test() {
    
    let thing = Thing<Int, Double>()
    
    thing.methodOnThingsWhereFooIsBool() // ERROR: Generic parameter 'Bar'
                                         //        could not be inferred
    
}
test()
@belkadan
Copy link
Contributor

belkadan commented Dec 3, 2018

cc @xedin

@xedin
Copy link
Member

xedin commented May 29, 2019

Fixed by #25053

Please verify using the next available nightly build of the master.

@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 diagnostics QoI Bug: Diagnostics Quality of Implementation type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

3 participants