jroesch commented on a change in pull request #6274:
URL: https://github.com/apache/incubator-tvm/pull/6274#discussion_r493099472



##########
File path: src/parser/parser.cc
##########
@@ -1527,29 +1699,50 @@ class Parser {
 
   // Parses a user defined ADT or type variable.
   Type ParseNonPrimitiveType(const Token& tok) {
-    auto name = tok.ToString();
-    Type head_type;
-    auto global_type = type_names.Get(name);
+    return WithSpan<Type>([&]() {
+      auto name = tok.ToString();
+      Type head_type = LookupTypeVar(tok);
 
-    if (!global_type) {
-      head_type = LookupTypeVar(tok);
-    } else {
-      head_type = global_type.value();
-    }
+      if (!head_type.defined()) {
+        // head_type = type_names.Get(name);
+        head_type = AddOrGet(&type_names, name, TypeKind::kAdtHandle);
+      }
 
-    CHECK(head_type.defined()) << "internal error: head type must be defined";
+      // if (!var.defined()) {

Review comment:
       We now lazily resolve names in order to defer handling, we will merge 
checking this into the well-formed check in follow up work to clean up the 
handling of this. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to