Playground crash: AttributeGraph precondition failure: setting value during update

I get an error:

Code Block
error: Execution was interrupted, reason: signal SIGABRT.
The process has been left at the point where it was interrupted, use "thread return -x" to return to the state before expression evaluation.



when running the following minimal playground code in Xcode:

Code Block Swift
import SwiftUI
import PlaygroundSupport
struct Country: Identifiable {
    var id: String { name }
    var name: String
    var flag: String
}
struct CountryView: View {
    let name: String
    let flag: String
    var body: some View {
        Text(name)
    }
}
PlaygroundPage.current.setLiveView(
    ForEach([Country(name: "Italy", flag: "italy")], id: \.id) { country in
        CountryView(name: country.name, flag: country.flag)
    }
)


This is for current Xcode Version 12.4 (12D4e), and beta3.

Note that Xcode does not crash. It's the playground execution.

Any hints for a workaround?


Additional notes:
Currently, playground seem to have a lot if issues and it's currently not usable as a whole - even without using SwiftUI there are a lot issues resulting in crashes, which I think is a very bad situation.

A crash log is generated when executing the playground.
Part of the crash log:

Code Block
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
External Modification Warnings:
Debugger attached to process.
Application Specific Information:
abort() called
CoreSimulator 757.3 - Device: iPad Pro (9.7-inch) (28657173-2D19-4421-B084-2F4DDD658725) - Runtime: iOS 14.4 (18D46) - DeviceType: iPad Pro (9.7-inch)
AttributeGraph precondition failure: setting value during update: 5656.




Does anyone have an answer to this question?

Also, since the error says, 'The process has been left at the point where it was interrupted, use "thread return -x" to return to the state before expression evaluation.', where do I type "thread return -x"? The debug area doesn't let my type in it in Playground as it does in Xcode.

Playground crash: AttributeGraph precondition failure: setting value during update
 
 
Q