Skip to content

Commit beb998b

Browse files
Merge pull request #5615 from Microsoft/getContextualTypeServices
Do not get the apparent type for 'getContextualType' in the services layer
2 parents 0c96d7b + df1dd00 commit beb998b

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ namespace ts {
8181
symbolToString,
8282
getAugmentedPropertiesOfType,
8383
getRootSymbols,
84-
getContextualType: getApparentTypeOfContextualType,
84+
getContextualType,
8585
getFullyQualifiedName,
8686
getResolvedSignature,
8787
getConstantValue,
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/// <reference path="./fourslash.ts" />
2+
3+
////interface IFoo {
4+
//// [|a|]: string;
5+
////}
6+
////class C<T extends IFoo> {
7+
//// method() {
8+
//// var x: T = {
9+
//// [|a|]: ""
10+
//// };
11+
//// x.[|a|];
12+
//// }
13+
////}
14+
////
15+
////
16+
////var x: IFoo = {
17+
//// [|a|]: "ss"
18+
////};
19+
20+
let ranges = test.ranges()
21+
for (let range of ranges) {
22+
goTo.position(range.start);
23+
24+
verify.referencesCountIs(ranges.length);
25+
for (let expectedReference of ranges) {
26+
verify.referencesAtPositionContains(expectedReference);
27+
}
28+
}

0 commit comments

Comments
 (0)