diff options
Diffstat (limited to 'tests/template')
-rw-r--r-- | tests/template/ttempl5.nim | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/template/ttempl5.nim b/tests/template/ttempl5.nim index 1f2378780..a020a8e2c 100644 --- a/tests/template/ttempl5.nim +++ b/tests/template/ttempl5.nim @@ -16,3 +16,14 @@ get_next_ident() #identifier expected, but found '(open|open|open)' + +#bug #880 (also example in the manual!) + +template typedef(name: expr, typ: typedesc) {.immediate.} = + type + `T name`* {.inject.} = typ + `P name`* {.inject.} = ref `T name` + +typedef(myint, int) +var x: PMyInt + |