Skip to content

Commit 1aaf314

Browse files
Marked internal createAnonymousType type as allowing undefined Symbols (#36016)
1 parent b1e706d commit 1aaf314

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
@@ -3525,7 +3525,7 @@ namespace ts {
35253525
/* @internal */ createPromiseType(type: Type): Type;
35263526

35273527
/* @internal */ isTypeAssignableTo(source: Type, target: Type): boolean;
3528-
/* @internal */ createAnonymousType(symbol: Symbol, members: SymbolTable, callSignatures: Signature[], constructSignatures: Signature[], stringIndexInfo: IndexInfo | undefined, numberIndexInfo: IndexInfo | undefined): Type;
3528+
/* @internal */ createAnonymousType(symbol: Symbol | undefined, members: SymbolTable, callSignatures: Signature[], constructSignatures: Signature[], stringIndexInfo: IndexInfo | undefined, numberIndexInfo: IndexInfo | undefined): Type;
35293529
/* @internal */ createSignature(
35303530
declaration: SignatureDeclaration,
35313531
typeParameters: TypeParameter[] | undefined,

src/services/codefixes/inferFromUsage.ts

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

991991
function inferNamedTypesFromProperties(usage: Usage): Type[] {
@@ -1089,7 +1089,7 @@ namespace ts.codefix {
10891089
}
10901090

10911091
function getFunctionFromCalls(calls: CallUsage[]) {
1092-
return checker.createAnonymousType(undefined!, createSymbolTable(), [getSignatureFromCalls(calls)], emptyArray, /*stringIndexInfo*/ undefined, /*numberIndexInfo*/ undefined);
1092+
return checker.createAnonymousType(/*symbol*/ undefined, createSymbolTable(), [getSignatureFromCalls(calls)], emptyArray, /*stringIndexInfo*/ undefined, /*numberIndexInfo*/ undefined);
10931093
}
10941094

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

0 commit comments

Comments
 (0)