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-5245] Another useless diagnostic for very simple code: "Type of expression is ambiguous without more context" #47820

Closed
NachoSoto opened this issue Jun 16, 2017 · 4 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

@NachoSoto
Copy link
Contributor

Previous ID SR-5245
Radar None
Original Reporter @NachoSoto
Type Bug
Status Resolved
Resolution Done
Environment

Apple Swift version 3.1 (swiftlang-802.0.53 clang-802.0.42)
Apple Swift version 4.0 (swiftlang-900.0.43 clang-900.0.22.8)

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

md5: 91bcff9295eaeab22708509ad1a55a7b

Issue Description:

Simple type definitions:

class C {
    struct S {
        enum E {
            case e1
            case e2
        }

        let e: [E]
    }

    init(s: S) {}
}

Call constructor with the wrong argument label f instead of e:

C(s: C.S(f: [.e1, .e2]))
error: repl.swift:14:13: error: type of expression is ambiguous without more context
C(s: C.S(f: [.e1, .e2]))
            ^~~~~~~~~~
@xedin
Copy link
Member

xedin commented Jun 17, 2017

@NachoSoto Could you please double check if you can reproduce this one with the latest master build/snapshot? Because what I get is:

error: incorrect argument label in call (have 'f:', expected 'e:')
C(s: C.S(f: [.e1, .e2]))
        ^~
         e

@NachoSoto
Copy link
Contributor Author

I’ll test. Do you know if there are regression tests for this one?

@xedin
Copy link
Member

xedin commented Jun 17, 2017

@NachoSoto I'm adding it right now #10358 🙂

@xedin
Copy link
Member

xedin commented Feb 6, 2020

Forgot to resolve this one after merging the test-case. It has been fixed some time ago.

@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

2 participants