In reply to ilia:
Few modification to your code and it works
interface test_if;
endinterface : test_if
class test_class;
endclass : test_class
function automatic int test_func(test_class classes[], virtual interface test_if ifs[] = {});
if (classes.size() == 0)
return 0;
else
return 1;
endfunction : test_func
module main();
test_class cls_arr[];
bit ret;
initial begin
ret = test_func(cls_arr);
$display("ret:%0d",ret);
end
endmodule