In getContextualTypeForBinaryOperand, only need to look for = assignment operator, not e.g. +=#20037
Merged
2 commits merged intoNov 17, 2017
Merged
Conversation
…ignment operator, not e.g. `+=`
sandersn
approved these changes
Nov 15, 2017
| return getContextualType(binaryExpression); | ||
| } | ||
| } | ||
| function isNonContextualBinaryExpression(binaryExpression: BinaryExpression): boolean { |
Member
There was a problem hiding this comment.
flip to ContextSensitive as above
| } | ||
| return type; | ||
| // Don't do this for special property assignments to avoid circularity | ||
| return node !== right || isNonContextualBinaryExpression(binaryExpression) ? undefined : getTypeOfExpression(left); |
Member
There was a problem hiding this comment.
node === right && isContentSensitiveBinaryExpressin(binaryExpression) ? getTypeOfExpression(left) : undefined;
c32af7b to
a26e685
Compare
errendir
added a commit
to errendir/TypeScript
that referenced
this pull request
Nov 20, 2017
* origin/master: (140 commits) test overriding Session.event Update editorServices.ts Fix semantic merge conflict (microsoft#20119) LEGO: check in for master to temporary branch. Moved minified file exclusion Fixed internal safelist For import completion, if multiple re-exports exist, choose the one with the shortest path (microsoft#20049) Bundle fileName with CodeActionCommand (microsoft#19881) Simplify documentHighlights (microsoft#20091) LEGO: check in for master to temporary branch. Support semantic classification of alias (microsoft#20012) In `getContextualTypeForBinaryOperand`, only need to look for `=` assignment operator, not e.g. `+=` (microsoft#20037) lineAction: Use an enum instead of true | false | undefined (microsoft#20086) LEGO: check in for master to temporary branch. cleanup NodeTypingsInstaller remove comments type `event` callback correctly update baselines defer callback and remove handler object Support arbitrary prototype property assignments in navigation bar (microsoft#19923) ...
This pull request was closed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
isAssignmentOperator(operator)may have been used out of habit, but we don't really need contextual types for+=since you can't docb += (x, y) => { ... }or anything that would need a contextual type without introducing type errors, since it only works for numbers/strings.