MikePopoloski / slang

SystemVerilog compiler and language services
MIT License
546 stars 114 forks source link

Pattern variables are not visible from initializers in child scope #944

Open MikePopoloski opened 1 month ago

MikePopoloski commented 1 month ago
module m;
    int i;
    always_comb begin
        if (i matches .a) begin
            automatic int pc = a; // 5
        end
    end
endmodule

This reports an error, but works if pc is declared in a parent scope and just assigned on line 5 instead.