Is function declaration statement

23 views
Skip to first unread message

Alexandre Ardhuin

unread,
Jun 9, 2021, 3:25:12 PM6/9/21
to analyzer...@dartlang.org
Hi,

I have a visitor with a visitNamedCompilationUnitMember method.
Is it intended that this method is called for function declarations inside block?
I didn't think this could be considered as a compilation unit member.

Alexandre

Brian Wilkerson

unread,
Jun 9, 2021, 4:25:19 PM6/9/21
to Dart Analyzer Discussion
Is it intended that this method is called for function declarations inside block?

No it isn't. Function declarations appearing inside a block are not compilation unit members, despite the confusion in the `AstNode` hierarchy. Top-level functions are.

That's a bug in the visitor. I'll send out a CL shortly to fix it.

--
You received this message because you are subscribed to the Google Groups "Dart Analyzer Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to analyzer-discu...@dartlang.org.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/analyzer-discuss/CAPiP%2BguBzuvh1JGD8M_r%3DjDA8r3Nk56HsX8ntAfKZ7Z9L9ivPg%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages