-
Notifications
You must be signed in to change notification settings - Fork 638
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
Report an error on duplicate workflow name definitions #4088
Conversation
Signed-off-by: Ben Sherman <[email protected]>
✅ Deploy Preview for nextflow-docs-staging ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
It would be nice to add a unit test to validate this |
Signed-off-by: Ben Sherman <[email protected]>
Signed-off-by: Ben Sherman <[email protected]>
modules/nextflow/src/main/groovy/nextflow/script/ScriptMeta.groovy
Outdated
Show resolved
Hide resolved
Signed-off-by: Ben Sherman <[email protected]>
If you define two functions with the same name with different signatures, can they both be used or only the last definition? That will affect whether we should return an error or only a warning if the duplicates are both functions. |
Signed-off-by: Ben Sherman <[email protected]>
Did some testing, found that function overloading works the same as in Groovy as far as I can tell. If you define two functions with the same signatures, the Groovy compiler catches it before Nextflow. So Since we changed it to always be an error, I had to remove a test that allows duplicate module imports. Also, I think |
81f7cb7
to
8a43489
Compare
If I understand correctly, the exception is thrown irrespective of the strict flag, right? |
Correct |
Ok, update the PR title to reflect that |
) Signed-off-by: Ben Sherman <[email protected]>
Close #4086
Consider the following pipeline script:
Currently this causes a stack overflow error:
With this PR, Nextflow will warn about the duplicate workflow name:
And if strict mode is enabled, this warning will become an error.