Skip to content
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

[SR-7361] Complicated nested closures not compiling with swift 4.1 #49909

Closed
swift-ci opened this issue Apr 5, 2018 · 2 comments
Closed

[SR-7361] Complicated nested closures not compiling with swift 4.1 #49909

swift-ci opened this issue Apr 5, 2018 · 2 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself IRGen LLVM IR generation performance regression swift 4.1

Comments

@swift-ci
Copy link
Collaborator

swift-ci commented Apr 5, 2018

Previous ID SR-7361
Radar rdar://problem/39208959
Original Reporter alikvovk (JIRA User)
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, 4.1Regression, CompileTime, IRGen, Performance
Assignee shajrawi (JIRA)
Priority Medium

md5: 570a0dea095f7f3aa35a142e54d55ab8

Issue Description:

Trying compiling this code results in infinite compiling.

It doesn't work in neither Xcode 9.3, swiftc nor REPL for all members of my team.

struct RegistrationFormData: Encodable {
    var companyTaxCode: String
    var personTaxCode: String
    var country: String
    var externalIds: [String]
    var position: String
    var lastName: String
 
    var nameMiddleName: String {
        return name + " " + middleName
    }
 
    var name: String
    var middleName: String
 
    var birthday: String
    var address: String
    var city: String
    var zip: String
    var region: String
 
//    var choosenDocType: RegistrationDocumentType = .passport
    var documentNumber: String {
        return ""
//        switch choosenDocType {
//        case .idCard:
//            return idCardNumber
//        case .passport:
//            return passportNumber
//        }
    }
 
    var documentSerial: String? {
        return nil
//        return .passport == choosenDocType ? passportCode : nil
    }
 
    var passportCode: String
    var passportNumber: String
    var idCardNumber: String
 
    var phone: String {
        return countryCode + operatorCode + userPhoneNumber
    }
 
    var countryCode: String
    var operatorCode: String
    var userPhoneNumber: String
 
    var loginPhone: String {
        return loginPhoneCountryCode + loginPhoneOperatorCode + loginUserPhoneNumber
    }
 
    var loginPhoneCountryCode: String
    var loginPhoneOperatorCode: String
    var loginUserPhoneNumber: String
 
    var email: String
    var login: String
    var password: String
    var confirmPassword: String
    var secretQuestion: String
    var secretAnswer: String
 
    static var creator = { companyTaxCode in { personTaxCode in { country in { externalIds in { position in { lastName in
    { name in { middleName in { birthday in { address in { city in { zip in { region in
        { passportCode in { passportNumber in { idCardNumber in { countryCode in { operatorCode in
            { userPhoneNumber in { loginPhoneCountryCode in { loginPhoneOperatorCode in
                { loginUserPhoneNumber in { email in { login in { password in { secretQuestion in
                    { secretAnswer in { confirmPassword in RegistrationFormData(
                        companyTaxCode: companyTaxCode, personTaxCode: personTaxCode, country: country, externalIds: externalIds,
                        position: position, lastName: lastName, name: name, middleName: middleName,
                        birthday: birthday, address: address, city: city, zip: zip, region: region,
                        passportCode: passportCode,
                        passportNumber: passportNumber, idCardNumber: idCardNumber,
                        countryCode: countryCode, operatorCode: operatorCode,
                        userPhoneNumber: userPhoneNumber, loginPhoneCountryCode: loginPhoneCountryCode,
                        loginPhoneOperatorCode: loginPhoneOperatorCode,
                        loginUserPhoneNumber: loginUserPhoneNumber, email: email, login: login,
                        password: password, confirmPassword: confirmPassword, secretQuestion: secretQuestion,
                        secretAnswer: secretAnswer) }}}}}}}}}}}}}}}}}}}}}}}}}}}}
 }
@belkadan
Copy link
Contributor

belkadan commented Apr 5, 2018

I wouldn't say this is such a motivating test case, but I'm sure the original code is more sensible, and it is a regression. sample says the time is going to LoadableStorageAllocation::allocateLoadableStorage in runIRGenPreparePasses.

@swift-ci create

@swift-ci
Copy link
Collaborator Author

Comment by Joe Shajrawi (JIRA)

Improved compile time on master: #16025

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself IRGen LLVM IR generation performance regression swift 4.1
Projects
None yet
Development

No branches or pull requests

3 participants