Skip to content
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

(type checker) regression on main in subtyping rules for tuple labels #73207

Open
tayloraswift opened this issue Apr 23, 2024 · 1 comment
Open
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. expressions Feature: expressions for-in loops Feature: for-in loops regression type checker Area → compiler: Semantic analysis

Comments

@tayloraswift
Copy link
Contributor

Description

forums discussion here: https://forums.swift.org/t/did-the-subtyping-rules-for-tuple-labels-change-in-swift-6/71408

on main, it seems it is no longer allowed to ignore tuple labels when binding to an unlabeled tuple.

Reproduction

func size(_ levels:[Range<Int>]) 
{
    for (i, leaves):(Int, Range<Int>) in levels[...].enumerated() 
    {
    }
}

Fiddle: https://swiftfiddle.com/?c=H4sIAAAAAAAAA0XOwQqDMAzG8VcJObXQ9QHK2H3XXa1I0egKNQNbC5v47kYQFr7jnx%2FZsEeH48o95Pgj1UGiSim75hV4ovuTy6PV4HnzDHLjZwEVjVShUtZOSWDg32qIfBGNtba1xOtMSyg0qJM5jYvaPcvQYJUPOE7vkr63OUTG%2FQCfa1LelgAAAA%3D%3D

Expected behavior

it should compile as it did in Swift 5.10

Environment

Swift version 6.0-dev (LLVM b3d7c45a25a792f, Swift 81534a6)
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 23, 2024
@xedin
Copy link
Member

xedin commented Apr 24, 2024

Thank you for filling this!

@xedin xedin added type checker Area → compiler: Semantic analysis regression for-in loops Feature: for-in loops expressions Feature: expressions and removed triage needed This issue needs more specific labels labels Apr 24, 2024
@xedin xedin self-assigned this Apr 24, 2024
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. expressions Feature: expressions for-in loops Feature: for-in loops regression type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

2 participants