Skip to content

[SR-2971] Whole Module Optimization: Convenience initializer not calling subclass initializer #45561

@swift-ci

Description

@swift-ci
Previous ID SR-2971
Radar rdar://problem/28882879
Original Reporter fumoboy007 (JIRA User)
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Environment

Swift 3.0.1, Xcode 8.1 (8B62), macOS Sierra

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, Miscompile, OptimizedOnly
Assignee @eeckstein
Priority Medium

md5: ecff97bffce8a90c3aeb23958a7a64d5

Issue Description:

See attached sample project.

There is an open class in the embedded framework called MyView. It has a convenience initializer. There is a subclass of MyView called OverrideView in the main app. OverrideView overrides the designated/required initializers of MyView.

When Whole Module Optimization is turned off for the framework:

  • Invoking the convenience initializer calls the appropriate initializer in OverrideView. ✅

When Whole Module Optimization is turned on for the framework:

  • Invoking the convenience initializer calls the initializer of MyView. ❌

Metadata

Metadata

Assignees

Labels

bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfoptimized 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