Declaration of a Default Value on 2 Dimensional Array

I wanted to see if anyone had some ideas about why I would be getting the following error in lattice radiant synthesis (note ive also reached out to lattice to resolve this issue and im just looking for ideas syntactically):
‘ERROR default field of an assignment pattern cannot contain another assignment pattern’

Ill explain the setup below:

I have a package that looks like this:

package lib_parser_pkg;

localparam NUM_PSTACK = 256;
localparam PROT_DEPTH = 8;

typedef hdr::pkt_types_e stack_t [NUM_PSTACK][PROT_DEPTH];

endpackage : lib_parser_pkg

I than feed and define this as a parameter value into modules as the following:

parameter lib_parser_pkg::stack_t PSTACKS =
 '{ 0:'{0:hdr::ETH, default:hdr::UNKNOWN},
    1:'{0:hdr::ETH, 1:hdr::IPV4, default:hdr::UNKNOWN},
    2:'{0:hdr::ETH, 1:hdr::IPV6, default:hdr::UNKNOWN},
    default: '{default:hdr::UNKNOWN}
  },

Ultimately, I do this so that I can just loop until I see UNKOWN and I know ive reached the end since the pstacks value can vary from module to module.
The fix ive found for this error currently is that the tool doesnt like having a default within a default and would look like this:

parameter lib_parser_pkg::stack_t PSTACKS =
 '{ 0:'{0:hdr::ETH, default:hdr::UNKNOWN},
    1:'{0:hdr::ETH, 1:hdr::IPV4, default:hdr::UNKNOWN},
    2:'{0:hdr::ETH, 1:hdr::IPV6, default:hdr::UNKNOWN},
    default: hdr::UNKNOWN
  },

Does anyone know of a good way to initialize a 2-d array with default values without knowing the size ahead of time.

**NOTE that the first option works for intel, but not for lattice

BTW, it really helps to give us a complete example.

The problem is a default doen’t supply a context specific enough to use an assigment pattern. You can fix that by using a cast (which does provide an assignment-like context) to an intermediate data type.

package hdr;
typedef enum {UNKNOWN, ETH, IPV4, IPV6} pkt_types_e;
endpackage
package lib_parser_pkg;

localparam NUM_PSTACK = 8;
localparam PROT_DEPTH = 4;

typedef hdr::pkt_types_e stack_1d_t [PROT_DEPTH]; // 1st dimension intermediate type

typedef stack_1d_t stack_t [NUM_PSTACK]; 

endpackage : lib_parser_pkg
module top;
  parameter lib_parser_pkg::stack_t PSTACKS = '{
    0:'{0:hdr::ETH, default:hdr::UNKNOWN},
    1:'{0:hdr::ETH, 1:hdr::IPV4, default:hdr::UNKNOWN},
    2:'{0:hdr::ETH, 1:hdr::IPV6, default:hdr::UNKNOWN},
    default: lib_parser_pkg::stack_1d_t'('{default: hdr::UNKNOWN})
  };
  initial $display("%p", PSTACKS);
endmodule