Skip to content

[5.0] DefiniteInitialization: Storing back to the 'self' box in a class init is OK. #14396

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

jckarter
Copy link
Contributor

@jckarter jckarter commented Feb 3, 2018

Explanation: Fixes a regression where spurious "self used before super.init" errors would occur when an argument to a self.init or super.init delegation threw.

Scope: Regression from 4.0

Issue: rdar://problem/37007554

Risk: Low, small bug fix

Testing: Swift CI, test case from Radar

…t is OK.

SILGen does this now to maintain ownership balance when a class initializer delegation gets interrupted, such as by an error propagation through one of the arguments to the delegatee. Fixes rdar://problem/37007554 .
@jckarter jckarter requested a review from gottesmm February 3, 2018 18:09
@jckarter
Copy link
Contributor Author

jckarter commented Feb 3, 2018

@swift-ci Please test

@jckarter
Copy link
Contributor Author

jckarter commented Feb 3, 2018

@gottesmm Does this look OK for the 5.0 branch?

@swift-ci
Copy link
Contributor

swift-ci commented Feb 3, 2018

Build failed
Swift Test Linux Platform
Git Sha - 453c439

@jckarter
Copy link
Contributor Author

jckarter commented Feb 3, 2018

@phausler You know about this issue on the 5.0 Linux bot?

Foundation/Data.swift:998:15: error: type 'Data' does not conform to protocol 'Collection'
public struct Data : ReferenceConvertible, Equatable, Hashable, RandomAccessCollection, MutableCollection, RangeReplaceableCollection {
              ^
Foundation/Data.swift:1008:22: note: possibly intended match 'Data.Indices' (aka 'Range<Int>') does not conform to 'Collection'
    public typealias Indices = Range<Int>
                     ^

@phausler
Copy link
Contributor

phausler commented Feb 3, 2018

This is a regression, perhaps related to the changes made for ranges recently?
Cc @airspeedswift

@airspeedswift
Copy link
Member

Ah, so the problem seems to be that we didn't create a 5.0 branch for corelibs-foundation, so if you take advantage of a new feature on master, it'll break the swift 5.0 branch tests.

Let me see if I can check in a workaround for now.

@jckarter jckarter merged commit 443bd22 into swiftlang:swift-5.0-branch Feb 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants