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-7786] Misleading diagnostics #50325

Closed
jepers opened this issue May 26, 2018 · 2 comments
Closed

[SR-7786] Misleading diagnostics #50325

jepers opened this issue May 26, 2018 · 2 comments
Assignees
Labels
compiler The Swift compiler in itself diagnostics QoI Bug: Diagnostics Quality of Implementation improvement type checker Area → compiler: Semantic analysis

Comments

@jepers
Copy link

jepers commented May 26, 2018

Previous ID SR-7786
Radar None
Original Reporter @jepers
Type Improvement
Status Closed
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Improvement, DiagnosticsQoI, TypeChecker
Assignee @medismailben
Priority Medium

md5: e1a8805a84d3c088a3a3f44187e02fea

Issue Description:

The context in which I encountered this issue can be seen in this forums post.

Here's a reduced example program that demonstrates the same issue:

struct S {
    func foo() -> UInt { return 0 }
    func foo<T: UnsignedInteger>(bar: T) -> T {
        return bar
    }
}

let s = S()
let a = s.foo() // OK
let b = s.foo(bar: 123) // ERR: Argument passed to call that takes no arguments
let c: UInt = s.foo(bar: 123) // OK
let d = s.foo(bar: 123 as UInt) // OK

I see this using Xcode 9.3.1, default toolchain and recent dev snapshot (2018-05-22).

@belkadan
Copy link
Contributor

cc @xedin

@swift-ci
Copy link
Collaborator

Comment by Ding Ye (JIRA)

Resolved in #17093

Thanks to Pavel Yaskevich.

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

No branches or pull requests

3 participants