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

can no longer consume local var binding #71605

Closed
tayloraswift opened this issue Feb 14, 2024 · 2 comments
Closed

can no longer consume local var binding #71605

tayloraswift opened this issue Feb 14, 2024 · 2 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. diagnostics QoI Bug: Diagnostics Quality of Implementation SIL

Comments

@tayloraswift
Copy link
Member

Description

it told me to file a bug

error: 'consume' applied to value that the compiler does not support. This is a compiler bug. Please file a bug with a small example of the bug
    _ = consume x
                ^
error: fatalError

Reproduction

func f()
{
    var x:[Int] = []
    _ = consume x
}

Expected behavior

it worked in 5.9

Environment

Swift version 5.10-dev (LLVM dbfaba0078e9380, Swift 63c8b55)
Target: x86_64-unknown-linux-gnu

Additional information

it happens on 5.10 and also happens on main

@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 Feb 14, 2024
@MaxDesiatov MaxDesiatov added diagnostics QoI Bug: Diagnostics Quality of Implementation SIL and removed triage needed This issue needs more specific labels labels Feb 19, 2024
@arennow
Copy link

arennow commented Mar 2, 2024

Seeing the same thing on Xcode 15.3.0 RC 1 (Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4))

It seems like most uses of consume don't work in this build, including the example given in the Swift Evolution proposal for this feature

@nate-chandler
Copy link
Contributor

Fixed by #72211 . Regression test added in #72220 .

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. diagnostics QoI Bug: Diagnostics Quality of Implementation SIL
Projects
None yet
Development

No branches or pull requests

4 participants