Skip to content

Sema: implement getInitKind using a request evaluator. #26377

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 7 commits into from
Jul 30, 2019

Conversation

hborla
Copy link
Member

@hborla hborla commented Jul 26, 2019

  • Parse: check if constructor decls are marked as convenience rather than (indirectly) calling getInitKind
    • We don't want to invoke the InitKindRequest request during parsing. What the parsing code really cares about is whether or not the decl has ConvenienceAttr.
  • Sema: don't change the init kind of a ConstructorDecl as a part of error recovery when type checking its body.
  • Sema: simplify checking for a designated init in canSuppressPotentialWitnessWarningWithMovement
  • Add the request InitKindRequest to lazily compute the kind of an initializer declaration.

hborla added 4 commits July 26, 2019 14:16
…than (indirectly) calling `getInitKind`

When we requestify `getInitKind`, we don't want to invoke the request during parsing. What the parsing code
really cares about is whether or not the decl has `ConvenienceAttr`.
Add the request `InitKind` to lazily compute the kind of an initializer
declaration.
@hborla hborla requested review from slavapestov and xymus July 26, 2019 23:34
@hborla
Copy link
Member Author

hborla commented Jul 26, 2019

@swift-ci please smoke test

@hborla
Copy link
Member Author

hborla commented Jul 26, 2019

@swift-ci please test source compatibility

Copy link
Member

@DougGregor DougGregor left a comment

Choose a reason for hiding this comment

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

This looks great!

hborla added 3 commits July 29, 2019 10:21
Use `getSelfNominalTypeDecl` rather than `getDeclaredInterfaceType` in
`InitKindRequest::evaluate`, since it's cheaper to perform.
@hborla
Copy link
Member Author

hborla commented Jul 29, 2019

@swift-ci please smoke test

@hborla
Copy link
Member Author

hborla commented Jul 29, 2019

@swift-ci please test source compatibility

@hborla hborla merged commit 78edeea into swiftlang:master Jul 30, 2019
@hborla hborla deleted the init-kind-request branch July 30, 2019 00:54
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