[Feature Request] Support change type of this, to act on type guard of following codes #48833
Closed
5 tasks done
Labels
Duplicate
An existing issue was already created
Suggestion
π Search Terms
List of keywords you searched for before creating this issue. Write them down here so that others can find this suggestion more easily and help provide feedback.
change variable type, change this type, asserts
β Viability Checklist
My suggestion meets these guidelines:
β Suggestion
We know there is
is
to do type guard acting on function return value. And we haveas
to convert type inside a statement.Can we has a keyword to change type of variable or this as a statement, to change type and affect following all codes instead of just affect one statement like
as
?π Motivating Example
When facingto
this
, I don't want to define a aliased variable likethat
. And useas
inside every statement to convert type is cumbersome.π» Use Cases
It is like
The text was updated successfully, but these errors were encountered: