From 6a94ca318782de9a3bd0a20f69b5c2ecde3a0dba Mon Sep 17 00:00:00 2001 From: Araq Date: Tue, 1 Apr 2014 08:17:23 +0200 Subject: fixes #880 --- tests/template/ttempl5.nim | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests/template') 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 + -- cgit 1.4.1-2-gfad0