We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I think it would be nice for not null inference to work in compound expressions like expr1 || expr2.
expr1 || expr2
If you assign the expression to a local variable it works okay.
My compilation target is ES2015 and my lib is the default.
ES2015
the default
Check this playground: https://www.typescriptlang.org/play?#code/LAKFEsDsBcFMCcBmBDAxrABAWQJ4EkYE1MBvUDCjAW1gGdbkBzWALgwHIALAewBtl2oAL6hQ0HAAdMuACqTMAXmz5C8YhgA+GSAFdevANyiwJxDsipo4bpAzxY0eOFgA3WFjoNmGABT3kACZsuARwaugAlBhkIJR2Djrwtv4BAHQ09EywwsZmFlY2duY+GAjw3PAAjME4clIANKXw5fAATCyy8hhRMcZx9tCJtj5lFZWaWqNtUQD88Y7Obh6ZzCPNYxNNLa1RbFx8AjkmoHmW1snmrSVT1cp1sI1T7Z1S3dF9lKg2tNAYvNyoZC8ACi63gGCUN02TyMx1ilAGQz+AKBoJaGDmAycrncniyPn+gJBYN2HB4-EEICEQA
interface MyInterace { message: 'hola' } type MyType = MyInterace | null; function retrieveMessage (read: MyInterace) { return read.message } function run( error1: MyType, error2:MyType ) { // Type error return (error1 || error2) ? retrieveMessage(error1 || error2) : 'hola' } function run2( error1: MyType, error2:MyType ) { const localError = error1 || error2; // Works fine return localError ? retrieveMessage(localError) : 'hola' }
The text was updated successfully, but these errors were encountered:
Duplicate of #35260
Sorry, something went wrong.
You're right. I'll close it.
No branches or pull requests
lib Update Request
I think it would be nice for not null inference to work in compound expressions like
expr1 || expr2
.If you assign the expression to a local variable it works okay.
Configuration Check
My compilation target is
ES2015
and my lib isthe default
.Missing / Incorrect Definition
Sample Code
Check this playground: https://www.typescriptlang.org/play?#code/LAKFEsDsBcFMCcBmBDAxrABAWQJ4EkYE1MBvUDCjAW1gGdbkBzWALgwHIALAewBtl2oAL6hQ0HAAdMuACqTMAXmz5C8YhgA+GSAFdevANyiwJxDsipo4bpAzxY0eOFgA3WFjoNmGABT3kACZsuARwaugAlBhkIJR2Djrwtv4BAHQ09EywwsZmFlY2duY+GAjw3PAAjME4clIANKXw5fAATCyy8hhRMcZx9tCJtj5lFZWaWqNtUQD88Y7Obh6ZzCPNYxNNLa1RbFx8AjkmoHmW1snmrSVT1cp1sI1T7Z1S3dF9lKg2tNAYvNyoZC8ACi63gGCUN02TyMx1ilAGQz+AKBoJaGDmAycrncniyPn+gJBYN2HB4-EEICEQA
I think it would be nice for not null inference to work in compound expressions like
expr1 || expr2
.The text was updated successfully, but these errors were encountered: