nextflow-io / nextflow-io/nextflow
Misleading error message when using shadowed process name in map
Nobody has claimed this yet.
- Dominant language
- Groovy
- Stars
- 3.5k
- Forks
- 811
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 61
Description
If you run:
process FOO {
script:
'''
echo hi
'''
}
workflow {
def FOO = 1
channel.of(FOO).map { v -> FOO(v) }
}
it raises the following error:
Error test.nf:10:34: Processes cannot be called from within a closure
│ 10 | channel.of(FOO).map { v -> FOO(v) }
╰ |
However if you do
channel.of(FOO).map { v -> FOO }.view{ v -> "v is ${v}"}
You find that v is 1 and that the process is in fact shadowed by the local variable declaration, so it would seem that the error should really be that FOO is not callable?
Environment
- Nextflow version: 26.04.6
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the supplied Nextflow script and comparing the process-call case with the shadowed-value case. Trace the closure invocation and name-resolution entry points to determine why the process-specific error is selected; done means the shadowed value produces an accurate non-callable error without changing the valid process behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- groovy
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100