Skip to content

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

Open
@tayloraswift

Description

@tayloraswift

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.implicit conversionsFeature: implicit conversionstriage neededThis issue needs more specific labelstype checkerArea → compiler: Semantic analysis

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions