Skip to content

Downgrade The TypeLoc in VarDecl to a TypeRepr #27624

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 3 commits into from
Oct 11, 2019

Conversation

CodaFi
Copy link
Contributor

@CodaFi CodaFi commented Oct 11, 2019

TypeCheckPattern used to splat the interface type into this, and
different parts of the compiler would check one or the other. There is
now one source of truth: The interface type. The type repr is now just
a signal that the user has written an explicit type annotation on
a parameter. For variables, we will eventually be able to just grab
this information from the parent pattern.

EDIT: This started as a simple refactor, now I'm just nuking the old stateful code around this that we don't need anymore. There's diagnostic improvements from this.

TypeCheckPattern used to splat the interface type into this, and
different parts of the compiler would check one or the other.   There is
now one source of truth: The interface type.  The type repr is now just
a signal that the user has written an explicit type annotation on
a parameter.  For variables, we will eventually be able to just grab
this information from the parent pattern.
@CodaFi CodaFi requested a review from slavapestov October 11, 2019 18:18
@CodaFi
Copy link
Contributor Author

CodaFi commented Oct 11, 2019

@swift-ci please smoke test

if (auto ty = decl->getTypeLoc().getType())
return;

static Type validateParameterType(ParamDecl *decl) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Gee, this whole thing looks suspiciously requestifiable now

Copy link
Member

Choose a reason for hiding this comment

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

DOOOOO EEETTTT

@CodaFi
Copy link
Contributor Author

CodaFi commented Oct 11, 2019

@swift-ci please smoke test

@CodaFi CodaFi changed the title [NFC] Downgrade The TypeLoc in VarDecl to a TypeRepr Downgrade The TypeLoc in VarDecl to a TypeRepr Oct 11, 2019
@CodaFi
Copy link
Contributor Author

CodaFi commented Oct 11, 2019

@swift-ci please smoke test

@CodaFi
Copy link
Contributor Author

CodaFi commented Oct 11, 2019

⛵️

@CodaFi CodaFi merged commit 7770564 into swiftlang:master Oct 11, 2019
@CodaFi CodaFi deleted the in-locale-parentis branch October 11, 2019 21:53
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