Skip to content

[SR-13361] if #available(iOS 14, *) Xcode 12 beta 4 crashed on iOS 13 device #55801

@swift-ci

Description

@swift-ci
Previous ID SR-13361
Radar rdar://problem/67361244
Original Reporter Trahambb (JIRA User)
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug
Assignee @beccadax
Priority Medium

md5: 6b8e7a5186e17177ccbd1f5290a2dd29

Issue Description:

When i try to use if #available(iOS 14, *) in Xcode 12 beta 4 to separate code for iOS 14 and lower i got a crash when building on iOS 13 device:

Thread 1: EXC_BAD_ACCESS (code=1, address=0x0)

Example:

struct ContentView: View {
    var body: some View {
        if #available(iOS 14.0, *) {
            List {
                Text("iOS 14")
            }
            .listStyle(InsetGroupedListStyle())
        } else {
            List {
                Text("iOS 13")
            }
            .listStyle(GroupedListStyle())
            .environment(\.horizontalSizeClass, .regular)
        }
    }
}

SO original error

Metadata

Metadata

Assignees

Labels

bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itself

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions