Skip to content

(6.1) regression in checking tuple initialization state #75492

@tayloraswift

Description

@tayloraswift

Description

this used to (does?) compile up through 6.0, but (has) stopped compiling on main

cc @JaapWijnen , who first noticed the issue in the swift-png repo

Reproduction

func f()
{
    let t:(x:Int, y:Int)

    t.x = 0

    print(t.x)
}
error: constant 't.y' used before being initialized
1 | func f()
2 | {
3 |     let t:(x:Int, y:Int)
  |         `- note: constant defined here
4 | 
5 |     t.x = 0
6 | 
7 |     print(t.x)
  |           `- error: constant 't.y' used before being initialized
8 | }
9 | 

Expected behavior

it should compile

Environment

$ /swift/swift-DEVELOPMENT-SNAPSHOT-2024-07-24-a-amazonlinux2/usr/bin/swift --version
Swift version 6.0-dev (LLVM 3c6e1d334961f5e, Swift 384d7f7)
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.type checkerArea → compiler: Semantic analysis

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions