summary refs log tree commit diff stats
path: root/tests/macros/t17836.nim
blob: 2453637f5302fa4766c3499bfa9ad394708949dd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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)