Skip to content

Commit 561168c

Browse files
committed
Make isObjectLiteral required
1 parent bc028a3 commit 561168c

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/compiler/checker.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -134,16 +134,16 @@ namespace ts {
134134
const neverType = createIntrinsicType(TypeFlags.Never, "never");
135135
const silentNeverType = createIntrinsicType(TypeFlags.Never, "never");
136136

137-
const emptyObjectType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined);
138-
const emptyGenericType = <GenericType><ObjectType>createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined);
137+
const emptyObjectType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined, undefined);
138+
const emptyGenericType = <GenericType><ObjectType>createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined, undefined);
139139
emptyGenericType.instantiations = createMap<TypeReference>();
140140

141-
const anyFunctionType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined);
141+
const anyFunctionType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined, undefined);
142142
// The anyFunctionType contains the anyFunctionType by definition. The flag is further propagated
143143
// in getPropagatingFlagsOfTypes, and it is checked in inferFromTypes.
144144
anyFunctionType.flags |= TypeFlags.ContainsAnyFunctionType;
145145

146-
const noConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined);
146+
const noConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined, undefined);
147147

148148
const anySignature = createSignature(undefined, undefined, undefined, emptyArray, anyType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false);
149149
const unknownSignature = createSignature(undefined, undefined, undefined, emptyArray, unknownType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false);
@@ -1618,7 +1618,7 @@ namespace ts {
16181618
return <ResolvedType>type;
16191619
}
16201620

1621-
function createAnonymousType(symbol: Symbol, members: SymbolTable, callSignatures: Signature[], constructSignatures: Signature[], stringIndexInfo: IndexInfo, numberIndexInfo: IndexInfo, isObjectLiteral?: boolean): ResolvedType {
1621+
function createAnonymousType(symbol: Symbol, members: SymbolTable, callSignatures: Signature[], constructSignatures: Signature[], stringIndexInfo: IndexInfo, numberIndexInfo: IndexInfo, isObjectLiteral: boolean): ResolvedType {
16221622
const t = createObjectType(TypeFlags.Anonymous, symbol);
16231623
if (isObjectLiteral) {
16241624
t.isObjectLiteral = true;
@@ -3176,7 +3176,7 @@ namespace ts {
31763176
symbol.bindingElement = e;
31773177
members[symbol.name] = symbol;
31783178
});
3179-
const result = createAnonymousType(undefined, members, emptyArray, emptyArray, undefined, undefined);
3179+
const result = createAnonymousType(undefined, members, emptyArray, emptyArray, undefined, undefined, undefined);
31803180
if (includePatternInType) {
31813181
result.pattern = pattern;
31823182
}
@@ -12492,7 +12492,7 @@ namespace ts {
1249212492
function getInferredClassType(symbol: Symbol) {
1249312493
const links = getSymbolLinks(symbol);
1249412494
if (!links.inferredClassType) {
12495-
links.inferredClassType = createAnonymousType(symbol, symbol.members, emptyArray, emptyArray, /*stringIndexType*/ undefined, /*numberIndexType*/ undefined);
12495+
links.inferredClassType = createAnonymousType(symbol, symbol.members, emptyArray, emptyArray, /*stringIndexType*/ undefined, /*numberIndexType*/ undefined, /*isObjectLiteral*/ undefined);
1249612496
}
1249712497
return links.inferredClassType;
1249812498
}

0 commit comments

Comments
 (0)