Skip to content

Private field is not resolved properly in templates #3770

@yglukhov

Description

@yglukhov
# a.nim import b, c var f: Foo let nb = newBar(f.field)
# b.nim type Bar* = tuple[x: int] template newBar*(b: int): Bar = (x: b).Bar
# c.nim type Foo* = object mField: int template field*(f: Foo): int = f.mField

Error:

$ nim c a.nim a.nim(4, 16) template/generic instantiation from here c.nim(4, 33) Error: undeclared field: 'mField' 

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions