(node)
| 80013 | } |
| 80014 | // DECLARATION AND STATEMENT TYPE CHECKING |
| 80015 | function checkTypeParameter(node) { |
| 80016 | // Grammar Checking |
| 80017 | checkGrammarModifiers(node); |
| 80018 | if (node.expression) { |
| 80019 | grammarErrorOnFirstToken(node.expression, ts.Diagnostics.Type_expected); |
| 80020 | } |
| 80021 | checkSourceElement(node.constraint); |
| 80022 | checkSourceElement(node.default); |
| 80023 | var typeParameter = getDeclaredTypeOfTypeParameter(getSymbolOfNode(node)); |
| 80024 | // Resolve base constraint to reveal circularity errors |
| 80025 | getBaseConstraintOfType(typeParameter); |
| 80026 | if (!hasNonCircularTypeParameterDefault(typeParameter)) { |
| 80027 | error(node.default, ts.Diagnostics.Type_parameter_0_has_a_circular_default, typeToString(typeParameter)); |
| 80028 | } |
| 80029 | var constraintType = getConstraintOfTypeParameter(typeParameter); |
| 80030 | var defaultType = getDefaultFromTypeParameter(typeParameter); |
| 80031 | if (constraintType && defaultType) { |
| 80032 | checkTypeAssignableTo(defaultType, getTypeWithThisArgument(instantiateType(constraintType, makeUnaryTypeMapper(typeParameter, defaultType)), defaultType), node.default, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); |
| 80033 | } |
| 80034 | checkNodeDeferred(node); |
| 80035 | addLazyDiagnostic(function () { return checkTypeNameIsReserved(node.name, ts.Diagnostics.Type_parameter_name_cannot_be_0); }); |
| 80036 | } |
| 80037 | function checkTypeParameterDeferred(node) { |
| 80038 | if (ts.isInterfaceDeclaration(node.parent) || ts.isClassLike(node.parent) || ts.isTypeAliasDeclaration(node.parent)) { |
| 80039 | var typeParameter = getDeclaredTypeOfTypeParameter(getSymbolOfNode(node)); |
no test coverage detected
searching dependent graphs…