summary refs log tree commit diff stats
path: root/tests/objects/tobjconstr2.nim
blob: cb47e146dcf6f42ada7f8bea13c539919833b8c8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
type TFoo{.exportc.} = object
 x:int

var s{.exportc.}: seq[TFoo] = @[]

s.add TFoo(x: 42)

echo s[0].x


# bug #563
type
  Foo =
    object {.inheritable.}
      x: int

  Bar =
    object of Foo
      y: int

var a = Bar(y: 100, x: 200) # works
var b = Bar(x: 100, y: 200) # used to fail