summary refs log tree commit diff stats
path: root/tests/compile
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2012-01-07 20:30:51 +0100
committerAraq <rumpf_a@web.de>2012-01-07 20:30:51 +0100
commit7f3b3298b4dc2be10febebc383f42187f968135e (patch)
tree241350ba9c93d1c2a1974df60ce23279b634e511 /tests/compile
parent7405278138f4e76d5e6278b3ed25f953ba9260e1 (diff)
downloadNim-7f3b3298b4dc2be10febebc383f42187f968135e.tar.gz
fixes #33
Diffstat (limited to 'tests/compile')
-rwxr-xr-xtests/compile/tgenericrefs.nim36
1 files changed, 17 insertions, 19 deletions
diff --git a/tests/compile/tgenericrefs.nim b/tests/compile/tgenericrefs.nim
index 3b7940098..ef931dfa7 100755
--- a/tests/compile/tgenericrefs.nim
+++ b/tests/compile/tgenericrefs.nim
@@ -1,28 +1,26 @@
-discard """
-  disabled: true
-"""
-
-# Compiles:
-
 type 
-  TA[T] = object
   PA[T] = ref TA[T]
+  TA[T] = object
+    field: T
 var a: PA[string]
+new(a)
+a.field = "some string"
 
-# Compiles unless you use var a: PA[string]
-type 
-  PA = ref TA
-  TA[T] = object
+when false:
+  # Compiles unless you use var a: PA[string]
+  type 
+    PA = ref TA
+    TA[T] = object
 
 
-# Cannot instantiate:
-type 
-  TA[T] = object
-    a: PA[T]
-  PA[T] = ref TA[T]
+  # Cannot instantiate:
+  type 
+    TA[T] = object
+      a: PA[T]
+    PA[T] = ref TA[T]
 
-type 
-  PA[T] = ref TA[T]
-  TA[T] = object
+  type 
+    PA[T] = ref TA[T]
+    TA[T] = object