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

Migrate type-checker to native types and declarations #759

Merged
merged 5 commits into from
Jun 29, 2023

Conversation

TristonianJones
Copy link
Collaborator

@TristonianJones TristonianJones commented Jun 26, 2023

Migrate the type-checker to native types and declarations

This change simplifies the internals of the type-checker considerably by relying
on function overload collision checks to happen within the decls.FunctionDecl
instances on Merge. Additionally, the native types have replaced the protobuf
type declarations used throughout the checker previously.

The files with the most non-trivial changes are the checker/checker.go and
checker/types.go. When reviewing the code, please consider these changes
carefully.

Only one location continues to use the proto-based exprbp.Type, and that's
the ref.TypeProvider which will be updated in a follow-up PR to complete
#568

@TristonianJones TristonianJones force-pushed the updated-checker-3 branch 3 times, most recently from 173141b to 8bb6944 Compare June 26, 2023 21:39
Copy link
Collaborator

@jcking jcking left a comment

Choose a reason for hiding this comment

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

protobuf Get accessors protect against nil dereferencing by returning default values. Here we switch to direct accessors. Hopefully there are not places where we accidently accepted nil and got a default string value, where now we will dereference. We should probably add more exhaustive checks to ensure nil doesn't get placed into the environment accidently.

checker/types.go Outdated Show resolved Hide resolved
@TristonianJones TristonianJones merged commit b85e470 into google:master Jun 29, 2023
@TristonianJones TristonianJones deleted the updated-checker-3 branch June 29, 2023 22:35
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