Dynamic array default value in task/function

In reply to dave_59:

Hi Dave,

Thank you for the answer.

So when I want to set a dynamic array to an empty set of elements I use this syntax:

other_enum_t      _b [] = {}; // or other_enum_t      _b [] = '{default:0};

But, when I want to set a dynamic array to an non-empty set of elements I use this syntax:

other_enum_t      _b [] = '{ENUM1, ENUM2, ENUM1};

Somehow this seems counter-intuitive. I thought that the reason that the apostrophe was added to the curly braces was to distinguish the assignment pattern from concatenation. And then we use the concatenation syntax for an empty set of elements.

I have tested the

other_enum_t      _b [] = '{};

code with the Cadence and Aldec simulators and it passes without warnings, so now I am unclear on the whole situation.