parser yang CHANGE YANG 1.1 support all types in union
diff --git a/src/parser_yang.c b/src/parser_yang.c
index a2f914b..16c04b0 100644
--- a/src/parser_yang.c
+++ b/src/parser_yang.c
@@ -1211,12 +1211,14 @@
tpdftype ? UNRES_TYPE_DER_TPDF : UNRES_TYPE_DER, parent) == -1) {
goto error;
}
- if (typ->type->info.uni.types[i].base == LY_TYPE_EMPTY) {
- LOGVAL(LYE_INARG, LY_VLOG_NONE, NULL, "empty", typ->name);
- goto error;
- } else if (typ->type->info.uni.types[i].base == LY_TYPE_LEAFREF) {
- LOGVAL(LYE_INARG, LY_VLOG_NONE, NULL, "leafref", typ->name);
- goto error;
+ if (module->version < 2) {
+ if (typ->type->info.uni.types[i].base == LY_TYPE_EMPTY) {
+ LOGVAL(LYE_INARG, LY_VLOG_NONE, NULL, "empty", typ->name);
+ goto error;
+ } else if (typ->type->info.uni.types[i].base == LY_TYPE_LEAFREF) {
+ LOGVAL(LYE_INARG, LY_VLOG_NONE, NULL, "leafref", typ->name);
+ goto error;
+ }
}
}
break;