Skip to content
This repository was archived by the owner on Nov 11, 2021. It is now read-only.
This repository was archived by the owner on Nov 11, 2021. It is now read-only.

new_infrastructure: Nodes with same field are not distinguished #34

@havogt

Description

@havogt

If I have

class FieldAccess(Expr):
    name: Str

class VarAccess(Expr):
    name: Str

the visitor will not distinguish the 2 nodes. It will enter visit_FieldAccess even for VarAccess. This can be solved by type annotating the visit method's node argument.

However, no such workaround exists for the templates in the TemplatedGenerator. Adding an extra field in one of the 2 classes works, e.g.

class VarAccess(Expr):
    name: Str
    dummy: Optional[str]

Metadata

Metadata

Assignees

Labels

eveRelated to eve infrastructure

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions