Skip to content

Implement type annotation pass #1323

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

Closed
wants to merge 27 commits into from

Conversation

ggiraldez
Copy link
Contributor

WIP, incomplete

Apply on top of #1301

This PR aims to implement the type annotation pass of the backend. In order to do that, there are some other required changes:

  • built-ins definitions are annotated with an opaque tag in order to link it to specific typing information (and later, actual implementation in bytecode)
  • add more types classes to represent "pseudo" types in Solidity (ie. types which don't necessarily have a final representation in the language) such as rational number, void, tuples and a function with multiple overloads not yet decided.

Copy link

changeset-bot bot commented May 5, 2025

⚠️ No Changeset found

Latest commit: 1212013

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

ggiraldez added 14 commits May 6, 2025 15:30
Add p0_build_ast
Move collect_types to after flatten_contracts
Implementation is incomplete, plenty of todo!() yet to resolve. But at this
point, the more pressing issues that should be tackled semi-independently are:

- built-ins have no corresponding CST/AST so they cannot be typed easily
- function overloads cannot be resolved, and there's no way to express the
  ambiguity yet
…ages

We should use this in `slang_solidity` to register built-ins in the binding
graph linking them to some type of definition we can later use in the backend.
@ggiraldez
Copy link
Contributor Author

ggiraldez commented Jun 5, 2025

Closing as this will be done in the new binder implementation

@ggiraldez ggiraldez closed this Jun 5, 2025
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.

1 participant