Skip to content

[SR-2745] Simple Swift 3.0 UIView subclass crashes compiler when archiving #45349

Closed
@swift-ci

Description

@swift-ci
Previous ID SR-2745
Radar None
Original Reporter jbrayton (JIRA User)
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Environment

Xcode 8.0 on macOS 10.12 (16A319) on a MacBook Pro. The selected hardware device is my iPhone 5S running iOS 10.0.1 (14A403).

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, CompilerCrash, OptimizedOnly
Assignee @adrian-prantl
Priority Medium

md5: 245c8d6adad0c69fac2ac1917c108c23

Issue Description:

The following simple Swift 3.0 subclass of a UIView crashes the compiler when archiving:

class MyView: UIView {
    
    required init?(coder: NSCoder) {
        return nil
    }
    
}

Steps to Reproduce:

  1. Open the attached sample project.
  2. Select "Archive" from the "Product" menu within Xcode.

Expected Results:
I expect the code to compile.

Actual Results

I get this compilation error:

Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1

If I comment out the class declaration above, I can create a build archive.

I can build and run the app on my device, but when I archive it I get this crash.

Metadata

Metadata

Assignees

Labels

bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfcrashBug: A crash, i.e., an abnormal termination of softwareoptimized onlyFlag: An issue whose reproduction requires optimized compilation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions