Skip to content

Commit 895d86f

Browse files
Marked internal createAnonymousType type as allowing undefined Symbols
1 parent 36c87ac commit 895d86f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/compiler/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3506,7 +3506,7 @@ namespace ts {
35063506
/* @internal */ createPromiseType(type: Type): Type;
35073507

35083508
/* @internal */ isTypeAssignableTo(source: Type, target: Type): boolean;
3509-
/* @internal */ createAnonymousType(symbol: Symbol, members: SymbolTable, callSignatures: Signature[], constructSignatures: Signature[], stringIndexInfo: IndexInfo | undefined, numberIndexInfo: IndexInfo | undefined): Type;
3509+
/* @internal */ createAnonymousType(symbol: Symbol | undefined, members: SymbolTable, callSignatures: Signature[], constructSignatures: Signature[], stringIndexInfo: IndexInfo | undefined, numberIndexInfo: IndexInfo | undefined): Type;
35103510
/* @internal */ createSignature(
35113511
declaration: SignatureDeclaration,
35123512
typeParameters: TypeParameter[] | undefined,

src/services/codefixes/inferFromUsage.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,7 @@ namespace ts.codefix {
992992
const callSignatures: Signature[] = usage.calls ? [getSignatureFromCalls(usage.calls)] : [];
993993
const constructSignatures: Signature[] = usage.constructs ? [getSignatureFromCalls(usage.constructs)] : [];
994994
const stringIndexInfo = usage.stringIndex && checker.createIndexInfo(combineFromUsage(usage.stringIndex), /*isReadonly*/ false);
995-
return checker.createAnonymousType(/*symbol*/ undefined!, members, callSignatures, constructSignatures, stringIndexInfo, /*numberIndexInfo*/ undefined); // TODO: GH#18217
995+
return checker.createAnonymousType(/*symbol*/ undefined, members, callSignatures, constructSignatures, stringIndexInfo, /*numberIndexInfo*/ undefined);
996996
}
997997

998998
function inferNamedTypesFromProperties(usage: Usage): Type[] {
@@ -1096,7 +1096,7 @@ namespace ts.codefix {
10961096
}
10971097

10981098
function getFunctionFromCalls(calls: CallUsage[]) {
1099-
return checker.createAnonymousType(undefined!, createSymbolTable(), [getSignatureFromCalls(calls)], emptyArray, /*stringIndexInfo*/ undefined, /*numberIndexInfo*/ undefined);
1099+
return checker.createAnonymousType(/*symbol*/ undefined, createSymbolTable(), [getSignatureFromCalls(calls)], emptyArray, /*stringIndexInfo*/ undefined, /*numberIndexInfo*/ undefined);
11001100
}
11011101

11021102
function getSignatureFromCalls(calls: CallUsage[]): Signature {

0 commit comments

Comments
 (0)