From 17db15f9b1a03ac93cb6c5c0264f2b534ab8b2ab Mon Sep 17 00:00:00 2001 From: Saem Ghani Date: Sun, 25 Apr 2021 01:30:52 -0700 Subject: fix #17836 (typed macro isNil for proc params) (#17841) thanks @alaviss for the test --- tests/macros/t17836.nim | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 tests/macros/t17836.nim (limited to 'tests/macros/t17836.nim') diff --git a/tests/macros/t17836.nim b/tests/macros/t17836.nim new file mode 100644 index 000000000..2453637f5 --- /dev/null +++ b/tests/macros/t17836.nim @@ -0,0 +1,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) \ No newline at end of file -- cgit 1.4.1-2-gfad0