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

feat(compiler): static support #1662

Merged
merged 21 commits into from
Feb 28, 2023
Merged

feat(compiler): static support #1662

merged 21 commits into from
Feb 28, 2023

Conversation

yoav-steinberg
Copy link
Collaborator

@yoav-steinberg yoav-steinberg commented Feb 24, 2023

See #107

also in this PR:

  • de-dup diagnostics by storing them in an IndexSet instead of a Vec.
  • Added a new AST reference type TypeMember for referencing enum fields and class statics. Currently the grammar has no way of distinguishing between a nested reference and a type property reference. So during type-checking I do a (unsafe) convert in the AST tree from one type to the other. If we change the grammar to distinguish between the two we can avoid the unsafe here.
  • Changed Reference::NestedReferece to Reference::InstanceMember to match nicely with the new Reference::TypeMember.

Not in this PR

By submitting this pull request, I confirm that my contribution is made under the terms of the Monada Contribution License.

examples/tests/valid/static_members.w Outdated Show resolved Hide resolved
libs/tree-sitter-wing/grammar.js Show resolved Hide resolved
libs/wingc/src/ast.rs Outdated Show resolved Hide resolved
libs/wingc/src/capture.rs Outdated Show resolved Hide resolved
@yoav-steinberg yoav-steinberg deleted the yov/static branch February 24, 2023 20:15
@yoav-steinberg yoav-steinberg restored the yov/static branch February 24, 2023 20:16
Copy link
Contributor

@Chriscbr Chriscbr left a comment

Choose a reason for hiding this comment

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

This is looking promising...

examples/tests/invalid/access_static_from_instance.w Outdated Show resolved Hide resolved
examples/tests/valid/static_members.w Outdated Show resolved Hide resolved
libs/wingc/src/diagnostic.rs Show resolved Hide resolved
libs/wingc/src/ast.rs Outdated Show resolved Hide resolved
libs/wingc/src/lsp/sync.rs Show resolved Hide resolved
libs/wingc/src/type_check.rs Outdated Show resolved Hide resolved
libs/wingc/src/type_check.rs Show resolved Hide resolved
libs/wingc/src/type_check.rs Outdated Show resolved Hide resolved
libs/wingc/src/type_check.rs Outdated Show resolved Hide resolved
@yoav-steinberg yoav-steinberg marked this pull request as ready for review February 26, 2023 15:56
@yoav-steinberg yoav-steinberg requested a review from a team as a code owner February 26, 2023 15:56
@yoav-steinberg yoav-steinberg added the 🚧 pr/do-not-merge PRs with this label will not be automatically merged by mergify. label Feb 28, 2023
@yoav-steinberg yoav-steinberg merged commit 548000d into main Feb 28, 2023
@yoav-steinberg yoav-steinberg deleted the yov/static branch February 28, 2023 09:33
@monadabot
Copy link
Contributor

Congrats! 🚀 This was released in Wing 0.5.81.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚧 pr/do-not-merge PRs with this label will not be automatically merged by mergify.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants