-
Notifications
You must be signed in to change notification settings - Fork 739
Type checking support #6482
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
base: master
Are you sure you want to change the base?
Type checking support #6482
Conversation
✅ Deploy Preview for nextflow-docs-staging ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Signed-off-by: Ben Sherman <bentshermann@gmail.com>
6a7d8a1
to
2c2168f
Compare
return true; | ||
var type = genericsType.getType(); | ||
resolveOrFail(type, genericsType); | ||
resolve(type); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the failure removed? Also ignoring the return. Not understanding this part.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was causing an unhelpful error when a generic type argument couldn't be resolved. But now I remember I need to propagate this error up the stack and still report it, so I will add that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tried to understand changes. Not familiar with the resolve part, so I couldn't understand why you changed a resolveOrFail
by just resolve
. The rest looks fine to me.
This PR adds a few things to nf-lang to help enable type checking in the language server.
The full type checker will eventually be incorporated into nf-lang, but for now it will reside in the language server while we continue to develop it. This way I can release improvements to the type checker without requiring a Nextflow patch release
No unit tests because these changes are covered by language server unit tests for now.
Summary of changes:
Save method overloads in
VariableScopeVisitor
when a method call matches multiple possible methods (used by type checker to select method or provide appropriate error message)Add
@NamedParams
annotation to standard library functions (used by type checker to validate named params)Fix resolution of output types for processes and workflows
Resolve
params
block during name checking (was previously done only by language server)Minor bug fixes