I know there are a number of edge cases regarding automatic coercion from GString to String, so I'm not certain whether this is a specific case of a larger problem area, but I've been able to isolate it.
When using the named-parameter constructor approach, ternary expressions don't "inherit" the target type, and thus the inferred type of the expression is Serializable (not even CharSequence!). The problem is identical whether elvis or the long form is used.
This doesn't fail when used as
An explicit as String makes everyone happy but shouldn't be needed.