title: How to assign an unpacked array of real?
body: <p>While updating Modelsim from 10.3c to 10.6a, I encountered an error on this piece of code that used to not work without warning:</p>
  
  <pre><code>module test(
      input bit clk,
      input bit signed[31:0] data
  );
  
      real rdata_dl[19:0] = '{20{0}};
      real rdata = 0;
  
      always @(posedge clk) begin
          rdata_dl = {rdata_dl[18:0], rdata};
          rdata = data;
      end
  
  endmodule
  </code></pre>
  
  <blockquote>
    <p>-- Compiling module test</p>
    
    <p>** Note: test.sv(10): (vlog-13177) Promoting concatenation '{rdata_dl[18:0],rdata}' to an assignment pattern:  Assigning to a real/wreal array.</p>
    
    <p>** Error (suppressible): (vlog-13215) test.sv(10): Assignment pattern element 'rdata_dl[18:0]':  Cannot assign an unpacked type 'real $[18:0]' to a packed type 'real'.</p>
    
    <p>** Error (suppressible): test.sv(10): (vlog-13174) Illegal assignment pattern. The number of elements (2) doesn't match with the type's width (20).</p>
  </blockquote>
  
  <p>I managed to fix it by using this line instead: <code>rdata_dl = {rdata_dl[18:0], real'(rdata)};</code>.</p>
  
  <p>However, I fail to understand why it failed and why the new version would work. Can anyone explain?</p>