I am attaching the case with it.
module top;
reg [1:0] arr;
reg [2:0] arr_asgn;
assign arr = {'{ default: arr_asgn[2] }};
endmodule
I am attaching the case with it.
module top;
reg [1:0] arr;
reg [2:0] arr_asgn;
assign arr = {'{ default: arr_asgn[2] }};
endmodule
this is syntactically incorrect. You have an assigment pattern inside a concat {}. There is no assignment context there. You have to remove external braces:
assign arr = '{ default: arr_asgn[2] };
This is syntactically incorrect. As you are trying to assign a 2-D array to 1-D packed array. According to LRM either right-hand side should be 2-d like this.
arr[1:0][1:0];
assign arr = '{'{default:1}, '{default:0} }
or it should be
assign arr = '{default:1}