File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -2827,7 +2827,7 @@ namespace ts {
28272827 }
28282828 // Handle module.exports = expr
28292829 if (declaration.kind === SyntaxKind.BinaryExpression) {
2830- return links.type = checkExpression((< BinaryExpression>declaration) .right);
2830+ return links.type = getUnionType(map(symbol.declarations, (decl: BinaryExpression) => checkExpressionCached(decl .right)) );
28312831 }
28322832 if (declaration.kind === SyntaxKind.PropertyAccessExpression) {
28332833 // Declarations only exist for property access expressions for certain
Original file line number Diff line number Diff line change 1+ /// <reference path="fourslash.ts" />
2+
3+ // @allowJs : true
4+ // @Filename : a.js
5+ //// function Person(age) {
6+ //// if (age >= 18) {
7+ //// this.canVote = true;
8+ //// } else {
9+ //// this.canVote = 23;
10+ //// }
11+ //// }
12+ //// let x = new Person(100);
13+ //// x.canVote/**/;
14+
15+ goTo . marker ( ) ;
16+ verify . quickInfoIs ( '(property) Person.canVote: boolean | number' ) ;
You can’t perform that action at this time.
0 commit comments