Skip to content

Calling nullary templates without () doesn't work inside calls inside other templates #13515

@metagn

Description

@metagn

Example

template test: bool = true # compiles: if not test: echo "wtf" # does not compile: template x = if not test: echo "wtf" x

Current Output

got template(): bool, expected ... 

Expected Output

compiles

Workaround

template test: bool = true template x = if not test(): echo "wtf" x

Additional Information

$ nim -v Nim Compiler Version 1.0.6 

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