Fix 7304: show correct quickinfo on "this" in type position (#8508)

* Show correct quickinfo when using this in type position

* Split quickinfo test into smaller files and add test case
This commit is contained in:
Yui
2016-05-07 09:12:53 -07:00
parent 955cc69c70
commit 72c19ec806
6 changed files with 73 additions and 62 deletions

View File

@@ -5211,6 +5211,7 @@ namespace ts {
case SyntaxKind.NullKeyword:
return nullType;
case SyntaxKind.ThisType:
case SyntaxKind.ThisKeyword:
return getTypeFromThisTypeNode(node);
case SyntaxKind.StringLiteralType:
return getTypeFromStringLiteralTypeNode(<StringLiteralTypeNode>node);
@@ -12509,7 +12510,7 @@ namespace ts {
// Checks an expression and returns its type. The contextualMapper parameter serves two purposes: When
// contextualMapper is not undefined and not equal to the identityMapper function object it indicates that the
// expression is being inferentially typed (section 4.12.2 in spec) and provides the type mapper to use in
// expression is being inferentially typed (section 4.15.2 in spec) and provides the type mapper to use in
// conjunction with the generic contextual type. When contextualMapper is equal to the identityMapper function
// object, it serves as an indicator that all contained function and arrow expressions should be considered to
// have the wildcard function type; this form of type check is used during overload resolution to exclude

View File

@@ -1056,6 +1056,7 @@ namespace ts {
export function isExpression(node: Node): boolean {
switch (node.kind) {
case SyntaxKind.ThisKeyword:
case SyntaxKind.SuperKeyword:
case SyntaxKind.NullKeyword:
case SyntaxKind.TrueKeyword: