Skip to content

Wrong expected argument type in diagnostic #81309

Open
@AnthonyLatsis

Description

@AnthonyLatsis

Description

The first error below is correct, and then after that the compiler looses sense of what’s going on.

Reproduction

func f(p: Int, _: String) {}
f(0, "")
error: missing argument label 'p:' in call [missing_argument_labels]
f(0, "")
 ^
  p: 
error: cannot convert value of type 'Int' to expected argument type 'String' [cannot_convert_argument_value]
f(0, "")
  ^
error: cannot convert value of type 'String' to expected argument type 'Int' [cannot_convert_argument_value]
f(0, "")
     ^

Expected behavior

Only the first diagnostic.

Environment

Swift version 6.2-dev (LLVM 736ebbfa5fe3371, Swift d033eec)

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.call expressionsFeature → expressions: Call expressionscompilerThe Swift compiler itselfdiagnostics QoIBug: Diagnostics Quality of ImplementationexpressionsFeature: expressionsswift 6.2type checkerArea → compiler: Semantic analysis

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions