Why is this an issue?

A constant function tried to access a nonexistent element of a dynamic array.

How to fix it

Code examples

Noncompliant code example

localparam int foo = func();
function int func;
  automatic int i[] = new [2];
  return i[4]; // Noncompliant
endfunction