Skip to content

automatic field dereference allows arbitrary depth #18298

Open
@timotheecour

Description

@timotheecour

automatic dereference is deep, as I was surprised to find out; is that documented? is that even a good feature?

type A = ref object
  a0: int
type B = ptr A
proc main() =
  var a = A(a0: 1)
  var b = a.addr
  var c = b.addr
  echo c[][][].a0
  echo c.a0 # works but should it?
main()

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationRelated to documentation content (not generation).

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions