The error message for a conditional expression type mismatch uses a direct string representation of the types, rather than calling the FriendlyName method on those types to get the user-facing name:
The true and false result expressions must have consistent types. The given
expressions are {{{} [{{{} %!s(cty.primitiveTypeKind=83)}}]}} and {{{}
%!s(cty.primitiveTypeKind=83)}}, respectively.
The error message for a conditional expression type mismatch uses a direct string representation of the types, rather than calling the
FriendlyName
method on those types to get the user-facing name:https://github.com/hashicorp/hcl2/blob/6558d83419b8415adbcc4df88fd6c8b56fbbaf5f/hcl/hclsyntax/expression.go#L458-L473
As a result, the detail message is useless: