mirror of
https://github.com/nim-lang/Nim.git
synced 2026-05-02 12:04:44 +00:00
next steps for closure iterators
This commit is contained in:
22
tests/objects/tobjconstr2.nim
Normal file
22
tests/objects/tobjconstr2.nim
Normal file
@@ -0,0 +1,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
|
||||
Reference in New Issue
Block a user