-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Description
Previous ID | SR-11458 |
Radar | rdar://problem/55303660 |
Original Reporter | andyj_at_aspin (JIRA User) |
Type | Bug |
Status | Resolved |
Resolution | Done |
Attachment: Download
Environment
Xcode 11 GM, tested on latest releases of both macOS Catalina Beta & macOS Mojave. Test project uses iOS target and iPhone simulator solely as a means of initiating the 'test' functions.
Additional Detail from JIRA
Votes | 0 |
Component/s | Compiler |
Labels | Bug, CompilerCrash, PropertyWrappers |
Assignee | @DougGregor |
Priority | Medium |
md5: 109f02f0d575a03d09e306c4e15d4d63
Issue Description:
The new feature allowing Property Wrappers to define a static subscript that provides the 'enclosing self' to the wrapped property crashes the compiler with a segfault 11 if the wrapper is used in anything other than the file in which is defined.
Taking the definitions and structures defined in the original pull request's unit test file test/Interpreter/property_wrappers.swift which defines the class using the Observable wrapper in the same file, everything is fine. If the definition of the MyTest class is moved into another source file (or another class is defined in another file also using the Observable wrapper) then the compiler segfaults #11 at the subscript function in the wrapper's class.
Original pull request is at #25884
Test project is attached - both set to crash and succeed. This will not compile (see segfault) unless the definition and usage of the MyOtherType class are commented out, leaving the only usage of the Observable wrapper in the file in which it is declared.