Implicit case statements are created during ModelProcessingPhase.FULL_DECLARATION, i.e. while statements are still being loaded.
This leads to them being created in reactor.StatementMap as SubstatementContexts and thus part of StmtContext.declaredSubstatements() – which is what statement inference expects.
When we are building DeclaredStatement, though, we do not want to emit implicit cases, we want to essentially reconstruct what we got from StatementStreamSource.
Rework internal reactor interfaces and implementation to differentiate between declared statement tree (no implicit cases) and effective statement tree (with effective cases).
- relates to
-
YANGTOOLS-1407 Attempted access to undeclared case statement
- Resolved