Repository navigation
Handle unresolved identity bases safely - #55
Deepya1502 wants to merge 2 commits into
Conversation
lllyfeng
left a comment
There was a problem hiding this comment.
The deferred resolution makes sense, but on its own this PR regresses: BaseImpl's GRAMMAR case (L44-45) now swallows the ModelException, and the SCHEMA_BUILD case (L49-59) never runs because BASE is registered for GRAMMAR only on main. A module with base x:does-not-exist validates OK with this PR alone (main reports UNRECOGNIZED_IDENTITY). Please include the YangStatementImplRegister change (BASE → GRAMMAR, SCHEMA_BUILD) in this PR (and drop it from #48), and add tests: unresolved base → error; base in another module resolved in SCHEMA_BUILD → OK; isDerived/isDerivedOrSelf with an unresolved base doesn't NPE.
|
Addressed the follow-up: BASE is registered for GRAMMAR and SCHEMA_BUILD in this PR, with tests for unresolved bases, later-loaded imported bases, and null-safe derived checks. Full |
lllyfeng
left a comment
There was a problem hiding this comment.
Thanks — the BASE registration change now lives here, an unresolved base is reported again standalone (verified locally), and IdentityBaseResolutionTest covers the unresolved, cross-module and null-safe derived cases. #48 has been merged; please rebase onto main (YangStatementImplRegister conflict; keep #48's removal of the duplicate BASE registration, with a single BASE line registered for GRAMMAR and SCHEMA_BUILD).
db9b1a7 to
1d9ad43
Compare
|
Rebased onto current main after #48 merged. The conflict is resolved with a single BASE registration for GRAMMAR and SCHEMA_BUILD. IdentityBaseResolutionTest verifies unresolved bases remain errors, later-loaded imports resolve, and derived checks are null-safe; clean full-reactor |
Summary
Separates Base/Identity resolution from YANG Library integration PR #48, as requested in its review.
GRAMMARwhen imported modules are available, then retry duringSCHEMA_BUILDwhen they are not.GRAMMARandSCHEMA_BUILD, so unresolved bases are reported and later-loaded imported identities resolve.isDerivedandisDerivedOrSelf.Verification
IdentityBaseResolutionTestcovers an unresolved base error, a base imported from a later-loaded module, and null-safe derived checks. The branch is rebased onto currentmain; a clean full-reactormvn testpasses.