diff options
Diffstat (limited to 'tests/objects')
-rw-r--r-- | tests/objects/tobjcov.nim | 4 | ||||
-rw-r--r-- | tests/objects/tobject.nim | 2 | ||||
-rw-r--r-- | tests/objects/tobject3.nim | 2 | ||||
-rw-r--r-- | tests/objects/tobjects.nim | 2 | ||||
-rw-r--r-- | tests/objects/tobjpragma.nim | 10 | ||||
-rw-r--r-- | tests/objects/tofopr.nim | 8 | ||||
-rw-r--r-- | tests/objects/toop.nim | 6 |
7 files changed, 17 insertions, 17 deletions
diff --git a/tests/objects/tobjcov.nim b/tests/objects/tobjcov.nim index 8391727f2..cf2e5becf 100644 --- a/tests/objects/tobjcov.nim +++ b/tests/objects/tobjcov.nim @@ -5,10 +5,10 @@ type 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 Nim proc (x: TB) is compatible to proc (x: TA), # but this is not type safe: var f = cast[proc (x: var TA) {.nimcall.}](bp) diff --git a/tests/objects/tobject.nim b/tests/objects/tobject.nim index 5fec84441..cdb8f80db 100644 --- a/tests/objects/tobject.nim +++ b/tests/objects/tobject.nim @@ -3,7 +3,7 @@ import unittest type Obj = object foo: int -proc makeObj(x: int): Obj = +proc makeObj(x: int): Obj = result.foo = x suite "object basic methods": diff --git a/tests/objects/tobject3.nim b/tests/objects/tobject3.nim index 85cf1cfe3..2d9c8d023 100644 --- a/tests/objects/tobject3.nim +++ b/tests/objects/tobject3.nim @@ -4,7 +4,7 @@ type TFoo = ref object of RootObj - Data: int + Data: int TBar = ref object of TFoo nil TBar2 = ref object of TBar diff --git a/tests/objects/tobjects.nim b/tests/objects/tobjects.nim index 06fa15583..2f46b46b5 100644 --- a/tests/objects/tobjects.nim +++ b/tests/objects/tobjects.nim @@ -18,7 +18,7 @@ type of 0: arg: char of 1: s: string else: wtf: bool - + var x: TMyObject diff --git a/tests/objects/tobjpragma.nim b/tests/objects/tobjpragma.nim index dda8057b6..0a6cc893b 100644 --- a/tests/objects/tobjpragma.nim +++ b/tests/objects/tobjpragma.nim @@ -12,7 +12,7 @@ discard """ # Disabled since some versions of GCC ignore the 'packed' attribute -# Test +# Test type Foo {.packed.} = object @@ -21,12 +21,12 @@ type Bar {.packed.} = object a: int8 - b: int16 - + b: int16 + Daz {.packed.} = object a: int32 - b: int8 - c: int32 + b: int8 + c: int32 var f = Foo(a: 1, b: 1) diff --git a/tests/objects/tofopr.nim b/tests/objects/tofopr.nim index 961d81bd3..ab2854571 100644 --- a/tests/objects/tofopr.nim +++ b/tests/objects/tofopr.nim @@ -8,12 +8,12 @@ type TMyType = object {.inheritable.} len: int data: string - + TOtherType = object of TMyType - -proc p(x: TMyType): bool = + +proc p(x: TMyType): bool = return x of TOtherType - + var m: TMyType n: TOtherType diff --git a/tests/objects/toop.nim b/tests/objects/toop.nim index 0b42c2c22..ebc59f637 100644 --- a/tests/objects/toop.nim +++ b/tests/objects/toop.nim @@ -5,13 +5,13 @@ discard """ type TA = object of TObject x, y: int - + TB = object of TA z: int - + TC = object of TB whatever: string - + proc p(a: var TA) = echo "a" proc p(b: var TB) = echo "b" |