-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Currently the language does not allow one to express that an entry in an array can be null.
Currently we can express
- Array is optional:
name?: string[] - Array is nullable:
name: string[]? - Array is optional and nullable:
name?: string[]?
Possible construct:
string?[]- might look strange ifstring?[]?- not sure we can express it in the grammerstring()- looks like a function callnullable<string>[]- eats another keyword and from an editing point of view it feels wrongstring | null[]- feels wrong because then we'd express null always using| nullinstead of?
another option might be that we change the syntax to create defined an array:
array<string>- array of stringsarray<string>?- array of strings or nullarray<string?>- array of strings/nullarray<string?>?- arrary of string/null or null
this has the disavantage that for the default case the string[] this looks strange and unnatural and we'd add another keyword to the language
Metadata
Metadata
Assignees
Labels
No labels