@@ -262,7 +262,7 @@ namespace ts {
262
262
263
263
const emptyTypeLiteralSymbol = createSymbol(SymbolFlags.TypeLiteral, InternalSymbolName.Type);
264
264
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?
266
266
267
267
const emptyGenericType = <GenericType><ObjectType>createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined);
268
268
emptyGenericType.instantiations = createMap<TypeReference>();
@@ -8073,7 +8073,7 @@ namespace ts {
8073
8073
}
8074
8074
}
8075
8075
if (signature.typePredicate) {
8076
- freshTypePredicate = cloneTypePredicate(signature.typePredicate, mapper);
8076
+ freshTypePredicate = cloneTypePredicate(signature.typePredicate, mapper); //Doesn't just clone, also instantiates it!
8077
8077
}
8078
8078
const result = createSignature(signature.declaration, freshTypeParameters,
8079
8079
signature.thisParameter && instantiateSymbol(signature.thisParameter, mapper),
@@ -15629,7 +15629,7 @@ namespace ts {
15629
15629
// For a decorator, no arguments are susceptible to contextual typing due to the fact
15630
15630
// decorators are applied to a declaration by the emitter, and not to an expression.
15631
15631
let excludeArgument: boolean[];
15632
- let excludeCount = 0;
15632
+ let excludeCount = 0; //= # of context sensitive arguments
15633
15633
if (!isDecorator) {
15634
15634
// We do not need to call `getEffectiveArgumentCount` here as it only
15635
15635
// applies when calculating the number of arguments for a decorator.
@@ -16776,7 +16776,7 @@ namespace ts {
16776
16776
links.flags |= NodeCheckFlags.ContextChecked;
16777
16777
if (contextualSignature) {
16778
16778
const signature = getSignaturesOfType(type, SignatureKind.Call)[0];
16779
- if (isContextSensitive(node)) {
16779
+ if (isContextSensitive(node)) { //when would this not be true?
16780
16780
const contextualMapper = getContextualMapper(node);
16781
16781
if (checkMode === CheckMode.Inferential) {
16782
16782
inferFromAnnotatedParameters(signature, contextualSignature, contextualMapper);
0 commit comments