netmod-wg / yang-next

Feature requests for future versions of YANG
6 stars 0 forks source link

Don't treat non-exist import module as a error if there is no any effective reference to this import module in current module #114

Open lllyfeng opened 1 year ago

lllyfeng commented 1 year ago

for instance, module import-module { prefix im; //definitions leaf bar { type boolean; } }

module cur-module { prefix cur; import import-module { prefix im;
}

leaf foo { type string; when "/im:bar"; } }

module dev-module { import cur-module { prefix cur; } deviation "cur:foo" { deviate not-supported; } }

In this example, module cur-module has no leaf foo in effect, So actually, the import-module is no useful for cur-module, but cur-module MUST be provided to ensure a successful compliation. I suggest it should not be treated as error when a import module is actually no useful.

abierman commented 1 week ago

Do not support this change. This is not possible to implement since the deviation module is not known when the main module is parsed.

A related issue:

If the prefix is used in the importing module then the imported module MUST be found.

More Discuss: complexity: high, bc: medium, importance: low