diff options
author | Araq <rumpf_a@web.de> | 2012-01-07 20:30:51 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2012-01-07 20:30:51 +0100 |
commit | 7f3b3298b4dc2be10febebc383f42187f968135e (patch) | |
tree | 241350ba9c93d1c2a1974df60ce23279b634e511 /tests/compile | |
parent | 7405278138f4e76d5e6278b3ed25f953ba9260e1 (diff) | |
download | Nim-7f3b3298b4dc2be10febebc383f42187f968135e.tar.gz |
fixes #33
Diffstat (limited to 'tests/compile')
-rwxr-xr-x | tests/compile/tgenericrefs.nim | 36 |
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 |