Hi,
In the below code I want to print the type of the class from which newStack extends. I got a compilation error as below
“Expression T has no value.” in the display method
class newStack #(type T = stack#(int,10), string name = "pkt_stack") extends T;
function void print_type();
$display("this class is extended from type %0p, name of stack is %0s",T,name);
endfunction:print_type
endclass:newStack
Classes with the same name can be declared in different scopes, including different compilation units ($unit). How each compilation unit gets a unique name is tool specific. Create string names for parameterized classes is also going to be tool specific. Please check your tool documentation or contact them directly.