mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-06 04:57:49 +00:00
fixes #1274
This commit is contained in:
@@ -1125,7 +1125,7 @@ proc genObjConstr(p: BProc, e: PNode, d: var TLoc) =
|
||||
ty = getUniqueType(ty.sons[0])
|
||||
if field == nil or field.loc.r == nil: internalError(e.info, "genObjConstr")
|
||||
if it.len == 3 and optFieldCheck in p.options:
|
||||
genFieldCheck(p, it.sons[2], r, field)
|
||||
genFieldCheck(p, it.sons[2], tmp2.r, field)
|
||||
app(tmp2.r, ".")
|
||||
app(tmp2.r, field.loc.r)
|
||||
tmp2.k = locTemp
|
||||
|
||||
@@ -32,3 +32,19 @@ type
|
||||
size: tuple[w, h: float]
|
||||
|
||||
var d = Graphic(kind: 1, size: (12.9, 6.9))
|
||||
|
||||
# bug #1274
|
||||
type
|
||||
K = enum Koo, Kar
|
||||
Graphic2 = object of RootObj
|
||||
case kind: K
|
||||
of Koo:
|
||||
radius: float
|
||||
of Kar:
|
||||
size: tuple[w, h: float]
|
||||
|
||||
type NamedGraphic = object of Graphic2
|
||||
name: string
|
||||
|
||||
var ngr = NamedGraphic(kind: Koo, radius: 6.9, name: "Foo")
|
||||
echo ngr.name
|
||||
|
||||
Reference in New Issue
Block a user