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 {
2827
2827
}
2828
2828
// Handle module.exports = expr
2829
2829
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)) );
2831
2831
}
2832
2832
if (declaration.kind === SyntaxKind.PropertyAccessExpression) {
2833
2833
// 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