summary refs log tree commit diff stats
path: root/tests/compile/tobjcov.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/compile/tobjcov.nim')
-rwxr-xr-xtests/compile/tobjcov.nim17
1 files changed, 0 insertions, 17 deletions
diff --git a/tests/compile/tobjcov.nim b/tests/compile/tobjcov.nim
deleted file mode 100755
index 17bc8d80d..000000000
--- a/tests/compile/tobjcov.nim
+++ /dev/null
@@ -1,17 +0,0 @@
-# Covariance is not type safe:
-
-type
-  TA = object
-    a: int
-  TB = object of TA
-    b: array[0..5000_000, int]
-    
-proc ap(x: var TA) = x.a = -1
-proc bp(x: var TB) = x.b[high(x.b)] = -1
-    
-# in Nimrod proc (x: TB) is compatible to proc (x: TA),
-# but this is not type safe:
-var f = cast[proc (x: var TA)](bp)
-var a: TA
-f(a) # bp expects a TB, but gets a TA
-