Skip to content
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

fix contract caller types #2778

Merged
merged 7 commits into from
Sep 14, 2022
Merged

fix contract caller types #2778

merged 7 commits into from
Sep 14, 2022

Conversation

sezna
Copy link
Contributor

@sezna sezna commented Sep 13, 2022

This fixes some incorrect type unification and closes #1261. Really this was just the result of some behavior being untested, so it regressed over time. The type engine code for unifying contract callers had some typos.

I've disabled the contract_caller_as_type test, as this breaks that functionality, but that functionality is very much a special case and will be enabled by #2463 and a rework of the Contract type -- this should at least unblock the DAO contract and the berlin workshop.

@sezna sezna marked this pull request as draft September 13, 2022 18:54
@sezna sezna self-assigned this Sep 13, 2022
@sezna sezna marked this pull request as ready for review September 14, 2022 03:39
@sezna sezna requested a review from a team September 14, 2022 03:40
@sezna sezna added compiler General compiler. Should eventually become more specific as the issue is triaged compiler: frontend Everything to do with type checking, control flow analysis, and everything between parsing and IRgen labels Sep 14, 2022
@otrho otrho requested a review from a team September 14, 2022 05:30
@mohammadfawaz
Copy link
Contributor

Thanks Alex! Does this also address #1261 (comment)? If so, then do you mind adding some tests for that use case?

@sezna
Copy link
Contributor Author

sezna commented Sep 14, 2022

Unfortunately, you still can't return a caller as a type from a function. That functionality is currently broken. I could fix that in a follow-on, but I think it will get fixed by introducing the Contract type eventually anyway, so i wasn't sure if it was necessary. Additionally, that functionality isn't strictly necessary as you can do dynamic-address calls without functions.

@sezna sezna merged commit 4bc4e2c into master Sep 14, 2022
@sezna sezna deleted the sezna/1261 branch September 14, 2022 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler: frontend Everything to do with type checking, control flow analysis, and everything between parsing and IRgen compiler General compiler. Should eventually become more specific as the issue is triaged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Revamp the ContractCaller type
3 participants