Make declared statement inheritance a StatementContextBase property
We have inconsistencies between handling of inference-time and build-time
declared statements. When a declared statement is created in reactor,
its declared view will be materialized at the statement itself, not
in the original context.
This means statements which are subject to (even unused!) inference
will create a disconnected declared view. Statements which are not
infered, will correctly reuse declared instances with their origin.
Fix this by making following of getOriginalCtx() an implementation
given in StatementContextBase, resulting in centralized code and
consistent results.
JIRA: YANGTOOLS-652
Change-Id: Id8afb814821398e416afbfc6c9e3aeeb789f94a8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
af62dc4257be32f92c6e8506fa8dabfe8a9976cd)
(cherry picked from commit
d121fc53d32b799c493cbe7da6b9d061fe7b9564)