Introduce undefined
type or keyword to differentiate intentional absence of value and uninitialized state
#4239
Labels
feature
Proposed language feature that solves one or more problems
The current use of
null
for optional parameters in methods likecopyWith
can lead to ambiguity. Specifically,null
is used to signify "leave unchanged", making it difficult to explicitly set a field tonull
. This inconvenience complicates the handling of optional fields.Introduce an
undefined
,nil
, or similar type or keyword to represent omitted values, distinct fromnull
.For example:
The text was updated successfully, but these errors were encountered: