Skip to content

[JS backend] Interaction between if-expressions and addr leads to undefined #19270

@dawkot

Description

@dawkot

Example

var
  x = @["test"]
  y = if true: x.addr else: x.addr

{.emit: "console.log(`y`)".}

Current Output

undefined
$ nim -v
Nim Compiler Version 1.6.2

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