Skip to content

getImpl can no longer be used with nkObjConstr's bound type #20856

@beef331

Description

@beef331

What happened?

import std/macros
macro ensureImplWorksOnConstr(t: typed): untyped =
    expectKind(t, nnkObjConstr)
    assert t[0].getTypeInst.getImpl.repr == "A = object"
    assert t[0].getImpl.repr == "A = object"

type A = object

ensureImplWorksOnConstr(A())

Errors that node is not a sym

Nim Version

Any commit post defaults for types

Current Standard Output Logs

No response

Expected Standard Output Logs

No response

Possible Solution

VM needs to handle the case that it gets a nkType now since nkObjectConstr no longer gets a Sym node in the first spot but a Type node

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