Skip to content

[Sema] Don't make argument paren target of RebindSelfInConstructorExpr #17696

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
merged 1 commit into from
Jul 23, 2018

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Jul 3, 2018

For (previously crashing):

class A {
    init() {}

    convenience init(s: String) {
        print(self.init())
    }
}

target of RebindSelfInConstructorExpr should be call expression self.init() instead of paren (self.init()).

rdar://problem/41416911
Possibly: rdar://problem/41593987

@rintaro
Copy link
Member Author

rintaro commented Jul 3, 2018

@swift-ci Please smoke test

@rintaro rintaro requested a review from slavapestov July 3, 2018 08:01
For `use(self.init())`, target of RebindSelfInConstructorExpr should be
call expression instead of paren expression.

rdar://problem/41416911
Possibly: rdar://problem/41593987
@rintaro rintaro force-pushed the sema-rebindself-target branch from 717bd86 to e694837 Compare July 3, 2018 08:12
@rintaro
Copy link
Member Author

rintaro commented Jul 3, 2018

@swift-ci Please smoke test

@rintaro
Copy link
Member Author

rintaro commented Jul 6, 2018

@slavapestov Could you take a look?

Copy link
Contributor

@beccadax beccadax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wrote a nearly identical change recently, but I think your handling of the CallArgs check is more accurate than mine.

@rintaro
Copy link
Member Author

rintaro commented Jul 23, 2018

@brentdax Sorry for delay, I was on vacation. merging.

@rintaro rintaro merged commit 183a1ae into swiftlang:master Jul 23, 2018
@rintaro rintaro deleted the sema-rebindself-target branch July 23, 2018 00:01
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.

2 participants