Skip to content

type checker regression on 6.1 in subtyping rules for tuple labels #80902

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
tayloraswift opened this issue Apr 18, 2025 · 0 comments
Open
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. triage needed This issue needs more specific labels

Comments

@tayloraswift
Copy link
Member

Description

Swift version 6.1 (swift-6.1-RELEASE)
Target: x86_64-unknown-linux-gnu
<stdin>:3:5: error: conflicting arguments to generic parameter 'Elements' ('[(Int, (b: Int, c: Int))]' vs. '[(Int, (Int, Int))]')
1 | func f()
2 | {
3 |     for (a, (b, c)):(Int, (b:Int, c:Int)) in [(1, (2, 3))]
  |     `- error: conflicting arguments to generic parameter 'Elements' ('[(Int, (b: Int, c: Int))]' vs. '[(Int, (Int, Int))]')
4 |     {
5 |     }
<stdin>:3:58: error: conflicting arguments to generic parameter 'Self' ('[(Int, (b: Int, c: Int))]' vs. '[(Int, (Int, Int))]')
1 | func f()
2 | {
3 |     for (a, (b, c)):(Int, (b:Int, c:Int)) in [(1, (2, 3))]
  |                                                          `- error: conflicting arguments to generic parameter 'Self' ('[(Int, (b: Int, c: Int))]' vs. '[(Int, (Int, Int))]')
4 |     {
5 |     }
<stdin>:3:46: error: conflicting arguments to generic parameter 'Element' ('(Int, (b: Int, c: Int))' vs. '(Int, (Int, Int))')
1 | func f()
2 | {
3 |     for (a, (b, c)):(Int, (b:Int, c:Int)) in [(1, (2, 3))]
  |                                              `- error: conflicting arguments to generic parameter 'Element' ('(Int, (b: Int, c: Int))' vs. '(Int, (Int, Int))')
4 |     {
5 |     }

Reproduction

func f()
{
    for (a, (b, c)):(Int, (b:Int, c:Int)) in [(1, (2, 3))]
    {
    }
}

Expected behavior

it compiled on 6.0.3

Environment

Swift version 6.1 (swift-6.1-RELEASE)
Target: x86_64-unknown-linux-gnu

Additional information

No response

@tayloraswift tayloraswift added bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. triage needed This issue needs more specific labels labels Apr 18, 2025
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. triage needed This issue needs more specific labels
Projects
None yet
Development

No branches or pull requests

1 participant