Skip to content

[NFC] Remove AbstractFunctionDecl::computeType() #27806

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

Conversation

CodaFi
Copy link
Contributor

@CodaFi CodaFi commented Oct 21, 2019

Its functionality is entirely subsumed by InterfaceTypeRequest.

@CodaFi
Copy link
Contributor Author

CodaFi commented Oct 21, 2019

@swift-ci please test and merge

@CodaFi CodaFi requested a review from slavapestov October 21, 2019 17:15
@CodaFi
Copy link
Contributor Author

CodaFi commented Oct 21, 2019

Baffling failures. Absolutely baffling.

Types Are Hard.

@@ -750,7 +750,9 @@ static FuncDecl *deriveEncodable_encode(DerivedConformance &derived) {
encodeDecl->getAttrs().add(attr);
}

encodeDecl->computeType(FunctionType::ExtInfo().withThrows());
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, these aren't correct. The throws bit goes on the inner function type.

Copy link
Contributor

Choose a reason for hiding this comment

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

You need to store the throws bit somewhere now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The throwing bit gets applied to the ext info based on whether the throwing bit is set in the function decl. Both the changed places in the Codable conformance synthesis stuff are already setting that.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, ok.

Its functionality is entirely subsumed by InterfaceTypeRequest.
@CodaFi CodaFi force-pushed the it-isnt-about-computers-and-it-isnt-about-science branch from dc9ef49 to 497a222 Compare October 21, 2019 19:15
@CodaFi
Copy link
Contributor Author

CodaFi commented Oct 21, 2019

@swift-ci please smoke test

@@ -177,7 +176,7 @@ getBuiltinFunction(Identifier Id, ArrayRef<Type> argTypes, Type ResType,
/*GenericParams=*/nullptr,
paramList,
TypeLoc::withoutLoc(ResType), DC);
FD->computeType(Info);
(void)FD->getInterfaceType();
Copy link
Contributor

Choose a reason for hiding this comment

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

None of the new calls to (void)fn->getInterfaceType() should be necessary. Were you not able to remove them?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm bad at rebasing, and when I was writing this up this morning I must have built on top of a bad revision. I think these can all go away now.

@CodaFi
Copy link
Contributor Author

CodaFi commented Oct 21, 2019

Talked with Slava out-of-band. Going to land removing the calls to getInterfaceType() separately since there's some ancillary stuff to take care of.

@CodaFi
Copy link
Contributor Author

CodaFi commented Oct 21, 2019

⛵️

@CodaFi CodaFi merged commit a1e59b6 into swiftlang:master Oct 21, 2019
@CodaFi CodaFi deleted the it-isnt-about-computers-and-it-isnt-about-science branch October 21, 2019 20:37
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