Hi Dave,
Is get_component_name a function that has an optional boolean parameter and returns type string?
It would help to see its definition, however, I will make some guesses.
I have seen this issue before when the optional parameter is type integer, but never with type boolean.
With type integer, in this context, it is correct if “get_component_name(1)” returns either a string
or a character value. If the 1 is seen as the optional parameter, the function returns a string
value. If the 1 is not seen as the optional parameter, then the 1 is indexing the string
return value and the expression results in a character value. Some tools will report this as
an ambiguous expression – some will not see the index and will not report it.
For me, the LRM is complex in this area and I am not clear about the proper interpretation.
The error is valid if TRUE is not a valid parameter of get_component_name. In which case NVC is
trying to use the TRUE to index a string and hence the message.
OTOH, if TRUE is a parameter (optional or not) of get_component_name, it looks like NVC has a
bug and you should report it at https://github.com/nickg/nvc/issues. Nick is generally quick
about responding – and explaining why he thinks the message is correct or it is a bug.
Best Regards,
Jim