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-15029] Dangling } at end of line compile fine but cause SwiftUI preview to crash #57356

Open
mattyoung opened this issue Aug 5, 2021 · 0 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@mattyoung
Copy link

Previous ID SR-15029
Radar None
Original Reporter @mattyoung
Type Bug

Attachment: Download

Environment

Xcode Version 13.0 beta 4 (13A5201i)

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug
Assignee None
Priority Medium

md5: 283908f9acd2f8a42d136c12907acfd1

Issue Description:

import SwiftUI

struct RedactedDemo: View {
    var body: some View {
        VStack {
            Text("Five Stars")
                .font(.title2)

            Text("This")
            Text("is")
            Text("redacted!")
        }
        //  } at the end is not allowed? Build fine, preview crash
        .redacted(reason: .placeholder)    }
}

struct RedactedDemo_Previews: PreviewProvider {
    static var previews: some View {
        RedactedDemo()
    }
}

See https://forums.swift.org/t/dangling-at-end-of-line-build-fine-swiftui-preview-fail-compiling-failed-consecutive-statements-on-a-line-must-be-separated-by/50952/7

@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
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself
Projects
None yet
Development

No branches or pull requests

1 participant