Skip to content

Different CLI param cast depending on syntax parser #7091

@jorgee

Description

@jorgee

Bug report

Expected behavior and actual behavior

Depending on the number passed through the CLI, the syntax parser v2 is not working as the syntax parser v1.

Steps to reproduce the problem

A pipeline like the following has a different behaviour depending on the syntax parser

params.num_consumers  = 1 

workflow {

    Channel.of( 1..params.num_consumers ).view()

}

Depending on the number passed through the CLI, it has different behaviours

$ NXF_SYNTAX_PARSER=v2 nextflow run main.nf --num_consumers 1

 N E X T F L O W   ~  version 26.04.0

Launching `main.nf` [happy_mirzakhani] revision: 1e32e4174a

1
2
...
48
49

$ NXF_SYNTAX_PARSER=v1 nextflow run main.nf --num_consumers 1

 N E X T F L O W   ~  version 26.04.0

Launching `main.nf` [scruffy_sanger] revision: 1e32e4174a

1

$ NXF_SYNTAX_PARSER=v2 nextflow run main.nf --num_consumers 10

 N E X T F L O W   ~  version 26.04.0

Launching `main.nf` [modest_kowalevski] revision: 1e32e4174a

ERROR ~ Unable to create range due to incompatible types: Integer..String (possible missing brackets around range?)

 -- Check script 'main.nf' at line: 7 or see '.nextflow.log' file for more details

$ NXF_SYNTAX_PARSER=v1 nextflow run main.nf --num_consumers 10

 N E X T F L O W   ~  version 26.04.0

Launching `main.nf` [chaotic_caravaggio] revision: 1e32e4174a

1
2
...
9
10

Environment

  • Nextflow version: 26.04.0
  • Java version: [21]
  • Operating system: Linux]
  • Bash version: (use the command $SHELL --version)

Additional context

(Add any other context about the problem here)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions