start of tests refactoring; sqlite3 new wrapper fixes
This commit is contained in:
parent
6bc16904ed
commit
d913fdb280
173 changed files with 206 additions and 238 deletions
17
tests/accept/compile/tobjcov.nim
Normal file
17
tests/accept/compile/tobjcov.nim
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
# 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: proc (x: var TA) = bp
|
||||
var a: TA
|
||||
f(a) # bp expects a TB, but gets a TA
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue