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
{{ message }}
This repository has been archived by the owner on Jan 25, 2022. It is now read-only.
The left-hand side of an assignment expression may not be an optional property acces
if let style,determine whether it is optional and obtain the object
Use Cases
for Suggestion 1
The following code is not allowed in typescript 3.7.2.It's going to make a The left-hand side of an assignment expression may not be an optional property access mistake
classFoo{foo: Foo|undefinedname: String|undefined}letfoo=newFoo()// next line. ~~ The left-hand side of an assignment expression may not be an optional property accessfoo.foo?.name="";
TypeScript - issues 34970
I think I should bring it up here
Search Terms
Suggestion
if let
style,determine whether it is optional and obtain the objectUse Cases
for Suggestion 1
The following code is not allowed in
typescript 3.7.2
.It's going to make aThe left-hand side of an assignment expression may not be an optional property access
mistakeBut similar code, swift works well
In view of this, do we have any plans to solve this problem at present?
for Suggestion 2
About judging optional variables and using it,The current practice of TS is
In swift, there is a way to turn optional into non optional.
Can be used in 'kotlin'
If you judge a method result. In order not to call the calculation twice, you need to replace the code with.
The text was updated successfully, but these errors were encountered: