Files
Nim/tests/macros/t17836.nim
Saem Ghani 17db15f9b1 fix #17836 (typed macro isNil for proc params) (#17841)
thanks @alaviss for the test
2021-04-25 10:30:52 +02:00

15 lines
243 B
Nim

import macros
# Ensure that `isNil` works in the typed macro context when pass procs.
type
O = object
fn: proc(i: int): int
var o: O
macro typedBug(expr: typed) =
doAssert expr[1] != nil
doAssert not expr[1].isNil
typedBug(o.fn)