MikePopoloski / slang

SystemVerilog compiler and language services
MIT License
558 stars 122 forks source link

Incorrect hierarchical reference in error message #1013

Closed udif closed 3 weeks ago

udif commented 3 weeks ago

Describe the bug When testing the following code (failing to add packed by mistake):

module t40;
typedef struct {
        logic a;
        logic b;
} t;
t x, y, z;
assign z = x & y;

endmodule

Yields the following error message:

% slang  udif_tests/t40.v
Top level design units:
    t40

udif_tests/t40.v:7:14: error: invalid operands to binary expression ('t40.t' and 't40.t40.t')
assign z = x & y;
           ~ ^ ~

Build failed: 1 error, 0 warnings

Additional context I expect the test to fail, but the hierarchical reference t40.t40.t is meaningless.

MikePopoloski commented 3 weeks ago

Fixed in 0371eb75a8ec7bb4c34c97a0da0cb92f6911b9b3