parser yang CHANGE support typedef in extension instance
diff --git a/src/parser_yang.c b/src/parser_yang.c
index 74f9821..e1f452a 100644
--- a/src/parser_yang.c
+++ b/src/parser_yang.c
@@ -4462,6 +4462,10 @@
     dev_size = module->deviation_size;
     module->deviation_size = 0;
 
+    if (yang_check_typedef(module, NULL, unres)) {
+        goto error;
+    }
+
     if (yang_check_ext_instance(module, &module->ext, module->ext_size, module, unres)) {
         goto error;
     }
@@ -4480,10 +4484,6 @@
         }
     }
 
-    if (yang_check_typedef(module, NULL, unres)) {
-        goto error;
-    }
-
     /* check features */
     for (i = 0; i < module->features_size; ++i) {
         if (yang_check_iffeatures(module, NULL, &module->features[i], FEATURE_KEYWORD, unres)) {