Skip to content

[SR-14633] Generic structs sometimes cause a crash when using existential types (only in Xcode Playground) #56

Open
@swift-ci

Description

@swift-ci
Previous ID SR-14633
Radar rdar://problem/78224316
Original Reporter fermion17 (JIRA User)
Type Bug
Environment

iMac (Retina 5K, 27-inch, 2019), macOS 11.3, Xcode 12.5

MacBook Pro (Retina, 15-inch, Mid 2015), macOS 10.15.7, Xcode 12.3

Additional Detail from JIRA
Votes 0
Component/s Xcode Playground Support
Labels Bug
Assignee None
Priority Medium

md5: e78de01bb76e1378e78ad689d5720824

Issue Description:

Generic structs S<T> cause a crash when:

  • it contains a field with type T?

  • it is specialized by an existential type, e.g. S<P> where P is a protocol.

For example, the following code in Xcode Playground causes a crash.

protocol P {}
struct S<T> {
    let field: T? = nil
}
let x = S<P>() // error: Execution was interrupted, reason: EXC_BAD_ACCESS (code=EXC_I386_GPFLT).

This issue only occurs in Xcode Playground.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions