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

[SR-15333] Compiler error when property wrapper depends on captured property wrapper #57655

Open
Gotyanov opened this issue Oct 14, 2021 · 1 comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself property wrappers Feature: property wrappers

Comments

@Gotyanov
Copy link

Previous ID SR-15333
Radar None
Original Reporter @Gotyanov
Type Bug
Environment

Xcode 13
swift-5.5-DEVELOPMENT-SNAPSHOT-2021-10-07-a
swift-DEVELOPMENT-SNAPSHOT-2021-10-05-a

Additional Detail from JIRA
Votes 1
Component/s Compiler
Labels Bug, PropertyWrappers
Assignee None
Priority Medium

md5: ebf0aee26afa5ee4ff03530cc7f90e02

Issue Description:

minimal code to reproduce:

@propertyWrapper
struct Wrapper<Value> {
    var wrappedValue: Value
}

struct A {}
struct B { var a: A }

func test() {
    @Wrapper var a = A() // error: Closure captures '_a' before it is declared

    func makeB() -> B {
        @Wrapper var b = B(a: a)
        return b
    }
}
@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@slavaryk
Copy link

slavaryk commented Nov 6, 2022

Got the same issue((

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. compiler The Swift compiler in itself property wrappers Feature: property wrappers
Projects
None yet
Development

No branches or pull requests

2 participants