Description
See the attached model. When passing this to the YANG parser with either no features defined or without the "configured" feature defined on the ietf-subscribed-notifications module, the YANG parser gives the following error:
Caused by: org.opendaylight.yangtools.yang.parser.spi.meta.InferenceException: Refine target node Relative{path=[(urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications?revision=2019-09-09)transport]} not found. [at /home/verthezp/tmp/bugs/refinebug/ietf-subscribed-notifications.yang:1148:8]
The reason is that the "transport" node is under an "if-feature configured", but the refine statement is not.
Since all the modules in this example are IETF standard models, it probably indicates that the design of the ODL parser, which removes nodes under an if-feature first before proceeding to process the model, is wrong. We had related bugs such as YANGTOOLS-803, but there we always fixed it by making sure that the if-feature was given both at the target and the statement modifying it. I see also YANGTOOLS-811, which was rejected. I was previously also under the impression that that decision was correct, but looking at these standard models, that decision may be wrong, and the YANG parser may have to change.
We are currently on YANG parser version 2.1.8, I haven't checked this yet with newer versions.