File tree 2 files changed +29
-1
lines changed 2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -27644,7 +27644,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
27644
27644
location = location.parent;
27645
27645
}
27646
27646
if (isExpressionNode(location) && (!isAssignmentTarget(location) || isWriteAccess(location))) {
27647
- const type = getTypeOfExpression(location as Expression);
27647
+ const type = removeOptionalTypeMarker( getTypeOfExpression(location as Expression) );
27648
27648
if (getExportSymbolOfValueSymbolIfExported(getNodeLinks(location).resolvedSymbol) === symbol) {
27649
27649
return type;
27650
27650
}
Original file line number Diff line number Diff line change
1
+ /// <reference path='fourslash.ts'/>
2
+ //
3
+ // @strict : true
4
+ //
5
+ //// interface A {
6
+ //// arr: string[];
7
+ //// }
8
+ ////
9
+ //// function test(a?: A): string {
10
+ //// return a?.ar/*1*/r.length ? "A" : "B";
11
+ //// }
12
+ ////
13
+ //// interface Foo { bar: { baz: string } };
14
+ //// declare const foo: Foo | undefined;
15
+ ////
16
+ //// if (foo?.b/*2*/ar.b/*3*/az) {}
17
+ ////
18
+ //// interface Foo2 { bar?: { baz: { qwe: string } } };
19
+ //// declare const foo2: Foo2;
20
+ ////
21
+ //// if (foo2.b/*4*/ar?.b/*5*/az.q/*6*/we) {}
22
+
23
+ verify . quickInfoAt ( "1" , "(property) A.arr: string[]" ) ;
24
+ verify . quickInfoAt ( "2" , "(property) Foo.bar: {\n baz: string;\n}" ) ;
25
+ verify . quickInfoAt ( "3" , "(property) baz: string | undefined" ) ;
26
+ verify . quickInfoAt ( "4" , "(property) Foo2.bar?: {\n baz: {\n qwe: string;\n };\n} | undefined" ) ;
27
+ verify . quickInfoAt ( "5" , "(property) baz: {\n qwe: string;\n}" ) ;
28
+ verify . quickInfoAt ( "6" , "(property) qwe: string | undefined" ) ;
You can’t perform that action at this time.
0 commit comments