Skip to content

Compile time let and var aliases to compile time functions fail. #11047

@deech

Description

@deech

The following fails with:

/usr/bin/ld: /home/deech/.cache/nim/constproc_d/constproc.c.o: in function `NimMainModule':
constproc.c:(.text+0x284): undefined reference to `f_bfa0L49aD5jfHWe71uFSAuw'
collect2: error: ld returned 1 exit status
Error: execution of an external program failed: 'gcc   -o /home/deech/Nim/constproc  /home/deech/.cache/nim/constproc_d/stdlib_io.c.o /home/deech/.cache/nim/constproc_d/stdlib_system.c.o /home/deech/.cache/nim/constproc_d/constproc.c.o    -ldl'
proc foo(): int {.compileTime.} = 100
var f {.compileTime.} = foo
echo f()

Change var to let and you get the same thing.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions