Fix isSupportedToBuildEffective() propagation 18/103318/2
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 22 Nov 2022 17:47:49 +0000 (18:47 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 22 Nov 2022 19:42:52 +0000 (20:42 +0100)
commite31531765d8ae6e3bc36f3de4ae4e14e06568e83
tree5c2d809424ddf1d8e3d7866c67de8c4164082ad2
parent94f35afbda71f4a07a44ef0cee54923bd8f7e5ec
Fix isSupportedToBuildEffective() propagation

InferredStatementContext has bad interaction with ImplictStmtCtx -- the
latter fizzles when it is not supported by features. This leads to a
failure to build effective context, as the prototype cannot be built and
therefore an attempt to reuse it fails.

Adjust InferredStatementContext to check if its prototype can be built
and carry over that fact when it is not.

JIRA: YANGTOOLS-1465
Change-Id: Iad05b0c6a06b6d9f837b70ced0da8cdc8ed3ed97
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
parser/yang-parser-reactor/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/reactor/InferredStatementContext.java
parser/yang-parser-reactor/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/reactor/ReactorStmtCtx.java
parser/yang-parser-rfc7950/src/test/java/org/opendaylight/yangtools/yang/stmt/YT1465Test.java [new file with mode: 0644]
parser/yang-parser-rfc7950/src/test/resources/bugs/YT1465/foo.yang [new file with mode: 0644]