summary refs log tree commit diff stats
path: root/tests/objects/tinherentedvalues.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/objects/tinherentedvalues.nim')
-rw-r--r--tests/objects/tinherentedvalues.nim55
1 files changed, 0 insertions, 55 deletions
diff --git a/tests/objects/tinherentedvalues.nim b/tests/objects/tinherentedvalues.nim
deleted file mode 100644
index c96a0fd6d..000000000
--- a/tests/objects/tinherentedvalues.nim
+++ /dev/null
@@ -1,55 +0,0 @@
-discard """
-  output: '''tbObj of TC false
-false
-true
-5
-false'''
-"""
-
-# bug #1053
-type
-  TA = object of TObject
-    a: int
-
-  TB = object of TA
-    b: int
-
-  TC = object of TB
-    c: int
-
-proc test(p: TA) =
-  #echo "p of TB ", p of TB
-  if p of TB:
-    var tbObj = TB(p)
-
-    # tbObj is actually no longer compatible with TC:
-    echo "tbObj of TC ", tbObj of TC
-
-var v = TC()
-v.a = 1
-v.b = 2
-v.c = 3
-test(v)
-
-
-# bug #924
-type
-  MyObject = object of TObject
-    x: int
-
-var
-  asd: MyObject
-
-proc isMyObject(obj: TObject) =
-    echo obj of MyObject
-    if obj of MyObject:
-        let a = MyObject(obj)
-        echo a.x
-
-asd.x = 5
-
-var asdCopy = TObject(asd)
-echo asdCopy of MyObject
-
-isMyObject(asd)
-isMyObject(asdCopy)