PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → Nullable coalescing retains nullable type
Nullable coalescing retains nullable type
Débuté par Nicolas Dewolf, 05 nov. 2025 15:37 - Aucune réponse
Posté le 05 novembre 2025 - 15:37
I was (very) surprised today when i got the error "An element of type 'ANSI string?' cannot be converted to 'ANSI string'" in the following setting.

I have a procedure (the Info line could be replaced by whatever code we want)
Procedure GLOBAL escape(str is string)
Info(str)

which is called as follows (again, this is a mock example)
nstr is string? = "a"
escape(nstr ?? "text")


Are we really supposed to cast/convert this expression explicitly to a string first?

What makes this even worse is that
nstr is string? = Null
escape(nstr ?? "text")

works perfectly.