treeform / genny

Generate a shared library and bindings for many languages.
MIT License
224 stars 9 forks source link

Add support for type aliases #44

Open mratsim opened 2 years ago

mratsim commented 2 years ago

This fails with Error: index 2 not in 0 .. 1 after getImpl

https://github.com/treeform/genny/blob/33f0e5a3e6d370c63f11ac0572f6396af684a314/src/genny/languages/nim.nim#L127-L137

import genny

type
  Foo[T] = object
    val: T

type FooInt = Foo[int]

proc sum[T](r: var Foo[T], a, b: Foo[T]) =
  r.val = a.val + b.val

exportObject FooInt:
  procs:
    sum(FooInt, FooInt, FooInt)

writeFiles("bindings/generated", "test")
include generated/internal