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-15310] Local lazy variables fail to compile in playgrounds #57632

Open
twostraws opened this issue Oct 13, 2021 · 1 comment
Open

[SR-15310] Local lazy variables fail to compile in playgrounds #57632

twostraws opened this issue Oct 13, 2021 · 1 comment

Comments

@twostraws
Copy link
Contributor

Previous ID SR-15310
Radar rdar://problem/84204302
Original Reporter @twostraws
Type New Feature
Additional Detail from JIRA
Votes 0
Component/s
Labels New Feature
Assignee None
Priority Medium

md5: 19bce097fb55cd812fa50bd2788ae4c2

Issue Description:

The following code compiles correctly in a regular Xcode project, but will not compile at all in a Swift playground:

func test() -> Bool {
    lazy var example = Bool.random()
    return example
}

The error given in the playground is as follows: "error: closure captures '$_lazy_storage$_example' before it is declared"

@slavapestov
Copy link
Member

@swift-ci create

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants