Using a function inside `requires` and passing it a string with nullish coalescing operator results in invalid C code
Honestly, I've no idea how to write the title of this issue, so I put what I thought best
The following code block
bool receives_string (string param1)
{
return false;
}
void receives_nullable_string (string? param1)
requires (receives_string (param1 ?? "Hi"))
{
}
generates the following invalid C code
gboolean
receives_string (const gchar* param1)
{
gboolean result = FALSE;
g_return_val_if_fail (param1 != NULL, FALSE);
result = FALSE;
return result;
}
void
receives_nullable_string (const gchar* param1)
{
_vala_return_if_fail (receives_string (_tmp0_), "receives_string (param1 ?? \"Hi\")");
}
The _tmp0_
variable is never declared, and the checks are never done
This happens on Vala 0.50.1.110-0703c
and 0.48.12