@@ -858,16 +858,17 @@ fn resolveReturnValueOfFuncNode(
858858 const fn_proto = tree .fullFnProto (& buf , func_node ).? ;
859859 const has_body = tree .nodeTag (func_node ) == .fn_decl ;
860860
861- if (isTypeFunction (tree , fn_proto ) and has_body ) {
861+ if (isTypeFunction (tree , fn_proto )) {
862+ if (! has_body ) return .unknown_type ;
862863 const body = tree .nodeData (func_node ).node_and_node [1 ];
863864 // If this is a type function and it only contains a single return statement that returns
864865 // a container declaration, we will return that declaration.
865- const return_node = findReturnStatement (tree , body ) orelse return null ;
866+ const return_node = findReturnStatement (tree , body ) orelse return .unknown_type ;
866867 if (tree .nodeData (return_node ).opt_node .unwrap ()) | return_expr | {
867- return try analyser .resolveTypeOfNodeInternal (.of (return_expr , handle ));
868+ return try analyser .resolveTypeOfNodeInternal (.of (return_expr , handle )) orelse .unknown_type ;
868869 }
869870
870- return null ;
871+ return .unknown_type ;
871872 }
872873
873874 const return_type = fn_proto .ast .return_type .unwrap () orelse return null ;
@@ -2430,7 +2431,7 @@ fn resolveTypeOfNodeUncached(analyser: *Analyser, options: ResolveOptions) Error
24302431 else = > unreachable ,
24312432 }
24322433 }
2433- break :param_type Type . fromIP ( analyser , .type_type , . unknown_type) ;
2434+ break :param_type . unknown_type ;
24342435 };
24352436
24362437 try parameters .append (analyser .arena , .{
0 commit comments