outreg->children.push_back($4);
outreg->is_signed = $4->is_signed;
$4->is_signed = false;
+ outreg->is_custom_type = $4->type == AST_WIRETYPE;
}
current_function_or_task->children.push_back(outreg);
current_function_or_task_port_id = 1;
};
func_return_type:
+ hierarchical_type_id {
+ $$ = new AstNode(AST_WIRETYPE);
+ $$->str = *$1;
+ delete $1;
+ } |
opt_type_vec opt_signedness_default_unsigned {
$$ = makeRange(0, 0, $2);
} |
--- /dev/null
+typedef logic [1:0] T;
+
+package P;
+ typedef logic [3:0] S;
+endpackage
+
+module gate(
+ output wire [31:0] out1, out2
+);
+ function automatic T func1;
+ input reg signed inp;
+ func1 = inp;
+ endfunction
+ assign out1 = func1(1);
+ function automatic P::S func2;
+ input reg signed inp;
+ func2 = inp;
+ endfunction
+ assign out2 = func2(1);
+endmodule
+
+module gold(
+ output wire [31:0] out1, out2
+);
+ function automatic [1:0] func1;
+ input reg signed inp;
+ func1 = inp;
+ endfunction
+ assign out1 = func1(1);
+ function automatic [3:0] func2;
+ input reg signed inp;
+ func2 = inp;
+ endfunction
+ assign out2 = func2(1);
+endmodule