Skip to content

Conversation

@slawomir
Copy link
Contributor

@slawomir slawomir commented Dec 28, 2016

Fixes #13063

 * Allow typeof to use not-auto variable in strictNullChecks mode
// declaration container are the same).
const assumeInitialized = isParameter || isOuterVariable ||
type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & TypeFlags.Any) !== 0) ||
type !== autoType && type !== autoArrayType && (!strictNullChecks || isInTypeQuery(node) || (type.flags & TypeFlags.Any) !== 0) ||
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please put this condition last in the || chain - we want the faster checks first and isInTypeQuery has to walk up the entire tree

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RyanCavanaugh updated pull request

Add isInTypeQuery as the last OR
@mhegazy mhegazy merged commit e128b94 into microsoft:master Dec 28, 2016
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants