@@ -164,7 +164,6 @@ namespace ts {
164
164
let getGlobalPromiseConstructorLikeType: () => ObjectType;
165
165
let getGlobalThenableType: () => ObjectType;
166
166
167
- let jsxElementClassType: Type;
168
167
let deferredNodes: Node[];
169
168
170
169
const tupleTypes: Map<TupleType> = {};
@@ -3941,10 +3940,6 @@ namespace ts {
3941
3940
return result;
3942
3941
}
3943
3942
3944
- function isRestOrOptionalParameter(node: ParameterDeclaration, skipSignatureCheck?: boolean) {
3945
- return isRestParameter(node) || isOptionalParameter(node, skipSignatureCheck);
3946
- }
3947
-
3948
3943
function isOptionalParameter(node: ParameterDeclaration, skipSignatureCheck?: boolean) {
3949
3944
if (node.parserContextFlags & ParserContextFlags.JavaScriptFile) {
3950
3945
if (node.type && node.type.kind === SyntaxKind.JSDocOptionalType) {
@@ -4014,7 +4009,6 @@ namespace ts {
4014
4009
let minArgumentCount = -1;
4015
4010
const isJSConstructSignature = isJSDocConstructSignature(declaration);
4016
4011
let returnType: Type = undefined;
4017
- let typePredicate: TypePredicate = undefined;
4018
4012
4019
4013
// If this is a JSDoc construct signature, then skip the first parameter in the
4020
4014
// parameter list. The first parameter represents the return type of the construct
@@ -4049,16 +4043,11 @@ namespace ts {
4049
4043
minArgumentCount = declaration.parameters.length;
4050
4044
}
4051
4045
4052
- <<<<<<< HEAD
4053
4046
if (isJSConstructSignature) {
4054
4047
minArgumentCount--;
4055
4048
returnType = getTypeFromTypeNode(declaration.parameters[0].type);
4056
4049
}
4057
4050
else if (classType) {
4058
- =======
4059
- let returnType: Type;
4060
- if (classType) {
4061
- >>>>>>> upstream/master
4062
4051
returnType = classType;
4063
4052
}
4064
4053
else if (declaration.type) {
@@ -4327,61 +4316,6 @@ namespace ts {
4327
4316
return type;
4328
4317
}
4329
4318
4330
- <<<<<<< HEAD
4331
- function isTypeParameterReferenceIllegalInConstraint(
4332
- typeReferenceNode: TypeReferenceNode | ExpressionWithTypeArguments | JSDocTypeReference,
4333
- typeParameterSymbol: Symbol): boolean {
4334
-
4335
- const links = getNodeLinks(typeReferenceNode);
4336
- if (links.isIllegalTypeReferenceInConstraint !== undefined) {
4337
- return links.isIllegalTypeReferenceInConstraint;
4338
- }
4339
-
4340
- // bubble up to the declaration
4341
- let currentNode: Node = typeReferenceNode;
4342
- // forEach === exists
4343
- while (!forEach(typeParameterSymbol.declarations, d => getTypeParameterOwner(d) === currentNode.parent)) {
4344
- currentNode = currentNode.parent;
4345
- }
4346
- // if last step was made from the type parameter this means that path has started somewhere in constraint which is illegal
4347
- links.isIllegalTypeReferenceInConstraint = currentNode.kind === SyntaxKind.TypeParameter;
4348
- return links.isIllegalTypeReferenceInConstraint;
4349
- }
4350
-
4351
- function checkTypeParameterHasIllegalReferencesInConstraint(typeParameter: TypeParameterDeclaration): void {
4352
- let typeParameterSymbol: Symbol;
4353
- function check(n: Node): void {
4354
- if (n.kind === SyntaxKind.TypeReference && (<TypeReferenceNode>n).typeName.kind === SyntaxKind.Identifier) {
4355
- const links = getNodeLinks(n);
4356
- if (links.isIllegalTypeReferenceInConstraint === undefined) {
4357
- const symbol = resolveName(typeParameter, (<Identifier>(<TypeReferenceNode>n).typeName).text, SymbolFlags.Type, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined);
4358
- if (symbol && (symbol.flags & SymbolFlags.TypeParameter)) {
4359
- // TypeScript 1.0 spec (April 2014): 3.4.1
4360
- // Type parameters declared in a particular type parameter list
4361
- // may not be referenced in constraints in that type parameter list
4362
-
4363
- // symbol.declaration.parent === typeParameter.parent
4364
- // -> typeParameter and symbol.declaration originate from the same type parameter list
4365
- // -> illegal for all declarations in symbol
4366
- // forEach === exists
4367
- links.isIllegalTypeReferenceInConstraint = forEach(symbol.declarations, d => d.parent === typeParameter.parent);
4368
- }
4369
- }
4370
- if (links.isIllegalTypeReferenceInConstraint) {
4371
- error(typeParameter, Diagnostics.Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list);
4372
- }
4373
- }
4374
- forEachChild(n, check);
4375
- }
4376
-
4377
- if (typeParameter.constraint) {
4378
- typeParameterSymbol = getSymbolOfNode(typeParameter);
4379
- check(typeParameter.constraint);
4380
- }
4381
- }
4382
-
4383
- =======
4384
- >>>>>>> upstream/master
4385
4319
// Get type from reference to class or interface
4386
4320
function getTypeFromClassOrInterfaceReference(node: TypeReferenceNode | ExpressionWithTypeArguments | JSDocTypeReference, symbol: Symbol): Type {
4387
4321
const type = <InterfaceType>getDeclaredTypeOfSymbol(symbol);
@@ -4428,18 +4362,7 @@ namespace ts {
4428
4362
}
4429
4363
4430
4364
// Get type from reference to named type that cannot be generic (enum or type parameter)
4431
- <<<<<<< HEAD
4432
4365
function getTypeFromNonGenericTypeReference(node: TypeReferenceNode | ExpressionWithTypeArguments | JSDocTypeReference, symbol: Symbol): Type {
4433
- if (symbol.flags & SymbolFlags.TypeParameter && isTypeParameterReferenceIllegalInConstraint(node, symbol)) {
4434
- // TypeScript 1.0 spec (April 2014): 3.4.1
4435
- // Type parameters declared in a particular type parameter list
4436
- // may not be referenced in constraints in that type parameter list
4437
- // Implementation: such type references are resolved to 'unknown' type that usually denotes error
4438
- return unknownType;
4439
- }
4440
- =======
4441
- function getTypeFromNonGenericTypeReference(node: TypeReferenceNode | ExpressionWithTypeArguments, symbol: Symbol): Type {
4442
- >>>>>>> upstream/master
4443
4366
if (node.typeArguments) {
4444
4367
error(node, Diagnostics.Type_0_is_not_generic, symbolToString(symbol));
4445
4368
return unknownType;
@@ -7421,12 +7344,13 @@ namespace ts {
7421
7344
return container.flags & NodeFlags.Static ? getTypeOfSymbol(symbol) : (<InterfaceType>getDeclaredTypeOfSymbol(symbol)).thisType;
7422
7345
}
7423
7346
7424
- <<<<<<< HEAD
7425
7347
if (container.parserContextFlags & ParserContextFlags.JavaScriptFile) {
7426
7348
const type = getTypeForThisExpressionFromJSDoc(container);
7427
7349
if (type && type !== unknownType) {
7428
7350
return type;
7429
- =======
7351
+ }
7352
+ }
7353
+
7430
7354
// If this is a function in a JS file, it might be a class method. Check if it's the RHS
7431
7355
// of a x.prototype.y = function [name]() { .... }
7432
7356
if (isInJavaScriptFile(node) && container.kind === SyntaxKind.FunctionExpression) {
@@ -7440,7 +7364,6 @@ namespace ts {
7440
7364
if (classSymbol && classSymbol.members && (classSymbol.flags & SymbolFlags.Function)) {
7441
7365
return getInferredClassType(classSymbol);
7442
7366
}
7443
- >>>>>>> upstream/master
7444
7367
}
7445
7368
}
7446
7369
0 commit comments