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

Implementing Type Hints of Let expressions for Wildcards #330

Merged
merged 4 commits into from
May 24, 2024

Conversation

Tarbetu
Copy link
Contributor

@Tarbetu Tarbetu commented May 22, 2024

In previous PR, I have implemented type hints for ID's like this:

let x: Number = 5

However, it wouldn't work for wildcards:

let _: Number, _x: Number = 5, 10

This PR allows the usage of type hints with wildcards.

@irh
Copy link
Contributor

irh commented May 22, 2024

This is great @Tarbetu - would you be up for also adding a couple of runtime tests in vm_tests.rs? This would show that the compiler side is also hooked up correctly.

@Tarbetu
Copy link
Contributor Author

Tarbetu commented May 22, 2024 via email

@Tarbetu
Copy link
Contributor Author

Tarbetu commented May 23, 2024

Tests are ready.

@irh
Copy link
Contributor

irh commented May 23, 2024

@Tarbetu Thanks, but I should have been clearer, sorry. There are already tests for let expressions in vm_tests.rs (search for type_checks), I meant that a test or two should be added for using type hints on wildcards.

@Tarbetu
Copy link
Contributor Author

Tarbetu commented May 24, 2024

Oh. 🤦🏼

Sorry for misunderstood. I reimplemented tests as wanted, but I'm not sure that they are presenting the proper scenario.

@irh irh merged commit 50d03c5 into koto-lang:main May 24, 2024
6 checks passed
@irh
Copy link
Contributor

irh commented May 24, 2024

No worries, I should have been clearer. Thanks for the PR!

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