iverilog/ivtest/ivltests/sv_class_compat_fail1.v

23 lines
312 B
Coq
Raw Normal View History

// Check that an error is reported when trying to assign an object to variable
// of an unrelated class type
module test;
class B;
int x;
endclass
class C;
int y;
endclass
B b;
C c;
initial begin
c = new;
b = c; // This should fail, both classes are unrelated
end
endmodule