On Thursday, 22 February 2018 at 13:21:04 UTC, joe wrote:
On Monday, 12 February 2018 at 08:47:58 UTC, RazvanN wrote:

Follow up question...

Why is *.parent always null?

extern(C++) class MyVisitor(AST): ParseTimeTransitiveVisitor!AST
  override void visit(AST.Import i)
    assert(i.parent is null); // always true

  override void visitFuncBody(AST.FuncDeclaration f)
    assert(f.parent is null); // always true

I think parent is only set after sema.
and you are overriding the parsetime visitor.

Reply via email to