Skip to content

Floating-point param in params block doesn't work #6630

@bentsherman

Description

@bentsherman

Bug report

The following example:

params {
    foo: Float = 0.1
}

workflow {
}

Produces the following error:

$ NXF_SYNTAX_PARSER=v2 nextflow run main.nf

Parameter `foo` with type Float cannot be assigned to 0.1 [BigDecimal]

This is because floating-point literals are interpreted as BigDecimal by the script parser.

Likely the Float type in Nextflow should be treated as an alias for Float / Double / BigDecimal so that it can accept any. Or perhaps the parser should cast float literals to Double and raise an error / warning if a literal can't be represented

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions