You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I forgot quotation in the following quote do snippet and it crashed the compiler (latest devel)
import macros
typeExpr=objectofRootObjInput[T] =objectofExpr
value: NimNodeAddExpr[T1, T2] =objectofExpr
lhs: T1
rhs: T2procinput[T](value: NimNode): Input[T] =Input[T](value: value)
proc`+`[T1, T2](lhs: T1, rhs: T2): AddExpr[T1, T2] =result.lhs = lhs
result.rhs = rhs
proceval[T](input: Input[T]): NimNode=
input.value
proceval(addExpr: AddExpr): NimNode=newCall(ident"+", addExpr.lhs.eval, addExpr.rhs.eval)
macrofoo(a, b: int): untyped=let ia =input[int](a)
let ib =input[int](b)
let c = ia + ib + ia
echo c.repr
let val_C =eval(c)
echo val_C.repr
result=quotedo: val_C # Correct would be `val_C`let c =foo(1, 3)
(lhs: (lhs: (value: 1), rhs: (value: 3)), rhs: (value: 1))
`+`(`+`(1, 3), 1)
obj_algebra_ast.nim(37, 12) Error: internal error: expr: var not init val_C_163266
No stack traceback available
To create a stacktrace, rerun compilation with ./koch temp c <file>
The text was updated successfully, but these errors were encountered:
I forgot quotation in the following quote do snippet and it crashed the compiler (latest devel)
The text was updated successfully, but these errors were encountered: