Skip to content

codegen ICE with ref objects, gc:destructors  #12826

Closed
@cooldome

Description

@cooldome

Compile with --gc:destructors

type
  MyObject1* = object of RootObj
    z*: string

  MyObject2* = object of RootObj
    x*: float
    name*: string
    subobj: MyObject1
    case flag*: bool
      of true: y*: float
      of false: nil


var x = new(MyObject2)

Compiler fails with:

C:\nim-devel\lib\system.nim(1748, 8) Error: complex object initialization is not supported with --newruntime

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