From 01ca3ba26d28c5f645b0fc30fca1f386970d120d Mon Sep 17 00:00:00 2001 From: mjendrusch Date: Sun, 17 Apr 2016 17:11:02 +0200 Subject: Added test case Previously offending code --- tests/cpp/ttemplatetype.nim | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 tests/cpp/ttemplatetype.nim (limited to 'tests') diff --git a/tests/cpp/ttemplatetype.nim b/tests/cpp/ttemplatetype.nim new file mode 100644 index 000000000..7f56a225d --- /dev/null +++ b/tests/cpp/ttemplatetype.nim @@ -0,0 +1,9 @@ +type + Map {.importcpp: "std::map", header: "".} [T,U] = object + +proc cInitMap(T: typedesc, U: typedesc): Map[T,U] {.importcpp: "std::map<'*1,'*2>()", nodecl.} + +proc initMap[T, U](): Map[T, U] = + result = cInitMap(T, U) + +var x: Map[cstring, cint] = initMap[cstring, cint]() -- cgit 1.4.1-2-gfad0