We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 004f18f commit c549bb5Copy full SHA for c549bb5
src/compiler/checker.ts
@@ -15815,7 +15815,7 @@ namespace ts {
15815
}
15816
function isValidMethodAccess(method: Symbol, type: Type) {
15817
const propType = getTypeOfFuncClassEnumModule(method);
15818
- const signatures = getSignaturesOfType(propType, SignatureKind.Call);
+ const signatures = getSignaturesOfType(getNonNullableType(propType), SignatureKind.Call);
15819
Debug.assert(signatures.length !== 0);
15820
return signatures.some(sig => {
15821
const thisType = getThisTypeOfSignature(sig);
tests/cases/fourslash/completionsOptionalMethod.ts
@@ -0,0 +1,8 @@
1
+/// <reference path="fourslash.ts" />
2
+
3
+// @strictNullChecks: true
4
5
+////declare const x: { m?(): void };
6
+////x./**/
7
8
+verify.completionsAt("", ["m"]);
0 commit comments