Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Wrong expected argument type in diagnostic #81309

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

Open
AnthonyLatsis opened this issue May 5, 2025 · 1 comment
Open

Wrong expected argument type in diagnostic #81309

AnthonyLatsis opened this issue May 5, 2025 · 1 comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. call expressions Feature → expressions: Call expressions compiler The Swift compiler itself diagnostics QoI Bug: Diagnostics Quality of Implementation expressions Feature: expressions swift 6.2 type checker Area → compiler: Semantic analysis

Comments

@AnthonyLatsis
Copy link
Collaborator

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

@AnthonyLatsis AnthonyLatsis added bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. call expressions Feature → expressions: Call expressions compiler The Swift compiler itself diagnostics QoI Bug: Diagnostics Quality of Implementation expressions Feature: expressions swift 6.2 type checker Area → compiler: Semantic analysis labels May 5, 2025
@xedin
Copy link
Contributor

xedin commented May 5, 2025

A reference point for this one is ArgumentFailureTracker::relabelArguments.

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. call expressions Feature → expressions: Call expressions compiler The Swift compiler itself diagnostics QoI Bug: Diagnostics Quality of Implementation expressions Feature: expressions swift 6.2 type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

2 participants