summary refs log tree commit diff stats
path: root/tests/macros
diff options
context:
space:
mode:
Diffstat (limited to 'tests/macros')
-rw-r--r--tests/macros/tquotedo.nim15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/macros/tquotedo.nim b/tests/macros/tquotedo.nim
index 0aae87bf0..6acb8ef4e 100644
--- a/tests/macros/tquotedo.nim
+++ b/tests/macros/tquotedo.nim
@@ -4,6 +4,7 @@ output: '''
 Hallo Welt
 Hallo Welt
 1
+()
 '''
 """
 
@@ -34,3 +35,17 @@ macro t(): untyped =
 t()
 
 echo tp()
+
+
+# https://github.com/nim-lang/Nim/issues/9866
+type
+  # Foo = int # works
+  Foo = object # fails
+
+macro dispatchGen(): untyped =
+  var shOpt: Foo
+  result = quote do:
+    let baz = `shOpt`
+    echo `shOpt`
+
+dispatchGen()
e> 2017-10-28 09:25:56 +0200 TinyC upgrade (#6593)' href='/ahoang/Nim/commit/tinyc/include/stddef.h?h=devel&id=d2c7d391c8b69a6a590a2f702ed58bea033f6325'>d2c7d391c ^
47886978c ^

d2c7d391c ^

47886978c ^


d2c7d391c ^














1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54