You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
--!stricttypepath= {[string]: {string?}}
localpath_map: {[string]: path?} = {
["outermost"] = {
["exterior"] = {
"first interior", -- This is incorrectly inferred as `string` instead of `string?`, and will warn."second interior",
"third interior",
}
}
}
Type Error: (3,1) Type 'path_map' could not be converted into '{| [string]: path? |}'
caused by:
Property 'outermost' is not compatible. Type 'path?' could not be converted into '{ exterior: {string} }'
caused by:
Not all union options are compatible. Type 'path' could not be converted into '{ exterior: {string} }'
caused by:
Property 'exterior' is not compatible. Type '{string?}' could not be converted into '{string}'
caused by:
Property '[indexer value]' is not compatible. Type 'string?' could not be converted into 'string'
As a workaround, "first interior" must be casted to string?, but "second interior" and "third interior" do not need to be casted.
As a workaround,
"first interior"
must be casted tostring?
, but"second interior"
and"third interior"
do not need to be casted.Another workaround is to define the path beforehand.
If
path_map
has type{[string]: path}
, this will not occur.The text was updated successfully, but these errors were encountered: