NonNullable behaves differently when passing a property type from this
#36061
Labels
Needs Investigation
This issue needs a team member to investigate its status.
TypeScript Version: 3.7.2
Search Terms:
NonNullable this this[] this property nonnullable
Code
Expected behavior:
This code compiles correctly,
this['prop']
andSomeType
point to the same type.Actual behavior:
func3
is not happy with the return statement:Type 'string' is not assignable to type 'NonNullable<this["prop"]>'
.Playground Link: link
Related Issues: none
The text was updated successfully, but these errors were encountered: