Skip to content

Commit febde3f

Browse files
committed
Revert noConstraintType name change
1 parent f5f1c7e commit febde3f

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

src/compiler/checker.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ namespace ts {
166166
// in getPropagatingFlagsOfTypes, and it is checked in inferFromTypes.
167167
anyFunctionType.flags |= TypeFlags.ContainsAnyFunctionType;
168168

169-
const noConstraintOrDefaultType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined);
170-
const circularConstraintOrDefaultType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined);
169+
const noConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined);
170+
const circularConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined);
171171

172172
const anySignature = createSignature(undefined, undefined, 0, undefined, emptyArray, anyType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false);
173173
const unknownSignature = createSignature(undefined, undefined, 0, undefined, emptyArray, unknownType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false);
@@ -4791,11 +4791,11 @@ namespace ts {
47914791

47924792
function getBaseConstraintOfType(type: TypeVariable | UnionOrIntersectionType): Type {
47934793
const constraint = getResolvedBaseConstraint(type);
4794-
return constraint !== noConstraintOrDefaultType && constraint !== circularConstraintOrDefaultType ? constraint : undefined;
4794+
return constraint !== noConstraintType && constraint !== circularConstraintType ? constraint : undefined;
47954795
}
47964796

47974797
function hasNonCircularBaseConstraint(type: TypeVariable): boolean {
4798-
return getResolvedBaseConstraint(type) !== circularConstraintOrDefaultType;
4798+
return getResolvedBaseConstraint(type) !== circularConstraintType;
47994799
}
48004800

48014801
/**
@@ -4809,7 +4809,7 @@ namespace ts {
48094809
if (!type.resolvedBaseConstraint) {
48104810
typeStack = [];
48114811
const constraint = getBaseConstraint(type);
4812-
type.resolvedBaseConstraint = circular ? circularConstraintOrDefaultType : getTypeWithThisArgument(constraint || noConstraintOrDefaultType, type);
4812+
type.resolvedBaseConstraint = circular ? circularConstraintType : getTypeWithThisArgument(constraint || noConstraintType, type);
48134813
}
48144814
return type.resolvedBaseConstraint;
48154815

@@ -4869,14 +4869,14 @@ namespace ts {
48694869
if (!typeParameter.default) {
48704870
if (typeParameter.target) {
48714871
const targetDefault = getDefaultFromTypeParameter(typeParameter.target);
4872-
typeParameter.default = targetDefault ? instantiateType(targetDefault, typeParameter.mapper) : noConstraintOrDefaultType;
4872+
typeParameter.default = targetDefault ? instantiateType(targetDefault, typeParameter.mapper) : noConstraintType;
48734873
}
48744874
else {
48754875
const defaultDeclaration = typeParameter.symbol && forEach(typeParameter.symbol.declarations, decl => isTypeParameter(decl) && decl.default);
4876-
typeParameter.default = defaultDeclaration ? getTypeFromTypeNode(defaultDeclaration) : noConstraintOrDefaultType;
4876+
typeParameter.default = defaultDeclaration ? getTypeFromTypeNode(defaultDeclaration) : noConstraintType;
48774877
}
48784878
}
4879-
return typeParameter.default === noConstraintOrDefaultType ? undefined : typeParameter.default;
4879+
return typeParameter.default === noConstraintType ? undefined : typeParameter.default;
48804880
}
48814881

48824882
/**
@@ -5497,14 +5497,14 @@ namespace ts {
54975497
if (!typeParameter.constraint) {
54985498
if (typeParameter.target) {
54995499
const targetConstraint = getConstraintOfTypeParameter(typeParameter.target);
5500-
typeParameter.constraint = targetConstraint ? instantiateType(targetConstraint, typeParameter.mapper) : noConstraintOrDefaultType;
5500+
typeParameter.constraint = targetConstraint ? instantiateType(targetConstraint, typeParameter.mapper) : noConstraintType;
55015501
}
55025502
else {
55035503
const constraintDeclaration = getConstraintDeclaration(typeParameter);
5504-
typeParameter.constraint = constraintDeclaration ? getTypeFromTypeNode(constraintDeclaration) : noConstraintOrDefaultType;
5504+
typeParameter.constraint = constraintDeclaration ? getTypeFromTypeNode(constraintDeclaration) : noConstraintType;
55055505
}
55065506
}
5507-
return typeParameter.constraint === noConstraintOrDefaultType ? undefined : typeParameter.constraint;
5507+
return typeParameter.constraint === noConstraintType ? undefined : typeParameter.constraint;
55085508
}
55095509

55105510
function getParentSymbolOfTypeParameter(typeParameter: TypeParameter): Symbol {
@@ -15846,12 +15846,12 @@ namespace ts {
1584615846
}
1584715847
}
1584815848

15849-
/**
15849+
/**
1585015850
* Static members being set on a constructor function may conflict with built-in properties
15851-
* of Function. Esp. in ECMAScript 5 there are non-configurable and non-writable
15852-
* built-in properties. This check issues a transpile error when a class has a static
15851+
* of Function. Esp. in ECMAScript 5 there are non-configurable and non-writable
15852+
* built-in properties. This check issues a transpile error when a class has a static
1585315853
* member with the same name as a non-writable built-in property.
15854-
*
15854+
*
1585515855
* @see http://www.ecma-international.org/ecma-262/5.1/#sec-15.3.3
1585615856
* @see http://www.ecma-international.org/ecma-262/5.1/#sec-15.3.5
1585715857
* @see http://www.ecma-international.org/ecma-262/6.0/#sec-properties-of-the-function-constructor

0 commit comments

Comments
 (0)