TLDR: when a variable is set within an ‘if’ block a syntax error might be raised when that variable is accessed outside of this block.
Really appreciating the new features afforded by the update to the Nextflow VS code extension. I’m working through some if the syntax errors in a few nf-core
pipeline to get a better understanding of its features and looking at how the stricter syntax is adhered to. One of the syntax errors I can’t see a fix for is when a variable is conditionally set within an if
statement. An example of this can be seen on L:423 of bacass/workflow/bacass.nf
where the channel ch_to_quast_byrefseq
is set within a conditional, and then a few lines later where it is a passed to a process, the syntax error: ch_to_quast_byrefseq is not defined
is shown.
After updating to v1.0.2, I have looked around for other similar examples and this might now be limited to only when .set{}
is used, so maybe it is as simple as not using .set{}
inside if
?