Skip to content

[Sema] Dig out other constructor if call is wrapped in a Dot-Call #80334

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AdamCmiel
Copy link

Guessing this bug /feature is introduced in CSApply ExprRewriter::buildMemberRef but didn't dig deep enough to find there. If a derived class' designated initializer initializes all stored let properties before calling super.init(), we don't properly type-check the chained init call. This does not happen if the stored properties are var or default initialized. We can however dig the OtherConstructorDeclRefExpr out of the semanticFn of the DotSyntaxCallExpr and proceed as normal.

Resolves #80311, #65316

@drodriguez
Copy link
Contributor

@swift-ci please test

Guessing this bug /feature is introduced in CSApply ExprRewriter::buildMemberRef
but didn't dig deep enough to find there. If a derived class' designated initializer
initializes all stored let properties before calling super.init(), we don't properly
type-check the chained init call. This does not happen if the stored properties are
var or default initialized. We can however dig the OtherConstructorDeclRefExpr out of
the semanticFn of the DotSyntaxCallExpr and proceed as normal.
@drodriguez
Copy link
Contributor

@swift-ci please test

2 similar comments
@AdamCmiel
Copy link
Author

@swift-ci please test

@AdamCmiel
Copy link
Author

@swift-ci please test

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.

Confusing designated initializer rules
2 participants