Using Text(_ : Date, style: DateStyle) in ScrollView causes crash

When embedding a Text(_:style:) View in a ScrollView, SwiftUI produces the following error:

Code Block swift
Thread 1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)


A minimal example is this:

Code Block swift
struct ContentView: View {
var body: some View {
ScrollView { Text(.init() + 60, style: .relative) }
}
}


Same problem
Same problem in Xcode 12 beta 6 Build: 12A8189n
There is apparently an incompatibility between scrollView and relative.

Code Block
ScrollView { Text(.init() + 60, style: .date) }

will not crash

nor with
Code Block
ScrollView { Text(.init() + 60, style: .time) }

but timer will crash as well
Code Block
ScrollView { Text(.init() + 60, style: .timer) }


Did you file a bug ?
Same problem in Xcode 12.0.1

same in Xcode 12.5

works well for me on macos 12.beta, xcode 13.beta, target ios 14.7 and macCatalyst 12. Tested on macOS 12 and iPhone ios 14.7. You could try "Text(Date() + 60, style: .relative)"

struct ContentView: View {
    var body: some View {
        ScrollView {
            Text(.init() + 60, style: .relative)
            Text(.init() + 60, style: .date)
            Text(.init() + 60, style: .time)
            Text(.init() + 60, style: .timer)
            Text(.init() + 60, style: .offset)
        }
    }
}
Using Text(_ : Date, style: DateStyle) in ScrollView causes crash
 
 
Q