mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-18 13:30:33 +00:00
fixes #563
This commit is contained in:
@@ -1672,6 +1672,7 @@ proc semObjConstr(c: PContext, n: PNode, flags: TExprFlags): PNode =
|
||||
var
|
||||
check: PNode = nil
|
||||
f: PSym
|
||||
t = objType
|
||||
while true:
|
||||
check = nil
|
||||
f = lookupInRecordAndBuildCheck(c, it, t.n, id, check)
|
||||
|
||||
@@ -6,3 +6,17 @@ 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