Skip to content

repr complex generics with distinct reaches call depth limit with ARC/ORC #20155

@ringabout

Description

@ringabout
type
  BaseUint* = SomeUnsignedInt or byte
  Ct*[T] = distinct T
    ## Constant-Time wrapper
    ## Only constant-time operations in particular the ternary operator equivalent
    ##   condition: if true: a else: b
    ## are allowed

  CTBool*[T] = distinct range[T(0)..T(1)]
    ## Constant-Time boolean wrapper

var x: array[8, CTBool[Ct[uint32]]]
x[0] = (CTBool[Ct[uint32]])(1)
echo x.repr, " ", typeof(x[0])
Error: call depth limit reached in a debug build (2000 function calls). You can change it with -d:nimCallDepthLimit=<int> but really try to avoid deep recursions instead.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions