Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ff6bda2

Browse files
author
Andy Hanson
committed
wip
1 parent 608a938 commit ff6bda2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/compiler/checker.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ namespace ts {
262262

263263
const emptyTypeLiteralSymbol = createSymbol(SymbolFlags.TypeLiteral, InternalSymbolName.Type);
264264
emptyTypeLiteralSymbol.members = createSymbolTable();
265-
const emptyTypeLiteralType = createAnonymousType(emptyTypeLiteralSymbol, emptySymbols, emptyArray, emptyArray, undefined, undefined);
265+
const emptyTypeLiteralType = createAnonymousType(emptyTypeLiteralSymbol, emptySymbols, emptyArray, emptyArray, undefined, undefined); //Why both this and emptyObjectType?
266266

267267
const emptyGenericType = <GenericType><ObjectType>createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined);
268268
emptyGenericType.instantiations = createMap<TypeReference>();
@@ -8073,7 +8073,7 @@ namespace ts {
80738073
}
80748074
}
80758075
if (signature.typePredicate) {
8076-
freshTypePredicate = cloneTypePredicate(signature.typePredicate, mapper);
8076+
freshTypePredicate = cloneTypePredicate(signature.typePredicate, mapper); //Doesn't just clone, also instantiates it!
80778077
}
80788078
const result = createSignature(signature.declaration, freshTypeParameters,
80798079
signature.thisParameter && instantiateSymbol(signature.thisParameter, mapper),
@@ -15629,7 +15629,7 @@ namespace ts {
1562915629
// For a decorator, no arguments are susceptible to contextual typing due to the fact
1563015630
// decorators are applied to a declaration by the emitter, and not to an expression.
1563115631
let excludeArgument: boolean[];
15632-
let excludeCount = 0;
15632+
let excludeCount = 0; //= # of context sensitive arguments
1563315633
if (!isDecorator) {
1563415634
// We do not need to call `getEffectiveArgumentCount` here as it only
1563515635
// applies when calculating the number of arguments for a decorator.
@@ -16776,7 +16776,7 @@ namespace ts {
1677616776
links.flags |= NodeCheckFlags.ContextChecked;
1677716777
if (contextualSignature) {
1677816778
const signature = getSignaturesOfType(type, SignatureKind.Call)[0];
16779-
if (isContextSensitive(node)) {
16779+
if (isContextSensitive(node)) { //when would this not be true?
1678016780
const contextualMapper = getContextualMapper(node);
1678116781
if (checkMode === CheckMode.Inferential) {
1678216782
inferFromAnnotatedParameters(signature, contextualSignature, contextualMapper);

0 commit comments

Comments
 (0)