Swift Abort Trap 6 during compile caused by putting a value in @Published String

Viewed 131

I've already submitted a bug report to Apple (#7654122), but I'm hoping someone might know of a workaround because at this point I'm stuck on my project and can't make forward progress.

class BaseData: ObservableObject {
    @Published var pmtstr = "" // <-- here

    // ... bunch of other stuff
}

class DataWhatIsLoanPayment: BaseData {
    // ... other stuff

    override func calculate() {
        super.calculate()

        // ... other stuff

        self.pmtstr = "stuff" // <-- here
    }
}

When I set self.pmtstr = "stuff" and try to compile, the compiler crashes with Abort Trap 6. If I comment out that line, the app compiles correctly.

If I remove the @Published from the initial declaration of pmtstr, then the app compiles correctly. If I put the @Published back, the compiler crashes with Abort Trap 6.

I need to be able to update this string and publish the results of the calculation in order to make forward progress on developing this app.

Any suggestions for a workaround (or a fix)?

0 Answers
Related