Skip to content

string literal copy error after making it empty #24080

@levovix0

Description

@levovix0

Description

var a = (s: "a")
var b = "a"
a.s.setLen 0
b = a.s
assert b == ""

Nim Version

Nim Compiler Version 2.0.8 [Linux: amd64]
Compiled at 2024-07-03
Copyright (c) 2006-2023 by Andreas Rumpf

git hash: 5935c3b
active boot switches: -d:release

Current Output

assertion error

Expected Output

nothing

Known Workarounds

No response

Additional Information

No response

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