Skip to content

Internal errors with newSeq when custom = operator is defined #7345

@alaviss

Description

@alaviss

Code snippet (compile with --newruntime):

when not defined(nimNewRuntime):
  {.error: "This bug could only be reproduced with --newruntime".}

type
  Obj = object
    a: int

proc `=`(a: var Obj, b: Obj) = discard

let a = newSeq[Obj]()

Compilation output:

Hint: used config file '/etc/nim.cfg' [Conf]
Hint: system [Processing]
Hint: objarr [Processing]
objarr.nim(10, 20) Error: internal error: expr: param not init src_109252
Traceback from system (most recent call last)

nim version:

Nim Compiler Version 0.18.1 [Linux: amd64]
Copyright (c) 2006-2018 by Andreas Rumpf

git hash: cc5140d8b6ea8ca65ec9b74348cf23aec09d6723
active boot switches: -d:release -d:nativeStackTrace

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