Introduce a new HeritageClauseElment type.

This type represents the expression+type arguments you can get in a class or interface
heritage clause section.  For class-implements clauses, or interface-extends clauses,
these expressions can only be identifiers or dotted names.  For class extends clauses,
these could be any expressions in the future.  However, for now, we only support identifiers
and dotted names.
This commit is contained in:
Cyrus Najmabadi 2015-03-31 12:29:02 -07:00
parent 616f638b54
commit a1e18fc22b
68 changed files with 7460 additions and 770 deletions

View File

@ -582,7 +582,7 @@ module ts {
if (moduleSymbol.flags & SymbolFlags.Variable) {
let typeAnnotation = (<VariableDeclaration>moduleSymbol.valueDeclaration).type;
if (typeAnnotation) {
return getPropertyOfType(getTypeFromTypeNode(typeAnnotation), name);
return getPropertyOfType(getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(typeAnnotation), name);
}
}
}
@ -631,7 +631,7 @@ module ts {
if (symbol.flags & SymbolFlags.Variable) {
var typeAnnotation = (<VariableDeclaration>symbol.valueDeclaration).type;
if (typeAnnotation) {
return resolveSymbol(getPropertyOfType(getTypeFromTypeNode(typeAnnotation), name));
return resolveSymbol(getPropertyOfType(getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(typeAnnotation), name));
}
}
}
@ -773,7 +773,7 @@ module ts {
}
// Resolves a qualified name and any involved aliases
function resolveEntityName(name: EntityName, meaning: SymbolFlags): Symbol {
function resolveEntityName(name: EntityName | Expression, meaning: SymbolFlags): Symbol {
if (getFullWidth(name) === 0) {
return undefined;
}
@ -785,18 +785,23 @@ module ts {
return undefined;
}
}
else if (name.kind === SyntaxKind.QualifiedName) {
let namespace = resolveEntityName((<QualifiedName>name).left, SymbolFlags.Namespace);
if (!namespace || namespace === unknownSymbol || getFullWidth((<QualifiedName>name).right) === 0) {
else if (name.kind === SyntaxKind.QualifiedName || name.kind === SyntaxKind.PropertyAccessExpression) {
let left = name.kind === SyntaxKind.QualifiedName ? (<QualifiedName>name).left : (<PropertyAccessExpression>name).expression;
let right = name.kind === SyntaxKind.QualifiedName ? (<QualifiedName>name).right : (<PropertyAccessExpression>name).name;
let namespace = resolveEntityName(left, SymbolFlags.Namespace);
if (!namespace || namespace === unknownSymbol || getFullWidth(right) === 0) {
return undefined;
}
let right = (<QualifiedName>name).right;
symbol = getSymbol(getExportsOfSymbol(namespace), right.text, meaning);
if (!symbol) {
error(right, Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(namespace), declarationNameToString(right));
return undefined;
}
}
else {
Debug.fail("Unknown entity name kind.");
}
Debug.assert((symbol.flags & SymbolFlags.Instantiated) === 0, "Should never get an instantiated symbol here.");
return symbol.flags & meaning ? symbol : resolveAlias(symbol);
}
@ -1255,14 +1260,15 @@ module ts {
}
}
function isEntityNameVisible(entityName: EntityName, enclosingDeclaration: Node): SymbolVisibilityResult {
function isEntityNameVisible(entityName: EntityName | Expression, enclosingDeclaration: Node): SymbolVisibilityResult {
// get symbol of the first identifier of the entityName
let meaning: SymbolFlags;
if (entityName.parent.kind === SyntaxKind.TypeQuery) {
// Typeof value
meaning = SymbolFlags.Value | SymbolFlags.ExportValue;
}
else if (entityName.kind === SyntaxKind.QualifiedName ||
else if (entityName.kind === SyntaxKind.QualifiedName || entityName.kind === SyntaxKind.PropertyAccessExpression ||
entityName.parent.kind === SyntaxKind.ImportEqualsDeclaration) {
// Left identifier from type reference or TypeAlias
// Entity name of the import declaration
@ -2088,7 +2094,7 @@ module ts {
}
// Use type from type annotation if one is present
if (declaration.type) {
return getTypeFromTypeNode(declaration.type);
return getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(declaration.type);
}
if (declaration.kind === SyntaxKind.Parameter) {
let func = <FunctionLikeDeclaration>declaration.parent;
@ -2225,7 +2231,7 @@ module ts {
return links.type = checkExpression(exportAssignment.expression);
}
else if (exportAssignment.type) {
return links.type = getTypeFromTypeNode(exportAssignment.type);
return links.type = getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(exportAssignment.type);
}
else {
return links.type = anyType;
@ -2257,11 +2263,11 @@ module ts {
function getAnnotatedAccessorType(accessor: AccessorDeclaration): Type {
if (accessor) {
if (accessor.kind === SyntaxKind.GetAccessor) {
return accessor.type && getTypeFromTypeNode(accessor.type);
return accessor.type && getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(accessor.type);
}
else {
let setterTypeAnnotation = getSetAccessorTypeAnnotationNode(accessor);
return setterTypeAnnotation && getTypeFromTypeNode(setterTypeAnnotation);
return setterTypeAnnotation && getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(setterTypeAnnotation);
}
}
return undefined;
@ -2429,7 +2435,7 @@ module ts {
let declaration = <ClassDeclaration>getDeclarationOfKind(symbol, SyntaxKind.ClassDeclaration);
let baseTypeNode = getClassBaseTypeNode(declaration);
if (baseTypeNode) {
let baseType = getTypeFromTypeReferenceNode(baseTypeNode);
let baseType = getTypeFromTypeReferenceOrHeritageClauseElement(baseTypeNode);
if (baseType !== unknownType) {
if (getTargetType(baseType).flags & TypeFlags.Class) {
if (type !== baseType && !hasBaseType(<InterfaceType>baseType, type)) {
@ -2470,7 +2476,8 @@ module ts {
forEach(symbol.declarations, declaration => {
if (declaration.kind === SyntaxKind.InterfaceDeclaration && getInterfaceBaseTypeNodes(<InterfaceDeclaration>declaration)) {
forEach(getInterfaceBaseTypeNodes(<InterfaceDeclaration>declaration), node => {
let baseType = getTypeFromTypeReferenceNode(node);
let baseType = getTypeFromTypeReferenceOrHeritageClauseElement(node);
if (baseType !== unknownType) {
if (getTargetType(baseType).flags & (TypeFlags.Class | TypeFlags.Interface)) {
if (type !== baseType && !hasBaseType(<InterfaceType>baseType, type)) {
@ -2501,7 +2508,7 @@ module ts {
if (!links.declaredType) {
links.declaredType = resolvingType;
let declaration = <TypeAliasDeclaration>getDeclarationOfKind(symbol, SyntaxKind.TypeAliasDeclaration);
let type = getTypeFromTypeNode(declaration.type);
let type = getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(declaration.type);
if (links.declaredType === resolvingType) {
links.declaredType = type;
}
@ -3043,7 +3050,7 @@ module ts {
returnType = classType;
}
else if (declaration.type) {
returnType = getTypeFromTypeNode(declaration.type);
returnType = getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(declaration.type);
}
else {
// TypeScript 1.0 spec (April 2014):
@ -3201,7 +3208,7 @@ module ts {
function getIndexTypeOfSymbol(symbol: Symbol, kind: IndexKind): Type {
let declaration = getIndexDeclarationOfSymbol(symbol, kind);
return declaration
? declaration.type ? getTypeFromTypeNode(declaration.type) : anyType
? declaration.type ? getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(declaration.type) : anyType
: undefined;
}
@ -3212,7 +3219,7 @@ module ts {
type.constraint = targetConstraint ? instantiateType(targetConstraint, type.mapper) : noConstraintType;
}
else {
type.constraint = getTypeFromTypeNode((<TypeParameterDeclaration>getDeclarationOfKind(type.symbol, SyntaxKind.TypeParameter)).constraint);
type.constraint = getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement((<TypeParameterDeclaration>getDeclarationOfKind(type.symbol, SyntaxKind.TypeParameter)).constraint);
}
}
return type.constraint === noConstraintType ? undefined : type.constraint;
@ -3260,7 +3267,7 @@ module ts {
return type;
}
function isTypeParameterReferenceIllegalInConstraint(typeReferenceNode: TypeReferenceNode, typeParameterSymbol: Symbol): boolean {
function isTypeParameterReferenceIllegalInConstraint(typeReferenceNode: TypeReferenceNode | HeritageClauseElement, typeParameterSymbol: Symbol): boolean {
let links = getNodeLinks(typeReferenceNode);
if (links.isIllegalTypeReferenceInConstraint !== undefined) {
return links.isIllegalTypeReferenceInConstraint;
@ -3309,39 +3316,47 @@ module ts {
}
}
function getTypeFromTypeReferenceNode(node: TypeReferenceNode): Type {
function getTypeFromTypeReferenceOrHeritageClauseElement(node: TypeReferenceNode | HeritageClauseElement): Type {
let links = getNodeLinks(node);
if (!links.resolvedType) {
let symbol = resolveEntityName(node.typeName, SymbolFlags.Type);
let type: Type;
if (symbol) {
if ((symbol.flags & SymbolFlags.TypeParameter) && isTypeParameterReferenceIllegalInConstraint(node, symbol)) {
// TypeScript 1.0 spec (April 2014): 3.4.1
// Type parameters declared in a particular type parameter list
// may not be referenced in constraints in that type parameter list
// Implementation: such type references are resolved to 'unknown' type that usually denotes error
type = unknownType;
}
else {
type = getDeclaredTypeOfSymbol(symbol);
if (type.flags & (TypeFlags.Class | TypeFlags.Interface) && type.flags & TypeFlags.Reference) {
let typeParameters = (<InterfaceType>type).typeParameters;
if (node.typeArguments && node.typeArguments.length === typeParameters.length) {
type = createTypeReference(<GenericType>type, map(node.typeArguments, getTypeFromTypeNode));
}
else {
error(node, Diagnostics.Generic_type_0_requires_1_type_argument_s, typeToString(type, /*enclosingDeclaration*/ undefined, TypeFormatFlags.WriteArrayAsGenericType), typeParameters.length);
type = undefined;
}
if (node.kind !== SyntaxKind.HeritageClauseElement || isSupportedHeritageClauseElement(<HeritageClauseElement>node)) {
let typeNameOrExpression = node.kind === SyntaxKind.TypeReference
? (<TypeReferenceNode>node).typeName
: (<HeritageClauseElement>node).expression;
let symbol = resolveEntityName(typeNameOrExpression, SymbolFlags.Type);
if (symbol) {
if ((symbol.flags & SymbolFlags.TypeParameter) && isTypeParameterReferenceIllegalInConstraint(node, symbol)) {
// TypeScript 1.0 spec (April 2014): 3.4.1
// Type parameters declared in a particular type parameter list
// may not be referenced in constraints in that type parameter list
// Implementation: such type references are resolved to 'unknown' type that usually denotes error
type = unknownType;
}
else {
if (node.typeArguments) {
error(node, Diagnostics.Type_0_is_not_generic, typeToString(type));
type = undefined;
type = getDeclaredTypeOfSymbol(symbol);
if (type.flags & (TypeFlags.Class | TypeFlags.Interface) && type.flags & TypeFlags.Reference) {
let typeParameters = (<InterfaceType>type).typeParameters;
if (node.typeArguments && node.typeArguments.length === typeParameters.length) {
type = createTypeReference(<GenericType>type, map(node.typeArguments, getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement));
}
else {
error(node, Diagnostics.Generic_type_0_requires_1_type_argument_s, typeToString(type, /*enclosingDeclaration*/ undefined, TypeFormatFlags.WriteArrayAsGenericType), typeParameters.length);
type = undefined;
}
}
else {
if (node.typeArguments) {
error(node, Diagnostics.Type_0_is_not_generic, typeToString(type));
type = undefined;
}
}
}
}
}
links.resolvedType = type || unknownType;
}
return links.resolvedType;
@ -3419,7 +3434,7 @@ module ts {
function getTypeFromArrayTypeNode(node: ArrayTypeNode): Type {
let links = getNodeLinks(node);
if (!links.resolvedType) {
links.resolvedType = createArrayType(getTypeFromTypeNode(node.elementType));
links.resolvedType = createArrayType(getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(node.elementType));
}
return links.resolvedType;
}
@ -3437,7 +3452,7 @@ module ts {
function getTypeFromTupleTypeNode(node: TupleTypeNode): Type {
let links = getNodeLinks(node);
if (!links.resolvedType) {
links.resolvedType = createTupleType(map(node.elementTypes, getTypeFromTypeNode));
links.resolvedType = createTupleType(map(node.elementTypes, getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement));
}
return links.resolvedType;
}
@ -3533,7 +3548,7 @@ module ts {
function getTypeFromUnionTypeNode(node: UnionTypeNode): Type {
let links = getNodeLinks(node);
if (!links.resolvedType) {
links.resolvedType = getUnionType(map(node.types, getTypeFromTypeNode), /*noSubtypeReduction*/ true);
links.resolvedType = getUnionType(map(node.types, getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement), /*noSubtypeReduction*/ true);
}
return links.resolvedType;
}
@ -3565,7 +3580,7 @@ module ts {
return links.resolvedType;
}
function getTypeFromTypeNode(node: TypeNode | LiteralExpression): Type {
function getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(node: TypeNode | LiteralExpression | HeritageClauseElement): Type {
switch (node.kind) {
case SyntaxKind.AnyKeyword:
return anyType;
@ -3582,7 +3597,9 @@ module ts {
case SyntaxKind.StringLiteral:
return getTypeFromStringLiteral(<LiteralExpression>node);
case SyntaxKind.TypeReference:
return getTypeFromTypeReferenceNode(<TypeReferenceNode>node);
return getTypeFromTypeReferenceOrHeritageClauseElement(<TypeReferenceNode>node);
case SyntaxKind.HeritageClauseElement:
return getTypeFromTypeReferenceOrHeritageClauseElement(<HeritageClauseElement>node);
case SyntaxKind.TypeQuery:
return getTypeFromTypeQueryNode(<TypeQueryNode>node);
case SyntaxKind.ArrayType:
@ -3592,7 +3609,7 @@ module ts {
case SyntaxKind.UnionType:
return getTypeFromUnionTypeNode(<UnionTypeNode>node);
case SyntaxKind.ParenthesizedType:
return getTypeFromTypeNode((<ParenthesizedTypeNode>node).type);
return getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement((<ParenthesizedTypeNode>node).type);
case SyntaxKind.FunctionType:
case SyntaxKind.ConstructorType:
case SyntaxKind.TypeLiteral:
@ -5593,7 +5610,7 @@ module ts {
let declaration = <VariableLikeDeclaration>node.parent;
if (node === declaration.initializer) {
if (declaration.type) {
return getTypeFromTypeNode(declaration.type);
return getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(declaration.type);
}
if (declaration.kind === SyntaxKind.Parameter) {
let type = getContextuallyTypedParameterType(<ParameterDeclaration>declaration);
@ -5796,7 +5813,7 @@ module ts {
case SyntaxKind.NewExpression:
return getContextualTypeForArgument(<CallExpression>parent, node);
case SyntaxKind.TypeAssertionExpression:
return getTypeFromTypeNode((<TypeAssertion>parent).type);
return getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement((<TypeAssertion>parent).type);
case SyntaxKind.BinaryExpression:
return getContextualTypeForBinaryOperand(node);
case SyntaxKind.PropertyAssignment:
@ -6597,7 +6614,7 @@ module ts {
let typeArgumentsAreAssignable = true;
for (let i = 0; i < typeParameters.length; i++) {
let typeArgNode = typeArguments[i];
let typeArgument = getTypeFromTypeNode(typeArgNode);
let typeArgument = getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(typeArgNode);
// Do not push on this array! It has a preallocated length
typeArgumentResultTypes[i] = typeArgument;
if (typeArgumentsAreAssignable /* so far */) {
@ -7079,7 +7096,7 @@ module ts {
function checkTypeAssertion(node: TypeAssertion): Type {
let exprType = checkExpression(node.expression);
let targetType = getTypeFromTypeNode(node.type);
let targetType = getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(node.type);
if (produceDiagnostics && targetType !== unknownType) {
let widenedType = getWidenedType(exprType);
if (!(isTypeAssignableTo(targetType, widenedType))) {
@ -7258,7 +7275,7 @@ module ts {
function checkFunctionExpressionOrObjectLiteralMethodBody(node: FunctionExpression | MethodDeclaration) {
Debug.assert(node.kind !== SyntaxKind.MethodDeclaration || isObjectLiteralMethod(node));
if (node.type) {
checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNode(node.type));
checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(node.type));
}
if (node.body) {
@ -7268,7 +7285,7 @@ module ts {
else {
let exprType = checkExpression(<Expression>node.body);
if (node.type) {
checkTypeAssignableTo(exprType, getTypeFromTypeNode(node.type), node.body, /*headMessage*/ undefined);
checkTypeAssignableTo(exprType, getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(node.type), node.body, /*headMessage*/ undefined);
}
checkFunctionExpressionBodies(node.body);
}
@ -8272,11 +8289,11 @@ module ts {
checkDecorators(node);
}
function checkTypeReference(node: TypeReferenceNode) {
function checkTypeReferenceOrHeritageClauseElement(node: TypeReferenceNode | HeritageClauseElement) {
// Grammar checking
checkGrammarTypeArguments(node, node.typeArguments);
let type = getTypeFromTypeReferenceNode(node);
let type = getTypeFromTypeReferenceOrHeritageClauseElement(node);
if (type !== unknownType && node.typeArguments) {
// Do type argument local checks only if referenced type is successfully resolved
let len = node.typeArguments.length;
@ -8767,7 +8784,7 @@ module ts {
checkSourceElement(node.body);
if (node.type && !isAccessor(node.kind)) {
checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNode(node.type));
checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(node.type));
}
// Report an implicit any error if there is no body, no explicit return type, and node is not a private method
@ -9731,8 +9748,12 @@ module ts {
let staticType = <ObjectType>getTypeOfSymbol(symbol);
let baseTypeNode = getClassBaseTypeNode(node);
if (baseTypeNode) {
if (!isSupportedHeritageClauseElement(baseTypeNode)) {
error(baseTypeNode.expression, Diagnostics.Only_type_references_are_currently_supported_in_a_class_extends_clauses);
}
emitExtends = emitExtends || !isInAmbientContext(node);
checkTypeReference(baseTypeNode);
checkTypeReferenceOrHeritageClauseElement(baseTypeNode);
}
if (type.baseTypes.length) {
if (produceDiagnostics) {
@ -9741,7 +9762,8 @@ module ts {
let staticBaseType = getTypeOfSymbol(baseType.symbol);
checkTypeAssignableTo(staticType, getTypeWithoutConstructors(staticBaseType), node.name || node,
Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1);
if (baseType.symbol !== resolveEntityName(baseTypeNode.typeName, SymbolFlags.Value)) {
if (baseType.symbol !== resolveEntityName(baseTypeNode.expression, SymbolFlags.Value)) {
error(baseTypeNode, Diagnostics.Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0, typeToString(baseType));
}
@ -9749,15 +9771,19 @@ module ts {
}
// Check that base type can be evaluated as expression
checkExpressionOrQualifiedName(baseTypeNode.typeName);
checkExpressionOrQualifiedName(baseTypeNode.expression);
}
let implementedTypeNodes = getClassImplementedTypeNodes(node);
if (implementedTypeNodes) {
forEach(implementedTypeNodes, typeRefNode => {
checkTypeReference(typeRefNode);
if (!isSupportedHeritageClauseElement(typeRefNode)) {
error(typeRefNode.expression, Diagnostics.A_class_can_only_implement_type_references);
}
checkTypeReferenceOrHeritageClauseElement(typeRefNode);
if (produceDiagnostics) {
let t = getTypeFromTypeReferenceNode(typeRefNode);
let t = getTypeFromTypeReferenceOrHeritageClauseElement(typeRefNode);
if (t !== unknownType) {
let declaredType = (t.flags & TypeFlags.Reference) ? (<TypeReference>t).target : t;
if (declaredType.flags & (TypeFlags.Class | TypeFlags.Interface)) {
@ -9879,7 +9905,7 @@ module ts {
if (!tp1.constraint || !tp2.constraint) {
return false;
}
if (!isTypeIdenticalTo(getTypeFromTypeNode(tp1.constraint), getTypeFromTypeNode(tp2.constraint))) {
if (!isTypeIdenticalTo(getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(tp1.constraint), getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(tp2.constraint))) {
return false;
}
}
@ -9950,7 +9976,13 @@ module ts {
}
}
}
forEach(getInterfaceBaseTypeNodes(node), checkTypeReference);
forEach(getInterfaceBaseTypeNodes(node), heritageElement => {
if (!isSupportedHeritageClauseElement(heritageElement)) {
error(heritageElement.expression, Diagnostics.An_interface_can_only_extend_a_type_reference);
}
checkTypeReferenceOrHeritageClauseElement(heritageElement);
});
forEach(node.members, checkSourceElement);
if (produceDiagnostics) {
@ -10248,10 +10280,19 @@ module ts {
checkSourceElement(node.body);
}
function getFirstIdentifier(node: EntityName): Identifier {
while (node.kind === SyntaxKind.QualifiedName) {
node = (<QualifiedName>node).left;
function getFirstIdentifier(node: EntityName | Expression): Identifier {
while (true) {
if (node.kind === SyntaxKind.QualifiedName) {
node = (<QualifiedName>node).left;
}
else if (node.kind === SyntaxKind.PropertyAccessExpression) {
node = (<PropertyAccessExpression>node).expression;
}
else {
break;
}
}
Debug.assert(node.kind === SyntaxKind.Identifier);
return <Identifier>node;
}
@ -10478,7 +10519,7 @@ module ts {
case SyntaxKind.SetAccessor:
return checkAccessorDeclaration(<AccessorDeclaration>node);
case SyntaxKind.TypeReference:
return checkTypeReference(<TypeReferenceNode>node);
return checkTypeReferenceOrHeritageClauseElement(<TypeReferenceNode>node);
case SyntaxKind.TypeQuery:
return checkTypeQuery(<TypeQueryNode>node);
case SyntaxKind.TypeLiteral:
@ -10854,11 +10895,23 @@ module ts {
// True if the given identifier is part of a type reference
function isTypeReferenceIdentifier(entityName: EntityName): boolean {
let node: Node = entityName;
while (node.parent && node.parent.kind === SyntaxKind.QualifiedName) node = node.parent;
while (node.parent && node.parent.kind === SyntaxKind.QualifiedName) {
node = node.parent;
}
return node.parent && node.parent.kind === SyntaxKind.TypeReference;
}
function isTypeNode(node: Node): boolean {
function isHeritageClauseElementIdentifier(entityName: Node): boolean {
let node = entityName;
while (node.parent && node.parent.kind === SyntaxKind.PropertyAccessExpression) {
node = node.parent;
}
return node.parent && node.parent.kind === SyntaxKind.HeritageClauseElement;
}
function isTypeNodeOrStringLiteralTypeOrHeritageClauseElement(node: Node): boolean {
if (SyntaxKind.FirstTypeNode <= node.kind && node.kind <= SyntaxKind.LastTypeNode) {
return true;
}
@ -10875,6 +10928,8 @@ module ts {
case SyntaxKind.StringLiteral:
// Specialized signatures can have string literals as their parameters' type names
return node.parent.kind === SyntaxKind.Parameter;
case SyntaxKind.HeritageClauseElement:
return true;
// Identifiers and qualified names may be type nodes, depending on their context. Climb
// above them to find the lowest container
@ -10883,10 +10938,15 @@ module ts {
if (node.parent.kind === SyntaxKind.QualifiedName && (<QualifiedName>node.parent).right === node) {
node = node.parent;
}
else if (node.parent.kind === SyntaxKind.PropertyAccessExpression && (<PropertyAccessExpression>node.parent).name === node) {
node = node.parent;
}
// fall through
case SyntaxKind.QualifiedName:
case SyntaxKind.PropertyAccessExpression:
// At this point, node is either a qualified name or an identifier
Debug.assert(node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.QualifiedName, "'node' was expected to be a qualified name or identifier in 'isTypeNode'.");
Debug.assert(node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.QualifiedName || node.kind === SyntaxKind.PropertyAccessExpression,
"'node' was expected to be a qualified name, identifier or property access in 'isTypeNode'.");
let parent = node.parent;
if (parent.kind === SyntaxKind.TypeQuery) {
@ -10902,6 +10962,8 @@ module ts {
return true;
}
switch (parent.kind) {
case SyntaxKind.HeritageClauseElement:
return true;
case SyntaxKind.TypeParameter:
return node === (<TypeParameterDeclaration>parent).constraint;
case SyntaxKind.PropertyDeclaration:
@ -10956,11 +11018,6 @@ module ts {
return getLeftSideOfImportEqualsOrExportAssignment(node) !== undefined;
}
function isRightSideOfQualifiedNameOrPropertyAccess(node: Node) {
return (node.parent.kind === SyntaxKind.QualifiedName && (<QualifiedName>node.parent).right === node) ||
(node.parent.kind === SyntaxKind.PropertyAccessExpression && (<PropertyAccessExpression>node.parent).name === node);
}
function getSymbolOfEntityNameOrPropertyAccessExpression(entityName: EntityName | PropertyAccessExpression): Symbol {
if (isDeclarationName(entityName)) {
return getSymbolOfNode(entityName.parent);
@ -10982,7 +11039,12 @@ module ts {
entityName = <QualifiedName | PropertyAccessExpression>entityName.parent;
}
if (isExpression(entityName)) {
if (isHeritageClauseElementIdentifier(<EntityName>entityName)) {
let meaning = entityName.parent.kind === SyntaxKind.HeritageClauseElement ? SymbolFlags.Type : SymbolFlags.Namespace;
meaning |= SymbolFlags.Alias;
return resolveEntityName(<EntityName>entityName, meaning);
}
else if (isExpression(entityName)) {
if (getFullWidth(entityName) === 0) {
// Missing entity name.
return undefined;
@ -11098,12 +11160,12 @@ module ts {
return unknownType;
}
if (isExpression(node)) {
return getTypeOfExpression(<Expression>node);
if (isTypeNodeOrStringLiteralTypeOrHeritageClauseElement(node)) {
return getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(<TypeNode>node);
}
if (isTypeNode(node)) {
return getTypeFromTypeNode(<TypeNode>node);
if (isExpression(node)) {
return getTypeOfExpression(<Expression>node);
}
if (isTypeDeclaration(node)) {

View File

@ -314,12 +314,12 @@ module ts {
}
}
function emitTypeWithNewGetSymbolAccessibilityDiagnostic(type: TypeNode | EntityName, getSymbolAccessibilityDiagnostic: GetSymbolAccessibilityDiagnostic) {
function emitTypeWithNewGetSymbolAccessibilityDiagnostic(type: TypeNode | EntityName | HeritageClauseElement, getSymbolAccessibilityDiagnostic: GetSymbolAccessibilityDiagnostic) {
writer.getSymbolAccessibilityDiagnostic = getSymbolAccessibilityDiagnostic;
emitType(type);
}
function emitType(type: TypeNode | StringLiteralExpression | Identifier | QualifiedName) {
function emitType(type: TypeNode | StringLiteralExpression | Identifier | QualifiedName | HeritageClauseElement) {
switch (type.kind) {
case SyntaxKind.AnyKeyword:
case SyntaxKind.StringKeyword:
@ -329,6 +329,8 @@ module ts {
case SyntaxKind.VoidKeyword:
case SyntaxKind.StringLiteral:
return writeTextOfNode(currentSourceFile, type);
case SyntaxKind.HeritageClauseElement:
return emitHeritageClauseElement(<HeritageClauseElement>type);
case SyntaxKind.TypeReference:
return emitTypeReference(<TypeReferenceNode>type);
case SyntaxKind.TypeQuery:
@ -350,11 +352,9 @@ module ts {
return emitEntityName(<Identifier>type);
case SyntaxKind.QualifiedName:
return emitEntityName(<QualifiedName>type);
default:
Debug.fail("Unknown type annotation: " + type.kind);
}
function emitEntityName(entityName: EntityName) {
function emitEntityName(entityName: EntityName | PropertyAccessExpression) {
let visibilityResult = resolver.isEntityNameVisible(entityName,
// Aliases can be written asynchronously so use correct enclosing declaration
entityName.parent.kind === SyntaxKind.ImportEqualsDeclaration ? entityName.parent : enclosingDeclaration);
@ -362,15 +362,28 @@ module ts {
handleSymbolAccessibilityError(visibilityResult);
writeEntityName(entityName);
function writeEntityName(entityName: EntityName) {
function writeEntityName(entityName: EntityName | Expression) {
if (entityName.kind === SyntaxKind.Identifier) {
writeTextOfNode(currentSourceFile, entityName);
}
else {
let qualifiedName = <QualifiedName>entityName;
writeEntityName(qualifiedName.left);
let left = entityName.kind === SyntaxKind.QualifiedName ? (<QualifiedName>entityName).left : (<PropertyAccessExpression>entityName).expression;
let right = entityName.kind === SyntaxKind.QualifiedName ? (<QualifiedName>entityName).right : (<PropertyAccessExpression>entityName).name;
writeEntityName(left);
write(".");
writeTextOfNode(currentSourceFile, qualifiedName.right);
writeTextOfNode(currentSourceFile, right);
}
}
}
function emitHeritageClauseElement(node: HeritageClauseElement) {
if (isSupportedHeritageClauseElement(node)) {
Debug.assert(node.expression.kind === SyntaxKind.Identifier || node.expression.kind === SyntaxKind.PropertyAccessExpression);
emitEntityName(<Identifier | PropertyAccessExpression>node.expression);
if (node.typeArguments) {
write("<");
emitCommaList(node.typeArguments, emitType);
write(">");
}
}
}
@ -827,14 +840,16 @@ module ts {
}
}
function emitHeritageClause(typeReferences: TypeReferenceNode[], isImplementsList: boolean) {
function emitHeritageClause(typeReferences: HeritageClauseElement[], isImplementsList: boolean) {
if (typeReferences) {
write(isImplementsList ? " implements " : " extends ");
emitCommaList(typeReferences, emitTypeOfTypeReference);
}
function emitTypeOfTypeReference(node: TypeReferenceNode) {
emitTypeWithNewGetSymbolAccessibilityDiagnostic(node, getHeritageClauseVisibilityError);
function emitTypeOfTypeReference(node: HeritageClauseElement) {
if (isSupportedHeritageClauseElement(node)) {
emitTypeWithNewGetSymbolAccessibilityDiagnostic(node, getHeritageClauseVisibilityError);
}
function getHeritageClauseVisibilityError(symbolAccesibilityResult: SymbolAccessiblityResult): SymbolAccessibilityDiagnostic {
let diagnosticMessage: DiagnosticMessage;

View File

@ -351,6 +351,8 @@ module ts {
The_arguments_object_cannot_be_referenced_in_an_arrow_function_Consider_using_a_standard_function_expression: { code: 2496, category: DiagnosticCategory.Error, key: "The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression." },
External_module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct: { code: 2497, category: DiagnosticCategory.Error, key: "External module '{0}' resolves to a non-module entity and cannot be imported using this construct." },
External_module_0_uses_export_and_cannot_be_used_with_export_Asterisk: { code: 2498, category: DiagnosticCategory.Error, key: "External module '{0}' uses 'export =' and cannot be used with 'export *'." },
An_interface_can_only_extend_a_type_reference: { code: 2499, category: DiagnosticCategory.Error, key: "An interface can only extend a type reference." },
A_class_can_only_implement_type_references: { code: 2500, category: DiagnosticCategory.Error, key: "A class can only implement type references." },
Import_declaration_0_is_using_private_name_1: { code: 4000, category: DiagnosticCategory.Error, key: "Import declaration '{0}' is using private name '{1}'." },
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported class has or is using private name '{1}'." },
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4004, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported interface has or is using private name '{1}'." },
@ -498,5 +500,6 @@ module ts {
You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: { code: 8001, category: DiagnosticCategory.Error, key: "You cannot rename elements that are defined in the standard TypeScript library." },
yield_expressions_are_not_currently_supported: { code: 9000, category: DiagnosticCategory.Error, key: "'yield' expressions are not currently supported." },
Generators_are_not_currently_supported: { code: 9001, category: DiagnosticCategory.Error, key: "Generators are not currently supported." },
Only_type_references_are_currently_supported_in_a_class_extends_clauses: { code: 9002, category: DiagnosticCategory.Error, key: "Only type references are currently supported in a class 'extends' clauses." },
};
}

View File

@ -1396,6 +1396,14 @@
"category": "Error",
"code": 2498
},
"An interface can only extend a type reference.": {
"category": "Error",
"code": 2499
},
"A class can only implement type references.": {
"category": "Error",
"code": 2500
},
"Import declaration '{0}' is using private name '{1}'.": {
"category": "Error",
@ -1985,5 +1993,9 @@
"Generators are not currently supported.": {
"category": "Error",
"code": 9001
},
"Only type references are currently supported in a class 'extends' clauses.": {
"category": "Error",
"code": 9002
}
}

View File

@ -3314,7 +3314,7 @@ module ts {
}
}
function emitConstructor(node: ClassDeclaration, baseTypeNode: TypeReferenceNode) {
function emitConstructor(node: ClassDeclaration, baseTypeElement: HeritageClauseElement) {
let saveTempFlags = tempFlags;
let saveTempVariables = tempVariables;
let saveTempParameters = tempParameters;
@ -3368,7 +3368,7 @@ module ts {
// Let constructor be the result of parsing the String "constructor(... args){ super (...args);}" using the syntactic grammar with the goal symbol MethodDefinition.
// Else,
// Let constructor be the result of parsing the String "constructor( ){ }" using the syntactic grammar with the goal symbol MethodDefinition
if (baseTypeNode) {
if (baseTypeElement) {
write("(...args)");
}
else {
@ -3387,7 +3387,7 @@ module ts {
if (ctor) {
emitDefaultValueAssignments(ctor);
emitRestParameter(ctor);
if (baseTypeNode) {
if (baseTypeElement) {
var superCall = findInitialSuperCall(ctor);
if (superCall) {
writeLine();
@ -3397,16 +3397,16 @@ module ts {
emitParameterPropertyAssignments(ctor);
}
else {
if (baseTypeNode) {
if (baseTypeElement) {
writeLine();
emitStart(baseTypeNode);
emitStart(baseTypeElement);
if (languageVersion < ScriptTarget.ES6) {
write("_super.apply(this, arguments);");
}
else {
write("super(...args);");
}
emitEnd(baseTypeNode);
emitEnd(baseTypeElement);
}
}
emitMemberAssignments(node, /*staticFlag*/0);
@ -3525,7 +3525,7 @@ module ts {
var baseTypeNode = getClassBaseTypeNode(node);
if (baseTypeNode) {
write(" extends ");
emit(baseTypeNode.typeName);
emit(baseTypeNode.expression);
}
write(" {");
@ -3639,7 +3639,7 @@ module ts {
emitStart(node);
write(")(");
if (baseTypeNode) {
emit(baseTypeNode.typeName);
emit(baseTypeNode.expression);
}
write(");");
emitEnd(node);

View File

@ -308,6 +308,9 @@ module ts {
return visitNode(cbNode, (<ComputedPropertyName>node).expression);
case SyntaxKind.HeritageClause:
return visitNodes(cbNodes, (<HeritageClause>node).types);
case SyntaxKind.HeritageClauseElement:
return visitNode(cbNode, (<HeritageClauseElement>node).expression) ||
visitNodes(cbNodes, (<HeritageClauseElement>node).typeArguments);
case SyntaxKind.ExternalModuleReference:
return visitNode(cbNode, (<ExternalModuleReference>node).expression);
case SyntaxKind.MissingDeclaration:
@ -324,7 +327,7 @@ module ts {
TypeMembers, // Members in interface or type literal
ClassMembers, // Members in class declaration
EnumMembers, // Members in enum declaration
TypeReferences, // Type references in extends or implements clause
HeritageClauseElement, // Elements in a heritage clause
VariableDeclarations, // Variable declarations in variable statement
ObjectBindingElements, // Binding elements in object binding list
ArrayBindingElements, // Binding elements in array binding list
@ -356,7 +359,7 @@ module ts {
case ParsingContext.TypeMembers: return Diagnostics.Property_or_signature_expected;
case ParsingContext.ClassMembers: return Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected;
case ParsingContext.EnumMembers: return Diagnostics.Enum_member_expected;
case ParsingContext.TypeReferences: return Diagnostics.Type_reference_expected;
case ParsingContext.HeritageClauseElement: return Diagnostics.Expression_expected;
case ParsingContext.VariableDeclarations: return Diagnostics.Variable_declaration_expected;
case ParsingContext.ObjectBindingElements: return Diagnostics.Property_destructuring_pattern_expected;
case ParsingContext.ArrayBindingElements: return Diagnostics.Array_element_destructuring_pattern_expected;
@ -1614,10 +1617,22 @@ module ts {
return token === SyntaxKind.OpenBracketToken || token === SyntaxKind.AsteriskToken || isLiteralPropertyName();
case ParsingContext.ObjectBindingElements:
return isLiteralPropertyName();
case ParsingContext.TypeReferences:
// We want to make sure that the "extends" in "extends foo" or the "implements" in
// "implements foo" is not considered a type name.
return isIdentifier() && !isNotHeritageClauseTypeName();
case ParsingContext.HeritageClauseElement:
// If we see { } then only consume it as an expression if it is followed by , or {
// That way we won't consume the body of a class in its heritage clause.
if (token === SyntaxKind.OpenBraceToken) {
return lookAhead(isValidHeritageClauseObjectLiteral);
}
if (!inErrorRecovery) {
return isStartOfLeftHandSideExpression() && !isHeritageClauseExtendsOrImplementsKeyword();
}
else {
// If we're in error recovery we tighten up what we're willing to match.
// That way we don't treat something like "this" as a valid heritage clause
// element during recovery.
return isIdentifier() && !isHeritageClauseExtendsOrImplementsKeyword();
}
case ParsingContext.VariableDeclarations:
return isIdentifierOrPattern();
case ParsingContext.ArrayBindingElements:
@ -1641,21 +1656,44 @@ module ts {
Debug.fail("Non-exhaustive case in 'isListElement'.");
}
function isValidHeritageClauseObjectLiteral() {
Debug.assert(token === SyntaxKind.OpenBraceToken);
if (nextToken() === SyntaxKind.CloseBraceToken) {
// if we see "extends {}" then only treat the {} as what we're extending (and not
// the class body) if we have:
//
// extends {} {
// extends {},
// extends {} extends
// extends {} implements
let next = nextToken();
return next === SyntaxKind.CommaToken || next === SyntaxKind.OpenBraceToken || next === SyntaxKind.ExtendsKeyword || next === SyntaxKind.ImplementsKeyword;
}
return true;
}
function nextTokenIsIdentifier() {
nextToken();
return isIdentifier();
}
function isNotHeritageClauseTypeName(): boolean {
function isHeritageClauseExtendsOrImplementsKeyword(): boolean {
if (token === SyntaxKind.ImplementsKeyword ||
token === SyntaxKind.ExtendsKeyword) {
return lookAhead(nextTokenIsIdentifier);
return lookAhead(nextTokenIsStartOfExpression);
}
return false;
}
function nextTokenIsStartOfExpression() {
nextToken();
return isStartOfExpression();
}
// True if positioned at a list terminator
function isListTerminator(kind: ParsingContext): boolean {
if (token === SyntaxKind.EndOfFileToken) {
@ -1676,7 +1714,7 @@ module ts {
return token === SyntaxKind.CloseBraceToken;
case ParsingContext.SwitchClauseStatements:
return token === SyntaxKind.CloseBraceToken || token === SyntaxKind.CaseKeyword || token === SyntaxKind.DefaultKeyword;
case ParsingContext.TypeReferences:
case ParsingContext.HeritageClauseElement:
return token === SyntaxKind.OpenBraceToken || token === SyntaxKind.ExtendsKeyword || token === SyntaxKind.ImplementsKeyword;
case ParsingContext.VariableDeclarations:
return isVariableDeclaratorListTerminator();
@ -1891,12 +1929,6 @@ module ts {
// This would probably be safe to reuse. There is no speculative parsing with
// heritage clauses.
case ParsingContext.TypeReferences:
// This would probably be safe to reuse. There is no speculative parsing with
// type names in a heritage clause. There can be generic names in the type
// name list. But because it is a type context, we never use speculative
// parsing on the type argument list.
case ParsingContext.TypeParameters:
// This would probably be safe to reuse. There is no speculative parsing with
// type parameters. Note that that's because type *parameters* only occur in
@ -1923,6 +1955,12 @@ module ts {
// cases. i.e. a property assignment may end with an expression, and thus might
// have lookahead far beyond it's old node.
case ParsingContext.ObjectLiteralMembers:
// This is probably not safe to reuse. There can be speculative parsing with
// type names in a heritage clause. There can be generic names in the type
// name list, and there can be left hand side expressions (which can have type
// arguments.)
case ParsingContext.HeritageClauseElement:
}
return false;
@ -2846,8 +2884,7 @@ module ts {
}
// EXPRESSIONS
function isStartOfExpression(): boolean {
function isStartOfLeftHandSideExpression(): boolean {
switch (token) {
case SyntaxKind.ThisKeyword:
case SyntaxKind.SuperKeyword:
@ -2865,6 +2902,19 @@ module ts {
case SyntaxKind.NewKeyword:
case SyntaxKind.SlashToken:
case SyntaxKind.SlashEqualsToken:
case SyntaxKind.Identifier:
return true;
default:
return isIdentifier();
}
}
function isStartOfExpression(): boolean {
if (isStartOfLeftHandSideExpression()) {
return true;
}
switch (token) {
case SyntaxKind.PlusToken:
case SyntaxKind.MinusToken:
case SyntaxKind.TildeToken:
@ -2875,7 +2925,6 @@ module ts {
case SyntaxKind.PlusPlusToken:
case SyntaxKind.MinusMinusToken:
case SyntaxKind.LessThanToken:
case SyntaxKind.Identifier:
case SyntaxKind.YieldKeyword:
// Yield always starts an expression. Either it is an identifier (in which case
// it is definitely an expression). Or it's a keyword (either because we're in
@ -3667,7 +3716,6 @@ module ts {
case SyntaxKind.CloseBracketToken: // foo<x>]
case SyntaxKind.ColonToken: // foo<x>:
case SyntaxKind.SemicolonToken: // foo<x>;
case SyntaxKind.CommaToken: // foo<x>,
case SyntaxKind.QuestionToken: // foo<x>?
case SyntaxKind.EqualsEqualsToken: // foo<x> ==
case SyntaxKind.EqualsEqualsEqualsToken: // foo<x> ===
@ -3685,6 +3733,12 @@ module ts {
// treat it as such.
return true;
case SyntaxKind.CommaToken: // foo<x>,
case SyntaxKind.OpenBraceToken: // foo<x> {
// We don't want to treat these as type arguments. Otherwise we'll parse this
// as an invocation expression. Instead, we want to parse out the expression
// in isolation from the type arguments.
default:
// Anything else treat as an expression.
return false;
@ -4714,13 +4768,23 @@ module ts {
let node = <HeritageClause>createNode(SyntaxKind.HeritageClause);
node.token = token;
nextToken();
node.types = parseDelimitedList(ParsingContext.TypeReferences, parseTypeReference);
node.types = parseDelimitedList(ParsingContext.HeritageClauseElement, parseHeritageClauseElement);
return finishNode(node);
}
return undefined;
}
function parseHeritageClauseElement(): HeritageClauseElement {
let node = <HeritageClauseElement>createNode(SyntaxKind.HeritageClauseElement);
node.expression = parseLeftHandSideExpressionOrHigher();
if (token === SyntaxKind.LessThanToken) {
node.typeArguments = parseBracketedList(ParsingContext.TypeArguments, parseType, SyntaxKind.LessThanToken, SyntaxKind.GreaterThanToken);
}
return finishNode(node);
}
function isHeritageClause(): boolean {
return token === SyntaxKind.ExtendsKeyword || token === SyntaxKind.ImplementsKeyword;
}

View File

@ -206,6 +206,7 @@ module ts {
OmittedExpression,
// Misc
TemplateSpan,
HeritageClauseElement,
// Element
Block,
VariableStatement,
@ -728,6 +729,11 @@ module ts {
arguments: NodeArray<Expression>;
}
export interface HeritageClauseElement extends Node {
expression: LeftHandSideExpression;
typeArguments?: NodeArray<TypeNode>;
}
export interface NewExpression extends CallExpression, PrimaryExpression { }
export interface TaggedTemplateExpression extends MemberExpression {
@ -869,7 +875,7 @@ module ts {
export interface HeritageClause extends Node {
token: SyntaxKind;
types?: NodeArray<TypeReferenceNode>;
types?: NodeArray<HeritageClauseElement>;
}
export interface TypeAliasDeclaration extends Declaration, ModuleElement {
@ -1231,7 +1237,7 @@ module ts {
writeReturnTypeOfSignatureDeclaration(signatureDeclaration: SignatureDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void;
writeTypeOfExpression(expr: Expression, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void;
isSymbolAccessible(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags): SymbolAccessiblityResult;
isEntityNameVisible(entityName: EntityName, enclosingDeclaration: Node): SymbolVisibilityResult;
isEntityNameVisible(entityName: EntityName | Expression, enclosingDeclaration: Node): SymbolVisibilityResult;
// Returns the constant value this property access resolves to, or 'undefined' for a non-constant
getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number;
resolvesToSomeValue(location: Node, name: string): boolean;

View File

@ -1768,4 +1768,26 @@ module ts {
}
}
// Returns true if this heritage clause element's expression contains something unsupported
// (i.e. not a name or dotted name).
export function isSupportedHeritageClauseElement(node: HeritageClauseElement): boolean {
return isSupportedHeritageClauseElementExpression(node.expression);
}
function isSupportedHeritageClauseElementExpression(node: Expression): boolean {
if (node.kind === SyntaxKind.Identifier) {
return true;
}
else if (node.kind === SyntaxKind.PropertyAccessExpression) {
return isSupportedHeritageClauseElementExpression((<PropertyAccessExpression>node).expression);
}
else {
return false;
}
}
export function isRightSideOfQualifiedNameOrPropertyAccess(node: Node) {
return (node.parent.kind === SyntaxKind.QualifiedName && (<QualifiedName>node.parent).right === node) ||
(node.parent.kind === SyntaxKind.PropertyAccessExpression && (<PropertyAccessExpression>node.parent).name === node);
}
}

View File

@ -38,7 +38,6 @@ class TypeWriterWalker {
case ts.SyntaxKind.SuperKeyword:
case ts.SyntaxKind.ArrayLiteralExpression:
case ts.SyntaxKind.ObjectLiteralExpression:
case ts.SyntaxKind.PropertyAccessExpression:
case ts.SyntaxKind.ElementAccessExpression:
case ts.SyntaxKind.CallExpression:
case ts.SyntaxKind.NewExpression:
@ -56,6 +55,14 @@ class TypeWriterWalker {
this.log(node, this.getTypeOfNode(node));
break;
case ts.SyntaxKind.PropertyAccessExpression:
for (var current = node; current.kind === ts.SyntaxKind.PropertyAccessExpression; current = current.parent) {
}
if (current.kind !== ts.SyntaxKind.HeritageClauseElement) {
this.log(node, this.getTypeOfNode(node));
}
break;
// Should not change expression status (maybe expressions)
// TODO: Again, ideally should log number and string literals too,
// but to be consistent with the old typeWriter, just log identifiers

View File

@ -2932,7 +2932,7 @@ module ts {
function getCompletionsAtPosition(fileName: string, position: number): CompletionInfo {
synchronizeHostData();
let completionData = getCompletionData(fileName, position);
if (!completionData) {
return undefined;
@ -4887,7 +4887,7 @@ module ts {
}
return;
function getPropertySymbolFromTypeReference(typeReference: TypeReferenceNode) {
function getPropertySymbolFromTypeReference(typeReference: HeritageClauseElement) {
if (typeReference) {
let type = typeInfoResolver.getTypeAtLocation(typeReference);
if (type) {
@ -5144,19 +5144,44 @@ module ts {
}
function isTypeReference(node: Node): boolean {
if (isRightSideOfQualifiedName(node)) {
if (isRightSideOfQualifiedNameOrPropertyAccess(node) ) {
node = node.parent;
}
return node.parent.kind === SyntaxKind.TypeReference;
return node.parent.kind === SyntaxKind.TypeReference || node.parent.kind === SyntaxKind.HeritageClauseElement;
}
function isNamespaceReference(node: Node): boolean {
return isQualifiedNameNamespaceReference(node) || isPropertyAccessNamespaceReference(node);
}
function isPropertyAccessNamespaceReference(node: Node): boolean {
let root = node;
let isLastClause = true;
if (root.parent.kind === SyntaxKind.PropertyAccessExpression) {
while (root.parent && root.parent.kind === SyntaxKind.PropertyAccessExpression) {
root = root.parent;
}
isLastClause = (<PropertyAccessExpression>root).name === node;
}
if (!isLastClause && root.parent.kind === SyntaxKind.HeritageClauseElement && root.parent.parent.kind === SyntaxKind.HeritageClause) {
let decl = root.parent.parent.parent;
return (decl.kind === SyntaxKind.ClassDeclaration && (<HeritageClause>root.parent.parent).token === SyntaxKind.ImplementsKeyword) ||
(decl.kind === SyntaxKind.InterfaceDeclaration && (<HeritageClause>root.parent.parent).token === SyntaxKind.ExtendsKeyword);
}
return false;
}
function isQualifiedNameNamespaceReference(node: Node): boolean {
let root = node;
let isLastClause = true;
if (root.parent.kind === SyntaxKind.QualifiedName) {
while (root.parent && root.parent.kind === SyntaxKind.QualifiedName)
while (root.parent && root.parent.kind === SyntaxKind.QualifiedName) {
root = root.parent;
}
isLastClause = (<QualifiedName>root).right === node;
}

View File

@ -235,57 +235,58 @@ declare module "typescript" {
SpreadElementExpression = 173,
OmittedExpression = 174,
TemplateSpan = 175,
Block = 176,
VariableStatement = 177,
EmptyStatement = 178,
ExpressionStatement = 179,
IfStatement = 180,
DoStatement = 181,
WhileStatement = 182,
ForStatement = 183,
ForInStatement = 184,
ForOfStatement = 185,
ContinueStatement = 186,
BreakStatement = 187,
ReturnStatement = 188,
WithStatement = 189,
SwitchStatement = 190,
LabeledStatement = 191,
ThrowStatement = 192,
TryStatement = 193,
DebuggerStatement = 194,
VariableDeclaration = 195,
VariableDeclarationList = 196,
FunctionDeclaration = 197,
ClassDeclaration = 198,
InterfaceDeclaration = 199,
TypeAliasDeclaration = 200,
EnumDeclaration = 201,
ModuleDeclaration = 202,
ModuleBlock = 203,
CaseBlock = 204,
ImportEqualsDeclaration = 205,
ImportDeclaration = 206,
ImportClause = 207,
NamespaceImport = 208,
NamedImports = 209,
ImportSpecifier = 210,
ExportAssignment = 211,
ExportDeclaration = 212,
NamedExports = 213,
ExportSpecifier = 214,
MissingDeclaration = 215,
ExternalModuleReference = 216,
CaseClause = 217,
DefaultClause = 218,
HeritageClause = 219,
CatchClause = 220,
PropertyAssignment = 221,
ShorthandPropertyAssignment = 222,
EnumMember = 223,
SourceFile = 224,
SyntaxList = 225,
Count = 226,
HeritageClauseElement = 176,
Block = 177,
VariableStatement = 178,
EmptyStatement = 179,
ExpressionStatement = 180,
IfStatement = 181,
DoStatement = 182,
WhileStatement = 183,
ForStatement = 184,
ForInStatement = 185,
ForOfStatement = 186,
ContinueStatement = 187,
BreakStatement = 188,
ReturnStatement = 189,
WithStatement = 190,
SwitchStatement = 191,
LabeledStatement = 192,
ThrowStatement = 193,
TryStatement = 194,
DebuggerStatement = 195,
VariableDeclaration = 196,
VariableDeclarationList = 197,
FunctionDeclaration = 198,
ClassDeclaration = 199,
InterfaceDeclaration = 200,
TypeAliasDeclaration = 201,
EnumDeclaration = 202,
ModuleDeclaration = 203,
ModuleBlock = 204,
CaseBlock = 205,
ImportEqualsDeclaration = 206,
ImportDeclaration = 207,
ImportClause = 208,
NamespaceImport = 209,
NamedImports = 210,
ImportSpecifier = 211,
ExportAssignment = 212,
ExportDeclaration = 213,
NamedExports = 214,
ExportSpecifier = 215,
MissingDeclaration = 216,
ExternalModuleReference = 217,
CaseClause = 218,
DefaultClause = 219,
HeritageClause = 220,
CatchClause = 221,
PropertyAssignment = 222,
ShorthandPropertyAssignment = 223,
EnumMember = 224,
SourceFile = 225,
SyntaxList = 226,
Count = 227,
FirstAssignment = 53,
LastAssignment = 64,
FirstReservedWord = 66,
@ -607,6 +608,10 @@ declare module "typescript" {
typeArguments?: NodeArray<TypeNode>;
arguments: NodeArray<Expression>;
}
interface HeritageClauseElement extends Node {
expression: LeftHandSideExpression;
typeArguments?: NodeArray<TypeNode>;
}
interface NewExpression extends CallExpression, PrimaryExpression {
}
interface TaggedTemplateExpression extends MemberExpression {
@ -718,7 +723,7 @@ declare module "typescript" {
}
interface HeritageClause extends Node {
token: SyntaxKind;
types?: NodeArray<TypeReferenceNode>;
types?: NodeArray<HeritageClauseElement>;
}
interface TypeAliasDeclaration extends Declaration, ModuleElement {
name: Identifier;
@ -960,7 +965,7 @@ declare module "typescript" {
writeReturnTypeOfSignatureDeclaration(signatureDeclaration: SignatureDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void;
writeTypeOfExpression(expr: Expression, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void;
isSymbolAccessible(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags): SymbolAccessiblityResult;
isEntityNameVisible(entityName: EntityName, enclosingDeclaration: Node): SymbolVisibilityResult;
isEntityNameVisible(entityName: EntityName | Expression, enclosingDeclaration: Node): SymbolVisibilityResult;
getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number;
resolvesToSomeValue(location: Node, name: string): boolean;
getBlockScopedVariableId(node: Identifier): number;

View File

@ -723,157 +723,160 @@ declare module "typescript" {
TemplateSpan = 175,
>TemplateSpan : SyntaxKind
Block = 176,
HeritageClauseElement = 176,
>HeritageClauseElement : SyntaxKind
Block = 177,
>Block : SyntaxKind
VariableStatement = 177,
VariableStatement = 178,
>VariableStatement : SyntaxKind
EmptyStatement = 178,
EmptyStatement = 179,
>EmptyStatement : SyntaxKind
ExpressionStatement = 179,
ExpressionStatement = 180,
>ExpressionStatement : SyntaxKind
IfStatement = 180,
IfStatement = 181,
>IfStatement : SyntaxKind
DoStatement = 181,
DoStatement = 182,
>DoStatement : SyntaxKind
WhileStatement = 182,
WhileStatement = 183,
>WhileStatement : SyntaxKind
ForStatement = 183,
ForStatement = 184,
>ForStatement : SyntaxKind
ForInStatement = 184,
ForInStatement = 185,
>ForInStatement : SyntaxKind
ForOfStatement = 185,
ForOfStatement = 186,
>ForOfStatement : SyntaxKind
ContinueStatement = 186,
ContinueStatement = 187,
>ContinueStatement : SyntaxKind
BreakStatement = 187,
BreakStatement = 188,
>BreakStatement : SyntaxKind
ReturnStatement = 188,
ReturnStatement = 189,
>ReturnStatement : SyntaxKind
WithStatement = 189,
WithStatement = 190,
>WithStatement : SyntaxKind
SwitchStatement = 190,
SwitchStatement = 191,
>SwitchStatement : SyntaxKind
LabeledStatement = 191,
LabeledStatement = 192,
>LabeledStatement : SyntaxKind
ThrowStatement = 192,
ThrowStatement = 193,
>ThrowStatement : SyntaxKind
TryStatement = 193,
TryStatement = 194,
>TryStatement : SyntaxKind
DebuggerStatement = 194,
DebuggerStatement = 195,
>DebuggerStatement : SyntaxKind
VariableDeclaration = 195,
VariableDeclaration = 196,
>VariableDeclaration : SyntaxKind
VariableDeclarationList = 196,
VariableDeclarationList = 197,
>VariableDeclarationList : SyntaxKind
FunctionDeclaration = 197,
FunctionDeclaration = 198,
>FunctionDeclaration : SyntaxKind
ClassDeclaration = 198,
ClassDeclaration = 199,
>ClassDeclaration : SyntaxKind
InterfaceDeclaration = 199,
InterfaceDeclaration = 200,
>InterfaceDeclaration : SyntaxKind
TypeAliasDeclaration = 200,
TypeAliasDeclaration = 201,
>TypeAliasDeclaration : SyntaxKind
EnumDeclaration = 201,
EnumDeclaration = 202,
>EnumDeclaration : SyntaxKind
ModuleDeclaration = 202,
ModuleDeclaration = 203,
>ModuleDeclaration : SyntaxKind
ModuleBlock = 203,
ModuleBlock = 204,
>ModuleBlock : SyntaxKind
CaseBlock = 204,
CaseBlock = 205,
>CaseBlock : SyntaxKind
ImportEqualsDeclaration = 205,
ImportEqualsDeclaration = 206,
>ImportEqualsDeclaration : SyntaxKind
ImportDeclaration = 206,
ImportDeclaration = 207,
>ImportDeclaration : SyntaxKind
ImportClause = 207,
ImportClause = 208,
>ImportClause : SyntaxKind
NamespaceImport = 208,
NamespaceImport = 209,
>NamespaceImport : SyntaxKind
NamedImports = 209,
NamedImports = 210,
>NamedImports : SyntaxKind
ImportSpecifier = 210,
ImportSpecifier = 211,
>ImportSpecifier : SyntaxKind
ExportAssignment = 211,
ExportAssignment = 212,
>ExportAssignment : SyntaxKind
ExportDeclaration = 212,
ExportDeclaration = 213,
>ExportDeclaration : SyntaxKind
NamedExports = 213,
NamedExports = 214,
>NamedExports : SyntaxKind
ExportSpecifier = 214,
ExportSpecifier = 215,
>ExportSpecifier : SyntaxKind
MissingDeclaration = 215,
MissingDeclaration = 216,
>MissingDeclaration : SyntaxKind
ExternalModuleReference = 216,
ExternalModuleReference = 217,
>ExternalModuleReference : SyntaxKind
CaseClause = 217,
CaseClause = 218,
>CaseClause : SyntaxKind
DefaultClause = 218,
DefaultClause = 219,
>DefaultClause : SyntaxKind
HeritageClause = 219,
HeritageClause = 220,
>HeritageClause : SyntaxKind
CatchClause = 220,
CatchClause = 221,
>CatchClause : SyntaxKind
PropertyAssignment = 221,
PropertyAssignment = 222,
>PropertyAssignment : SyntaxKind
ShorthandPropertyAssignment = 222,
ShorthandPropertyAssignment = 223,
>ShorthandPropertyAssignment : SyntaxKind
EnumMember = 223,
EnumMember = 224,
>EnumMember : SyntaxKind
SourceFile = 224,
SourceFile = 225,
>SourceFile : SyntaxKind
SyntaxList = 225,
SyntaxList = 226,
>SyntaxList : SyntaxKind
Count = 226,
Count = 227,
>Count : SyntaxKind
FirstAssignment = 53,
@ -1831,6 +1834,19 @@ declare module "typescript" {
>arguments : NodeArray<Expression>
>NodeArray : NodeArray<T>
>Expression : Expression
}
interface HeritageClauseElement extends Node {
>HeritageClauseElement : HeritageClauseElement
>Node : Node
expression: LeftHandSideExpression;
>expression : LeftHandSideExpression
>LeftHandSideExpression : LeftHandSideExpression
typeArguments?: NodeArray<TypeNode>;
>typeArguments : NodeArray<TypeNode>
>NodeArray : NodeArray<T>
>TypeNode : TypeNode
}
interface NewExpression extends CallExpression, PrimaryExpression {
>NewExpression : NewExpression
@ -2178,10 +2194,10 @@ declare module "typescript" {
>token : SyntaxKind
>SyntaxKind : SyntaxKind
types?: NodeArray<TypeReferenceNode>;
>types : NodeArray<TypeReferenceNode>
types?: NodeArray<HeritageClauseElement>;
>types : NodeArray<HeritageClauseElement>
>NodeArray : NodeArray<T>
>TypeReferenceNode : TypeReferenceNode
>HeritageClauseElement : HeritageClauseElement
}
interface TypeAliasDeclaration extends Declaration, ModuleElement {
>TypeAliasDeclaration : TypeAliasDeclaration
@ -3125,10 +3141,11 @@ declare module "typescript" {
>SymbolFlags : SymbolFlags
>SymbolAccessiblityResult : SymbolAccessiblityResult
isEntityNameVisible(entityName: EntityName, enclosingDeclaration: Node): SymbolVisibilityResult;
>isEntityNameVisible : (entityName: Identifier | QualifiedName, enclosingDeclaration: Node) => SymbolVisibilityResult
>entityName : Identifier | QualifiedName
isEntityNameVisible(entityName: EntityName | Expression, enclosingDeclaration: Node): SymbolVisibilityResult;
>isEntityNameVisible : (entityName: Identifier | Expression | QualifiedName, enclosingDeclaration: Node) => SymbolVisibilityResult
>entityName : Identifier | Expression | QualifiedName
>EntityName : Identifier | QualifiedName
>Expression : Expression
>enclosingDeclaration : Node
>Node : Node
>SymbolVisibilityResult : SymbolVisibilityResult

View File

@ -266,57 +266,58 @@ declare module "typescript" {
SpreadElementExpression = 173,
OmittedExpression = 174,
TemplateSpan = 175,
Block = 176,
VariableStatement = 177,
EmptyStatement = 178,
ExpressionStatement = 179,
IfStatement = 180,
DoStatement = 181,
WhileStatement = 182,
ForStatement = 183,
ForInStatement = 184,
ForOfStatement = 185,
ContinueStatement = 186,
BreakStatement = 187,
ReturnStatement = 188,
WithStatement = 189,
SwitchStatement = 190,
LabeledStatement = 191,
ThrowStatement = 192,
TryStatement = 193,
DebuggerStatement = 194,
VariableDeclaration = 195,
VariableDeclarationList = 196,
FunctionDeclaration = 197,
ClassDeclaration = 198,
InterfaceDeclaration = 199,
TypeAliasDeclaration = 200,
EnumDeclaration = 201,
ModuleDeclaration = 202,
ModuleBlock = 203,
CaseBlock = 204,
ImportEqualsDeclaration = 205,
ImportDeclaration = 206,
ImportClause = 207,
NamespaceImport = 208,
NamedImports = 209,
ImportSpecifier = 210,
ExportAssignment = 211,
ExportDeclaration = 212,
NamedExports = 213,
ExportSpecifier = 214,
MissingDeclaration = 215,
ExternalModuleReference = 216,
CaseClause = 217,
DefaultClause = 218,
HeritageClause = 219,
CatchClause = 220,
PropertyAssignment = 221,
ShorthandPropertyAssignment = 222,
EnumMember = 223,
SourceFile = 224,
SyntaxList = 225,
Count = 226,
HeritageClauseElement = 176,
Block = 177,
VariableStatement = 178,
EmptyStatement = 179,
ExpressionStatement = 180,
IfStatement = 181,
DoStatement = 182,
WhileStatement = 183,
ForStatement = 184,
ForInStatement = 185,
ForOfStatement = 186,
ContinueStatement = 187,
BreakStatement = 188,
ReturnStatement = 189,
WithStatement = 190,
SwitchStatement = 191,
LabeledStatement = 192,
ThrowStatement = 193,
TryStatement = 194,
DebuggerStatement = 195,
VariableDeclaration = 196,
VariableDeclarationList = 197,
FunctionDeclaration = 198,
ClassDeclaration = 199,
InterfaceDeclaration = 200,
TypeAliasDeclaration = 201,
EnumDeclaration = 202,
ModuleDeclaration = 203,
ModuleBlock = 204,
CaseBlock = 205,
ImportEqualsDeclaration = 206,
ImportDeclaration = 207,
ImportClause = 208,
NamespaceImport = 209,
NamedImports = 210,
ImportSpecifier = 211,
ExportAssignment = 212,
ExportDeclaration = 213,
NamedExports = 214,
ExportSpecifier = 215,
MissingDeclaration = 216,
ExternalModuleReference = 217,
CaseClause = 218,
DefaultClause = 219,
HeritageClause = 220,
CatchClause = 221,
PropertyAssignment = 222,
ShorthandPropertyAssignment = 223,
EnumMember = 224,
SourceFile = 225,
SyntaxList = 226,
Count = 227,
FirstAssignment = 53,
LastAssignment = 64,
FirstReservedWord = 66,
@ -638,6 +639,10 @@ declare module "typescript" {
typeArguments?: NodeArray<TypeNode>;
arguments: NodeArray<Expression>;
}
interface HeritageClauseElement extends Node {
expression: LeftHandSideExpression;
typeArguments?: NodeArray<TypeNode>;
}
interface NewExpression extends CallExpression, PrimaryExpression {
}
interface TaggedTemplateExpression extends MemberExpression {
@ -749,7 +754,7 @@ declare module "typescript" {
}
interface HeritageClause extends Node {
token: SyntaxKind;
types?: NodeArray<TypeReferenceNode>;
types?: NodeArray<HeritageClauseElement>;
}
interface TypeAliasDeclaration extends Declaration, ModuleElement {
name: Identifier;
@ -991,7 +996,7 @@ declare module "typescript" {
writeReturnTypeOfSignatureDeclaration(signatureDeclaration: SignatureDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void;
writeTypeOfExpression(expr: Expression, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void;
isSymbolAccessible(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags): SymbolAccessiblityResult;
isEntityNameVisible(entityName: EntityName, enclosingDeclaration: Node): SymbolVisibilityResult;
isEntityNameVisible(entityName: EntityName | Expression, enclosingDeclaration: Node): SymbolVisibilityResult;
getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number;
resolvesToSomeValue(location: Node, name: string): boolean;
getBlockScopedVariableId(node: Identifier): number;
@ -2042,21 +2047,21 @@ function delint(sourceFile) {
delintNode(sourceFile);
function delintNode(node) {
switch (node.kind) {
case 183 /* ForStatement */:
case 184 /* ForInStatement */:
case 182 /* WhileStatement */:
case 181 /* DoStatement */:
if (node.statement.kind !== 176 /* Block */) {
case 184 /* ForStatement */:
case 185 /* ForInStatement */:
case 183 /* WhileStatement */:
case 182 /* DoStatement */:
if (node.statement.kind !== 177 /* Block */) {
report(node, "A looping statement's contents should be wrapped in a block body.");
}
break;
case 180 /* IfStatement */:
case 181 /* IfStatement */:
var ifStatement = node;
if (ifStatement.thenStatement.kind !== 176 /* Block */) {
if (ifStatement.thenStatement.kind !== 177 /* Block */) {
report(ifStatement.thenStatement, "An if statement's contents should be wrapped in a block body.");
}
if (ifStatement.elseStatement &&
ifStatement.elseStatement.kind !== 176 /* Block */ && ifStatement.elseStatement.kind !== 180 /* IfStatement */) {
ifStatement.elseStatement.kind !== 177 /* Block */ && ifStatement.elseStatement.kind !== 181 /* IfStatement */) {
report(ifStatement.elseStatement, "An else statement's contents should be wrapped in a block body.");
}
break;

View File

@ -869,157 +869,160 @@ declare module "typescript" {
TemplateSpan = 175,
>TemplateSpan : SyntaxKind
Block = 176,
HeritageClauseElement = 176,
>HeritageClauseElement : SyntaxKind
Block = 177,
>Block : SyntaxKind
VariableStatement = 177,
VariableStatement = 178,
>VariableStatement : SyntaxKind
EmptyStatement = 178,
EmptyStatement = 179,
>EmptyStatement : SyntaxKind
ExpressionStatement = 179,
ExpressionStatement = 180,
>ExpressionStatement : SyntaxKind
IfStatement = 180,
IfStatement = 181,
>IfStatement : SyntaxKind
DoStatement = 181,
DoStatement = 182,
>DoStatement : SyntaxKind
WhileStatement = 182,
WhileStatement = 183,
>WhileStatement : SyntaxKind
ForStatement = 183,
ForStatement = 184,
>ForStatement : SyntaxKind
ForInStatement = 184,
ForInStatement = 185,
>ForInStatement : SyntaxKind
ForOfStatement = 185,
ForOfStatement = 186,
>ForOfStatement : SyntaxKind
ContinueStatement = 186,
ContinueStatement = 187,
>ContinueStatement : SyntaxKind
BreakStatement = 187,
BreakStatement = 188,
>BreakStatement : SyntaxKind
ReturnStatement = 188,
ReturnStatement = 189,
>ReturnStatement : SyntaxKind
WithStatement = 189,
WithStatement = 190,
>WithStatement : SyntaxKind
SwitchStatement = 190,
SwitchStatement = 191,
>SwitchStatement : SyntaxKind
LabeledStatement = 191,
LabeledStatement = 192,
>LabeledStatement : SyntaxKind
ThrowStatement = 192,
ThrowStatement = 193,
>ThrowStatement : SyntaxKind
TryStatement = 193,
TryStatement = 194,
>TryStatement : SyntaxKind
DebuggerStatement = 194,
DebuggerStatement = 195,
>DebuggerStatement : SyntaxKind
VariableDeclaration = 195,
VariableDeclaration = 196,
>VariableDeclaration : SyntaxKind
VariableDeclarationList = 196,
VariableDeclarationList = 197,
>VariableDeclarationList : SyntaxKind
FunctionDeclaration = 197,
FunctionDeclaration = 198,
>FunctionDeclaration : SyntaxKind
ClassDeclaration = 198,
ClassDeclaration = 199,
>ClassDeclaration : SyntaxKind
InterfaceDeclaration = 199,
InterfaceDeclaration = 200,
>InterfaceDeclaration : SyntaxKind
TypeAliasDeclaration = 200,
TypeAliasDeclaration = 201,
>TypeAliasDeclaration : SyntaxKind
EnumDeclaration = 201,
EnumDeclaration = 202,
>EnumDeclaration : SyntaxKind
ModuleDeclaration = 202,
ModuleDeclaration = 203,
>ModuleDeclaration : SyntaxKind
ModuleBlock = 203,
ModuleBlock = 204,
>ModuleBlock : SyntaxKind
CaseBlock = 204,
CaseBlock = 205,
>CaseBlock : SyntaxKind
ImportEqualsDeclaration = 205,
ImportEqualsDeclaration = 206,
>ImportEqualsDeclaration : SyntaxKind
ImportDeclaration = 206,
ImportDeclaration = 207,
>ImportDeclaration : SyntaxKind
ImportClause = 207,
ImportClause = 208,
>ImportClause : SyntaxKind
NamespaceImport = 208,
NamespaceImport = 209,
>NamespaceImport : SyntaxKind
NamedImports = 209,
NamedImports = 210,
>NamedImports : SyntaxKind
ImportSpecifier = 210,
ImportSpecifier = 211,
>ImportSpecifier : SyntaxKind
ExportAssignment = 211,
ExportAssignment = 212,
>ExportAssignment : SyntaxKind
ExportDeclaration = 212,
ExportDeclaration = 213,
>ExportDeclaration : SyntaxKind
NamedExports = 213,
NamedExports = 214,
>NamedExports : SyntaxKind
ExportSpecifier = 214,
ExportSpecifier = 215,
>ExportSpecifier : SyntaxKind
MissingDeclaration = 215,
MissingDeclaration = 216,
>MissingDeclaration : SyntaxKind
ExternalModuleReference = 216,
ExternalModuleReference = 217,
>ExternalModuleReference : SyntaxKind
CaseClause = 217,
CaseClause = 218,
>CaseClause : SyntaxKind
DefaultClause = 218,
DefaultClause = 219,
>DefaultClause : SyntaxKind
HeritageClause = 219,
HeritageClause = 220,
>HeritageClause : SyntaxKind
CatchClause = 220,
CatchClause = 221,
>CatchClause : SyntaxKind
PropertyAssignment = 221,
PropertyAssignment = 222,
>PropertyAssignment : SyntaxKind
ShorthandPropertyAssignment = 222,
ShorthandPropertyAssignment = 223,
>ShorthandPropertyAssignment : SyntaxKind
EnumMember = 223,
EnumMember = 224,
>EnumMember : SyntaxKind
SourceFile = 224,
SourceFile = 225,
>SourceFile : SyntaxKind
SyntaxList = 225,
SyntaxList = 226,
>SyntaxList : SyntaxKind
Count = 226,
Count = 227,
>Count : SyntaxKind
FirstAssignment = 53,
@ -1977,6 +1980,19 @@ declare module "typescript" {
>arguments : NodeArray<Expression>
>NodeArray : NodeArray<T>
>Expression : Expression
}
interface HeritageClauseElement extends Node {
>HeritageClauseElement : HeritageClauseElement
>Node : Node
expression: LeftHandSideExpression;
>expression : LeftHandSideExpression
>LeftHandSideExpression : LeftHandSideExpression
typeArguments?: NodeArray<TypeNode>;
>typeArguments : NodeArray<TypeNode>
>NodeArray : NodeArray<T>
>TypeNode : TypeNode
}
interface NewExpression extends CallExpression, PrimaryExpression {
>NewExpression : NewExpression
@ -2324,10 +2340,10 @@ declare module "typescript" {
>token : SyntaxKind
>SyntaxKind : SyntaxKind
types?: NodeArray<TypeReferenceNode>;
>types : NodeArray<TypeReferenceNode>
types?: NodeArray<HeritageClauseElement>;
>types : NodeArray<HeritageClauseElement>
>NodeArray : NodeArray<T>
>TypeReferenceNode : TypeReferenceNode
>HeritageClauseElement : HeritageClauseElement
}
interface TypeAliasDeclaration extends Declaration, ModuleElement {
>TypeAliasDeclaration : TypeAliasDeclaration
@ -3271,10 +3287,11 @@ declare module "typescript" {
>SymbolFlags : SymbolFlags
>SymbolAccessiblityResult : SymbolAccessiblityResult
isEntityNameVisible(entityName: EntityName, enclosingDeclaration: Node): SymbolVisibilityResult;
>isEntityNameVisible : (entityName: Identifier | QualifiedName, enclosingDeclaration: Node) => SymbolVisibilityResult
>entityName : Identifier | QualifiedName
isEntityNameVisible(entityName: EntityName | Expression, enclosingDeclaration: Node): SymbolVisibilityResult;
>isEntityNameVisible : (entityName: Identifier | Expression | QualifiedName, enclosingDeclaration: Node) => SymbolVisibilityResult
>entityName : Identifier | Expression | QualifiedName
>EntityName : Identifier | QualifiedName
>Expression : Expression
>enclosingDeclaration : Node
>Node : Node
>SymbolVisibilityResult : SymbolVisibilityResult

File diff suppressed because it is too large Load Diff

View File

@ -267,57 +267,58 @@ declare module "typescript" {
SpreadElementExpression = 173,
OmittedExpression = 174,
TemplateSpan = 175,
Block = 176,
VariableStatement = 177,
EmptyStatement = 178,
ExpressionStatement = 179,
IfStatement = 180,
DoStatement = 181,
WhileStatement = 182,
ForStatement = 183,
ForInStatement = 184,
ForOfStatement = 185,
ContinueStatement = 186,
BreakStatement = 187,
ReturnStatement = 188,
WithStatement = 189,
SwitchStatement = 190,
LabeledStatement = 191,
ThrowStatement = 192,
TryStatement = 193,
DebuggerStatement = 194,
VariableDeclaration = 195,
VariableDeclarationList = 196,
FunctionDeclaration = 197,
ClassDeclaration = 198,
InterfaceDeclaration = 199,
TypeAliasDeclaration = 200,
EnumDeclaration = 201,
ModuleDeclaration = 202,
ModuleBlock = 203,
CaseBlock = 204,
ImportEqualsDeclaration = 205,
ImportDeclaration = 206,
ImportClause = 207,
NamespaceImport = 208,
NamedImports = 209,
ImportSpecifier = 210,
ExportAssignment = 211,
ExportDeclaration = 212,
NamedExports = 213,
ExportSpecifier = 214,
MissingDeclaration = 215,
ExternalModuleReference = 216,
CaseClause = 217,
DefaultClause = 218,
HeritageClause = 219,
CatchClause = 220,
PropertyAssignment = 221,
ShorthandPropertyAssignment = 222,
EnumMember = 223,
SourceFile = 224,
SyntaxList = 225,
Count = 226,
HeritageClauseElement = 176,
Block = 177,
VariableStatement = 178,
EmptyStatement = 179,
ExpressionStatement = 180,
IfStatement = 181,
DoStatement = 182,
WhileStatement = 183,
ForStatement = 184,
ForInStatement = 185,
ForOfStatement = 186,
ContinueStatement = 187,
BreakStatement = 188,
ReturnStatement = 189,
WithStatement = 190,
SwitchStatement = 191,
LabeledStatement = 192,
ThrowStatement = 193,
TryStatement = 194,
DebuggerStatement = 195,
VariableDeclaration = 196,
VariableDeclarationList = 197,
FunctionDeclaration = 198,
ClassDeclaration = 199,
InterfaceDeclaration = 200,
TypeAliasDeclaration = 201,
EnumDeclaration = 202,
ModuleDeclaration = 203,
ModuleBlock = 204,
CaseBlock = 205,
ImportEqualsDeclaration = 206,
ImportDeclaration = 207,
ImportClause = 208,
NamespaceImport = 209,
NamedImports = 210,
ImportSpecifier = 211,
ExportAssignment = 212,
ExportDeclaration = 213,
NamedExports = 214,
ExportSpecifier = 215,
MissingDeclaration = 216,
ExternalModuleReference = 217,
CaseClause = 218,
DefaultClause = 219,
HeritageClause = 220,
CatchClause = 221,
PropertyAssignment = 222,
ShorthandPropertyAssignment = 223,
EnumMember = 224,
SourceFile = 225,
SyntaxList = 226,
Count = 227,
FirstAssignment = 53,
LastAssignment = 64,
FirstReservedWord = 66,
@ -639,6 +640,10 @@ declare module "typescript" {
typeArguments?: NodeArray<TypeNode>;
arguments: NodeArray<Expression>;
}
interface HeritageClauseElement extends Node {
expression: LeftHandSideExpression;
typeArguments?: NodeArray<TypeNode>;
}
interface NewExpression extends CallExpression, PrimaryExpression {
}
interface TaggedTemplateExpression extends MemberExpression {
@ -750,7 +755,7 @@ declare module "typescript" {
}
interface HeritageClause extends Node {
token: SyntaxKind;
types?: NodeArray<TypeReferenceNode>;
types?: NodeArray<HeritageClauseElement>;
}
interface TypeAliasDeclaration extends Declaration, ModuleElement {
name: Identifier;
@ -992,7 +997,7 @@ declare module "typescript" {
writeReturnTypeOfSignatureDeclaration(signatureDeclaration: SignatureDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void;
writeTypeOfExpression(expr: Expression, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void;
isSymbolAccessible(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags): SymbolAccessiblityResult;
isEntityNameVisible(entityName: EntityName, enclosingDeclaration: Node): SymbolVisibilityResult;
isEntityNameVisible(entityName: EntityName | Expression, enclosingDeclaration: Node): SymbolVisibilityResult;
getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number;
resolvesToSomeValue(location: Node, name: string): boolean;
getBlockScopedVariableId(node: Identifier): number;

View File

@ -819,157 +819,160 @@ declare module "typescript" {
TemplateSpan = 175,
>TemplateSpan : SyntaxKind
Block = 176,
HeritageClauseElement = 176,
>HeritageClauseElement : SyntaxKind
Block = 177,
>Block : SyntaxKind
VariableStatement = 177,
VariableStatement = 178,
>VariableStatement : SyntaxKind
EmptyStatement = 178,
EmptyStatement = 179,
>EmptyStatement : SyntaxKind
ExpressionStatement = 179,
ExpressionStatement = 180,
>ExpressionStatement : SyntaxKind
IfStatement = 180,
IfStatement = 181,
>IfStatement : SyntaxKind
DoStatement = 181,
DoStatement = 182,
>DoStatement : SyntaxKind
WhileStatement = 182,
WhileStatement = 183,
>WhileStatement : SyntaxKind
ForStatement = 183,
ForStatement = 184,
>ForStatement : SyntaxKind
ForInStatement = 184,
ForInStatement = 185,
>ForInStatement : SyntaxKind
ForOfStatement = 185,
ForOfStatement = 186,
>ForOfStatement : SyntaxKind
ContinueStatement = 186,
ContinueStatement = 187,
>ContinueStatement : SyntaxKind
BreakStatement = 187,
BreakStatement = 188,
>BreakStatement : SyntaxKind
ReturnStatement = 188,
ReturnStatement = 189,
>ReturnStatement : SyntaxKind
WithStatement = 189,
WithStatement = 190,
>WithStatement : SyntaxKind
SwitchStatement = 190,
SwitchStatement = 191,
>SwitchStatement : SyntaxKind
LabeledStatement = 191,
LabeledStatement = 192,
>LabeledStatement : SyntaxKind
ThrowStatement = 192,
ThrowStatement = 193,
>ThrowStatement : SyntaxKind
TryStatement = 193,
TryStatement = 194,
>TryStatement : SyntaxKind
DebuggerStatement = 194,
DebuggerStatement = 195,
>DebuggerStatement : SyntaxKind
VariableDeclaration = 195,
VariableDeclaration = 196,
>VariableDeclaration : SyntaxKind
VariableDeclarationList = 196,
VariableDeclarationList = 197,
>VariableDeclarationList : SyntaxKind
FunctionDeclaration = 197,
FunctionDeclaration = 198,
>FunctionDeclaration : SyntaxKind
ClassDeclaration = 198,
ClassDeclaration = 199,
>ClassDeclaration : SyntaxKind
InterfaceDeclaration = 199,
InterfaceDeclaration = 200,
>InterfaceDeclaration : SyntaxKind
TypeAliasDeclaration = 200,
TypeAliasDeclaration = 201,
>TypeAliasDeclaration : SyntaxKind
EnumDeclaration = 201,
EnumDeclaration = 202,
>EnumDeclaration : SyntaxKind
ModuleDeclaration = 202,
ModuleDeclaration = 203,
>ModuleDeclaration : SyntaxKind
ModuleBlock = 203,
ModuleBlock = 204,
>ModuleBlock : SyntaxKind
CaseBlock = 204,
CaseBlock = 205,
>CaseBlock : SyntaxKind
ImportEqualsDeclaration = 205,
ImportEqualsDeclaration = 206,
>ImportEqualsDeclaration : SyntaxKind
ImportDeclaration = 206,
ImportDeclaration = 207,
>ImportDeclaration : SyntaxKind
ImportClause = 207,
ImportClause = 208,
>ImportClause : SyntaxKind
NamespaceImport = 208,
NamespaceImport = 209,
>NamespaceImport : SyntaxKind
NamedImports = 209,
NamedImports = 210,
>NamedImports : SyntaxKind
ImportSpecifier = 210,
ImportSpecifier = 211,
>ImportSpecifier : SyntaxKind
ExportAssignment = 211,
ExportAssignment = 212,
>ExportAssignment : SyntaxKind
ExportDeclaration = 212,
ExportDeclaration = 213,
>ExportDeclaration : SyntaxKind
NamedExports = 213,
NamedExports = 214,
>NamedExports : SyntaxKind
ExportSpecifier = 214,
ExportSpecifier = 215,
>ExportSpecifier : SyntaxKind
MissingDeclaration = 215,
MissingDeclaration = 216,
>MissingDeclaration : SyntaxKind
ExternalModuleReference = 216,
ExternalModuleReference = 217,
>ExternalModuleReference : SyntaxKind
CaseClause = 217,
CaseClause = 218,
>CaseClause : SyntaxKind
DefaultClause = 218,
DefaultClause = 219,
>DefaultClause : SyntaxKind
HeritageClause = 219,
HeritageClause = 220,
>HeritageClause : SyntaxKind
CatchClause = 220,
CatchClause = 221,
>CatchClause : SyntaxKind
PropertyAssignment = 221,
PropertyAssignment = 222,
>PropertyAssignment : SyntaxKind
ShorthandPropertyAssignment = 222,
ShorthandPropertyAssignment = 223,
>ShorthandPropertyAssignment : SyntaxKind
EnumMember = 223,
EnumMember = 224,
>EnumMember : SyntaxKind
SourceFile = 224,
SourceFile = 225,
>SourceFile : SyntaxKind
SyntaxList = 225,
SyntaxList = 226,
>SyntaxList : SyntaxKind
Count = 226,
Count = 227,
>Count : SyntaxKind
FirstAssignment = 53,
@ -1927,6 +1930,19 @@ declare module "typescript" {
>arguments : NodeArray<Expression>
>NodeArray : NodeArray<T>
>Expression : Expression
}
interface HeritageClauseElement extends Node {
>HeritageClauseElement : HeritageClauseElement
>Node : Node
expression: LeftHandSideExpression;
>expression : LeftHandSideExpression
>LeftHandSideExpression : LeftHandSideExpression
typeArguments?: NodeArray<TypeNode>;
>typeArguments : NodeArray<TypeNode>
>NodeArray : NodeArray<T>
>TypeNode : TypeNode
}
interface NewExpression extends CallExpression, PrimaryExpression {
>NewExpression : NewExpression
@ -2274,10 +2290,10 @@ declare module "typescript" {
>token : SyntaxKind
>SyntaxKind : SyntaxKind
types?: NodeArray<TypeReferenceNode>;
>types : NodeArray<TypeReferenceNode>
types?: NodeArray<HeritageClauseElement>;
>types : NodeArray<HeritageClauseElement>
>NodeArray : NodeArray<T>
>TypeReferenceNode : TypeReferenceNode
>HeritageClauseElement : HeritageClauseElement
}
interface TypeAliasDeclaration extends Declaration, ModuleElement {
>TypeAliasDeclaration : TypeAliasDeclaration
@ -3221,10 +3237,11 @@ declare module "typescript" {
>SymbolFlags : SymbolFlags
>SymbolAccessiblityResult : SymbolAccessiblityResult
isEntityNameVisible(entityName: EntityName, enclosingDeclaration: Node): SymbolVisibilityResult;
>isEntityNameVisible : (entityName: Identifier | QualifiedName, enclosingDeclaration: Node) => SymbolVisibilityResult
>entityName : Identifier | QualifiedName
isEntityNameVisible(entityName: EntityName | Expression, enclosingDeclaration: Node): SymbolVisibilityResult;
>isEntityNameVisible : (entityName: Identifier | Expression | QualifiedName, enclosingDeclaration: Node) => SymbolVisibilityResult
>entityName : Identifier | Expression | QualifiedName
>EntityName : Identifier | QualifiedName
>Expression : Expression
>enclosingDeclaration : Node
>Node : Node
>SymbolVisibilityResult : SymbolVisibilityResult

View File

@ -304,57 +304,58 @@ declare module "typescript" {
SpreadElementExpression = 173,
OmittedExpression = 174,
TemplateSpan = 175,
Block = 176,
VariableStatement = 177,
EmptyStatement = 178,
ExpressionStatement = 179,
IfStatement = 180,
DoStatement = 181,
WhileStatement = 182,
ForStatement = 183,
ForInStatement = 184,
ForOfStatement = 185,
ContinueStatement = 186,
BreakStatement = 187,
ReturnStatement = 188,
WithStatement = 189,
SwitchStatement = 190,
LabeledStatement = 191,
ThrowStatement = 192,
TryStatement = 193,
DebuggerStatement = 194,
VariableDeclaration = 195,
VariableDeclarationList = 196,
FunctionDeclaration = 197,
ClassDeclaration = 198,
InterfaceDeclaration = 199,
TypeAliasDeclaration = 200,
EnumDeclaration = 201,
ModuleDeclaration = 202,
ModuleBlock = 203,
CaseBlock = 204,
ImportEqualsDeclaration = 205,
ImportDeclaration = 206,
ImportClause = 207,
NamespaceImport = 208,
NamedImports = 209,
ImportSpecifier = 210,
ExportAssignment = 211,
ExportDeclaration = 212,
NamedExports = 213,
ExportSpecifier = 214,
MissingDeclaration = 215,
ExternalModuleReference = 216,
CaseClause = 217,
DefaultClause = 218,
HeritageClause = 219,
CatchClause = 220,
PropertyAssignment = 221,
ShorthandPropertyAssignment = 222,
EnumMember = 223,
SourceFile = 224,
SyntaxList = 225,
Count = 226,
HeritageClauseElement = 176,
Block = 177,
VariableStatement = 178,
EmptyStatement = 179,
ExpressionStatement = 180,
IfStatement = 181,
DoStatement = 182,
WhileStatement = 183,
ForStatement = 184,
ForInStatement = 185,
ForOfStatement = 186,
ContinueStatement = 187,
BreakStatement = 188,
ReturnStatement = 189,
WithStatement = 190,
SwitchStatement = 191,
LabeledStatement = 192,
ThrowStatement = 193,
TryStatement = 194,
DebuggerStatement = 195,
VariableDeclaration = 196,
VariableDeclarationList = 197,
FunctionDeclaration = 198,
ClassDeclaration = 199,
InterfaceDeclaration = 200,
TypeAliasDeclaration = 201,
EnumDeclaration = 202,
ModuleDeclaration = 203,
ModuleBlock = 204,
CaseBlock = 205,
ImportEqualsDeclaration = 206,
ImportDeclaration = 207,
ImportClause = 208,
NamespaceImport = 209,
NamedImports = 210,
ImportSpecifier = 211,
ExportAssignment = 212,
ExportDeclaration = 213,
NamedExports = 214,
ExportSpecifier = 215,
MissingDeclaration = 216,
ExternalModuleReference = 217,
CaseClause = 218,
DefaultClause = 219,
HeritageClause = 220,
CatchClause = 221,
PropertyAssignment = 222,
ShorthandPropertyAssignment = 223,
EnumMember = 224,
SourceFile = 225,
SyntaxList = 226,
Count = 227,
FirstAssignment = 53,
LastAssignment = 64,
FirstReservedWord = 66,
@ -676,6 +677,10 @@ declare module "typescript" {
typeArguments?: NodeArray<TypeNode>;
arguments: NodeArray<Expression>;
}
interface HeritageClauseElement extends Node {
expression: LeftHandSideExpression;
typeArguments?: NodeArray<TypeNode>;
}
interface NewExpression extends CallExpression, PrimaryExpression {
}
interface TaggedTemplateExpression extends MemberExpression {
@ -787,7 +792,7 @@ declare module "typescript" {
}
interface HeritageClause extends Node {
token: SyntaxKind;
types?: NodeArray<TypeReferenceNode>;
types?: NodeArray<HeritageClauseElement>;
}
interface TypeAliasDeclaration extends Declaration, ModuleElement {
name: Identifier;
@ -1029,7 +1034,7 @@ declare module "typescript" {
writeReturnTypeOfSignatureDeclaration(signatureDeclaration: SignatureDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void;
writeTypeOfExpression(expr: Expression, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void;
isSymbolAccessible(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags): SymbolAccessiblityResult;
isEntityNameVisible(entityName: EntityName, enclosingDeclaration: Node): SymbolVisibilityResult;
isEntityNameVisible(entityName: EntityName | Expression, enclosingDeclaration: Node): SymbolVisibilityResult;
getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number;
resolvesToSomeValue(location: Node, name: string): boolean;
getBlockScopedVariableId(node: Identifier): number;

View File

@ -992,157 +992,160 @@ declare module "typescript" {
TemplateSpan = 175,
>TemplateSpan : SyntaxKind
Block = 176,
HeritageClauseElement = 176,
>HeritageClauseElement : SyntaxKind
Block = 177,
>Block : SyntaxKind
VariableStatement = 177,
VariableStatement = 178,
>VariableStatement : SyntaxKind
EmptyStatement = 178,
EmptyStatement = 179,
>EmptyStatement : SyntaxKind
ExpressionStatement = 179,
ExpressionStatement = 180,
>ExpressionStatement : SyntaxKind
IfStatement = 180,
IfStatement = 181,
>IfStatement : SyntaxKind
DoStatement = 181,
DoStatement = 182,
>DoStatement : SyntaxKind
WhileStatement = 182,
WhileStatement = 183,
>WhileStatement : SyntaxKind
ForStatement = 183,
ForStatement = 184,
>ForStatement : SyntaxKind
ForInStatement = 184,
ForInStatement = 185,
>ForInStatement : SyntaxKind
ForOfStatement = 185,
ForOfStatement = 186,
>ForOfStatement : SyntaxKind
ContinueStatement = 186,
ContinueStatement = 187,
>ContinueStatement : SyntaxKind
BreakStatement = 187,
BreakStatement = 188,
>BreakStatement : SyntaxKind
ReturnStatement = 188,
ReturnStatement = 189,
>ReturnStatement : SyntaxKind
WithStatement = 189,
WithStatement = 190,
>WithStatement : SyntaxKind
SwitchStatement = 190,
SwitchStatement = 191,
>SwitchStatement : SyntaxKind
LabeledStatement = 191,
LabeledStatement = 192,
>LabeledStatement : SyntaxKind
ThrowStatement = 192,
ThrowStatement = 193,
>ThrowStatement : SyntaxKind
TryStatement = 193,
TryStatement = 194,
>TryStatement : SyntaxKind
DebuggerStatement = 194,
DebuggerStatement = 195,
>DebuggerStatement : SyntaxKind
VariableDeclaration = 195,
VariableDeclaration = 196,
>VariableDeclaration : SyntaxKind
VariableDeclarationList = 196,
VariableDeclarationList = 197,
>VariableDeclarationList : SyntaxKind
FunctionDeclaration = 197,
FunctionDeclaration = 198,
>FunctionDeclaration : SyntaxKind
ClassDeclaration = 198,
ClassDeclaration = 199,
>ClassDeclaration : SyntaxKind
InterfaceDeclaration = 199,
InterfaceDeclaration = 200,
>InterfaceDeclaration : SyntaxKind
TypeAliasDeclaration = 200,
TypeAliasDeclaration = 201,
>TypeAliasDeclaration : SyntaxKind
EnumDeclaration = 201,
EnumDeclaration = 202,
>EnumDeclaration : SyntaxKind
ModuleDeclaration = 202,
ModuleDeclaration = 203,
>ModuleDeclaration : SyntaxKind
ModuleBlock = 203,
ModuleBlock = 204,
>ModuleBlock : SyntaxKind
CaseBlock = 204,
CaseBlock = 205,
>CaseBlock : SyntaxKind
ImportEqualsDeclaration = 205,
ImportEqualsDeclaration = 206,
>ImportEqualsDeclaration : SyntaxKind
ImportDeclaration = 206,
ImportDeclaration = 207,
>ImportDeclaration : SyntaxKind
ImportClause = 207,
ImportClause = 208,
>ImportClause : SyntaxKind
NamespaceImport = 208,
NamespaceImport = 209,
>NamespaceImport : SyntaxKind
NamedImports = 209,
NamedImports = 210,
>NamedImports : SyntaxKind
ImportSpecifier = 210,
ImportSpecifier = 211,
>ImportSpecifier : SyntaxKind
ExportAssignment = 211,
ExportAssignment = 212,
>ExportAssignment : SyntaxKind
ExportDeclaration = 212,
ExportDeclaration = 213,
>ExportDeclaration : SyntaxKind
NamedExports = 213,
NamedExports = 214,
>NamedExports : SyntaxKind
ExportSpecifier = 214,
ExportSpecifier = 215,
>ExportSpecifier : SyntaxKind
MissingDeclaration = 215,
MissingDeclaration = 216,
>MissingDeclaration : SyntaxKind
ExternalModuleReference = 216,
ExternalModuleReference = 217,
>ExternalModuleReference : SyntaxKind
CaseClause = 217,
CaseClause = 218,
>CaseClause : SyntaxKind
DefaultClause = 218,
DefaultClause = 219,
>DefaultClause : SyntaxKind
HeritageClause = 219,
HeritageClause = 220,
>HeritageClause : SyntaxKind
CatchClause = 220,
CatchClause = 221,
>CatchClause : SyntaxKind
PropertyAssignment = 221,
PropertyAssignment = 222,
>PropertyAssignment : SyntaxKind
ShorthandPropertyAssignment = 222,
ShorthandPropertyAssignment = 223,
>ShorthandPropertyAssignment : SyntaxKind
EnumMember = 223,
EnumMember = 224,
>EnumMember : SyntaxKind
SourceFile = 224,
SourceFile = 225,
>SourceFile : SyntaxKind
SyntaxList = 225,
SyntaxList = 226,
>SyntaxList : SyntaxKind
Count = 226,
Count = 227,
>Count : SyntaxKind
FirstAssignment = 53,
@ -2100,6 +2103,19 @@ declare module "typescript" {
>arguments : NodeArray<Expression>
>NodeArray : NodeArray<T>
>Expression : Expression
}
interface HeritageClauseElement extends Node {
>HeritageClauseElement : HeritageClauseElement
>Node : Node
expression: LeftHandSideExpression;
>expression : LeftHandSideExpression
>LeftHandSideExpression : LeftHandSideExpression
typeArguments?: NodeArray<TypeNode>;
>typeArguments : NodeArray<TypeNode>
>NodeArray : NodeArray<T>
>TypeNode : TypeNode
}
interface NewExpression extends CallExpression, PrimaryExpression {
>NewExpression : NewExpression
@ -2447,10 +2463,10 @@ declare module "typescript" {
>token : SyntaxKind
>SyntaxKind : SyntaxKind
types?: NodeArray<TypeReferenceNode>;
>types : NodeArray<TypeReferenceNode>
types?: NodeArray<HeritageClauseElement>;
>types : NodeArray<HeritageClauseElement>
>NodeArray : NodeArray<T>
>TypeReferenceNode : TypeReferenceNode
>HeritageClauseElement : HeritageClauseElement
}
interface TypeAliasDeclaration extends Declaration, ModuleElement {
>TypeAliasDeclaration : TypeAliasDeclaration
@ -3394,10 +3410,11 @@ declare module "typescript" {
>SymbolFlags : SymbolFlags
>SymbolAccessiblityResult : SymbolAccessiblityResult
isEntityNameVisible(entityName: EntityName, enclosingDeclaration: Node): SymbolVisibilityResult;
>isEntityNameVisible : (entityName: Identifier | QualifiedName, enclosingDeclaration: Node) => SymbolVisibilityResult
>entityName : Identifier | QualifiedName
isEntityNameVisible(entityName: EntityName | Expression, enclosingDeclaration: Node): SymbolVisibilityResult;
>isEntityNameVisible : (entityName: Identifier | Expression | QualifiedName, enclosingDeclaration: Node) => SymbolVisibilityResult
>entityName : Identifier | Expression | QualifiedName
>EntityName : Identifier | QualifiedName
>Expression : Expression
>enclosingDeclaration : Node
>Node : Node
>SymbolVisibilityResult : SymbolVisibilityResult

View File

@ -52,7 +52,7 @@ import Backbone = require("aliasUsage1_backbone");
export class VisualizationModel extends Backbone.Model {
>VisualizationModel : VisualizationModel
>Backbone : unknown
>Backbone : typeof Backbone
>Model : Backbone.Model
// interesting stuff here

View File

@ -40,7 +40,7 @@ import Backbone = require("aliasUsageInArray_backbone");
export class VisualizationModel extends Backbone.Model {
>VisualizationModel : VisualizationModel
>Backbone : unknown
>Backbone : typeof Backbone
>Model : Backbone.Model
// interesting stuff here

View File

@ -41,7 +41,7 @@ import Backbone = require("aliasUsageInFunctionExpression_backbone");
export class VisualizationModel extends Backbone.Model {
>VisualizationModel : VisualizationModel
>Backbone : unknown
>Backbone : typeof Backbone
>Model : Backbone.Model
// interesting stuff here

View File

@ -55,7 +55,7 @@ import Backbone = require("aliasUsageInGenericFunction_backbone");
export class VisualizationModel extends Backbone.Model {
>VisualizationModel : VisualizationModel
>Backbone : unknown
>Backbone : typeof Backbone
>Model : Backbone.Model
// interesting stuff here

View File

@ -49,7 +49,7 @@ import Backbone = require("aliasUsageInIndexerOfClass_backbone");
export class VisualizationModel extends Backbone.Model {
>VisualizationModel : VisualizationModel
>Backbone : unknown
>Backbone : typeof Backbone
>Model : Backbone.Model
// interesting stuff here

View File

@ -54,7 +54,7 @@ import Backbone = require("aliasUsageInObjectLiteral_backbone");
export class VisualizationModel extends Backbone.Model {
>VisualizationModel : VisualizationModel
>Backbone : unknown
>Backbone : typeof Backbone
>Model : Backbone.Model
// interesting stuff here

View File

@ -75,7 +75,7 @@ import Backbone = require("aliasUsageInOrExpression_backbone");
export class VisualizationModel extends Backbone.Model {
>VisualizationModel : VisualizationModel
>Backbone : unknown
>Backbone : typeof Backbone
>Model : Backbone.Model
// interesting stuff here

View File

@ -75,7 +75,7 @@ import Backbone = require("aliasUsageInOrExpression_backbone");
export class VisualizationModel extends Backbone.Model {
>VisualizationModel : VisualizationModel
>Backbone : unknown
>Backbone : typeof Backbone
>Model : Backbone.Model
// interesting stuff here

View File

@ -45,7 +45,7 @@ import Backbone = require("aliasUsageInTypeArgumentOfExtendsClause_backbone");
export class VisualizationModel extends Backbone.Model {
>VisualizationModel : VisualizationModel
>Backbone : unknown
>Backbone : typeof Backbone
>Model : Backbone.Model
// interesting stuff here

View File

@ -36,7 +36,7 @@ import Backbone = require("aliasUsageInVarAssignment_backbone");
export class VisualizationModel extends Backbone.Model {
>VisualizationModel : VisualizationModel
>Backbone : unknown
>Backbone : typeof Backbone
>Model : Backbone.Model
// interesting stuff here

View File

@ -10,7 +10,7 @@ module B {
export class D extends a.C {
>D : D
>a : unknown
>a : typeof a
>C : a.C
id: number;

View File

@ -18,7 +18,7 @@ module M {
export class O extends M.N {
>O : O
>M : unknown
>M : typeof M
>N : N
}
}

View File

@ -2,16 +2,15 @@ tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/cla
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(4,18): error TS2304: Cannot find name 'string'.
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(5,18): error TS2304: Cannot find name 'boolean'.
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(6,18): error TS2304: Cannot find name 'Void'.
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(7,19): error TS1133: Type reference expected.
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(7,19): error TS1109: Expression expected.
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(8,18): error TS2304: Cannot find name 'Null'.
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(9,19): error TS1133: Type reference expected.
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(9,24): error TS1005: ';' expected.
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(9,19): error TS9002: Only type references are currently supported in a class 'extends' clauses.
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(10,18): error TS2304: Cannot find name 'undefined'.
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(11,18): error TS2304: Cannot find name 'Undefined'.
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(14,18): error TS2311: A class may only extend another class.
==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts (11 errors) ====
==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts (10 errors) ====
// classes cannot extend primitives
class C extends number { }
@ -28,15 +27,13 @@ tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/cla
!!! error TS2304: Cannot find name 'Void'.
class C4a extends void {}
~~~~
!!! error TS1133: Type reference expected.
!!! error TS1109: Expression expected.
class C5 extends Null { }
~~~~
!!! error TS2304: Cannot find name 'Null'.
class C5a extends null { }
~~~~
!!! error TS1133: Type reference expected.
~
!!! error TS1005: ';' expected.
!!! error TS9002: Only type references are currently supported in a class 'extends' clauses.
class C6 extends undefined { }
~~~~~~~~~
!!! error TS2304: Cannot find name 'undefined'.

View File

@ -63,13 +63,13 @@ var C5 = (function (_super) {
}
return C5;
})(Null);
var C5a = (function () {
var C5a = (function (_super) {
__extends(C5a, _super);
function C5a() {
_super.apply(this, arguments);
}
return C5a;
})();
null;
{ }
})(null);
var C6 = (function (_super) {
__extends(C6, _super);
function C6() {

View File

@ -1,16 +1,13 @@
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive2.ts(3,19): error TS1133: Type reference expected.
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive2.ts(4,19): error TS1133: Type reference expected.
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive2.ts(4,24): error TS1005: ';' expected.
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive2.ts(3,19): error TS1109: Expression expected.
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive2.ts(4,19): error TS9002: Only type references are currently supported in a class 'extends' clauses.
==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive2.ts (3 errors) ====
==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive2.ts (2 errors) ====
// classes cannot extend primitives
class C4a extends void {}
~~~~
!!! error TS1133: Type reference expected.
!!! error TS1109: Expression expected.
class C5a extends null { }
~~~~
!!! error TS1133: Type reference expected.
~
!!! error TS1005: ';' expected.
!!! error TS9002: Only type references are currently supported in a class 'extends' clauses.

View File

@ -6,16 +6,22 @@ class C5a extends null { }
//// [classExtendingPrimitive2.js]
// classes cannot extend primitives
var __extends = this.__extends || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
__.prototype = b.prototype;
d.prototype = new __();
};
var C4a = (function () {
function C4a() {
}
return C4a;
})();
void {};
var C5a = (function () {
var C5a = (function (_super) {
__extends(C5a, _super);
function C5a() {
_super.apply(this, arguments);
}
return C5a;
})();
null;
{ }
})(null);

View File

@ -8,7 +8,7 @@ module M {
class D extends M.C {
>D : D
>M : unknown
>M : typeof M
>C : C
}
}

View File

@ -1,12 +1,13 @@
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(4,17): error TS2311: A class may only extend another class.
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(6,18): error TS9002: Only type references are currently supported in a class 'extends' clauses.
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(6,31): error TS1005: ',' expected.
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(8,18): error TS2304: Cannot find name 'x'.
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(11,18): error TS2304: Cannot find name 'M'.
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(14,18): error TS2304: Cannot find name 'foo'.
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(16,18): error TS1133: Type reference expected.
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(16,20): error TS1005: ';' expected.
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(16,18): error TS9002: Only type references are currently supported in a class 'extends' clauses.
==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts (6 errors) ====
==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts (7 errors) ====
interface I {
foo: string;
}
@ -15,6 +16,10 @@ tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/cla
!!! error TS2311: A class may only extend another class.
class C2 extends { foo: string; } { } // error
~~~~~~~~~~~~~~~~
!!! error TS9002: Only type references are currently supported in a class 'extends' clauses.
~
!!! error TS1005: ',' expected.
var x: { foo: string; }
class C3 extends x { } // error
~
@ -31,7 +36,5 @@ tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/cla
!!! error TS2304: Cannot find name 'foo'.
class C6 extends []{ } // error
~
!!! error TS1133: Type reference expected.
~
!!! error TS1005: ';' expected.
~~
!!! error TS9002: Only type references are currently supported in a class 'extends' clauses.

View File

@ -30,12 +30,13 @@ var C = (function (_super) {
}
return C;
})(I); // error
var C2 = (function () {
var C2 = (function (_super) {
__extends(C2, _super);
function C2() {
_super.apply(this, arguments);
}
return C2;
})();
{ } // error
})({ foo: string }); // error
var x;
var C3 = (function (_super) {
__extends(C3, _super);
@ -63,10 +64,10 @@ var C5 = (function (_super) {
}
return C5;
})(foo); // error
var C6 = (function () {
var C6 = (function (_super) {
__extends(C6, _super);
function C6() {
_super.apply(this, arguments);
}
return C6;
})();
[];
{ } // error
})([]); // error

View File

@ -1,12 +1,15 @@
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts(3,18): error TS1133: Type reference expected.
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts(3,20): error TS1005: ';' expected.
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts(1,18): error TS9002: Only type references are currently supported in a class 'extends' clauses.
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts(1,31): error TS1005: ',' expected.
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts(3,18): error TS9002: Only type references are currently supported in a class 'extends' clauses.
==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts (2 errors) ====
==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts (3 errors) ====
class C2 extends { foo: string; } { } // error
~~~~~~~~~~~~~~~~
!!! error TS9002: Only type references are currently supported in a class 'extends' clauses.
~
!!! error TS1005: ',' expected.
class C6 extends []{ } // error
~
!!! error TS1133: Type reference expected.
~
!!! error TS1005: ';' expected.
~~
!!! error TS9002: Only type references are currently supported in a class 'extends' clauses.

View File

@ -4,16 +4,23 @@ class C2 extends { foo: string; } { } // error
class C6 extends []{ } // error
//// [classExtendsEveryObjectType2.js]
var C2 = (function () {
var __extends = this.__extends || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
__.prototype = b.prototype;
d.prototype = new __();
};
var C2 = (function (_super) {
__extends(C2, _super);
function C2() {
_super.apply(this, arguments);
}
return C2;
})();
{ } // error
var C6 = (function () {
})({ foo: string }); // error
var C6 = (function (_super) {
__extends(C6, _super);
function C6() {
_super.apply(this, arguments);
}
return C6;
})();
[];
{ } // error
})([]); // error

View File

@ -5,7 +5,7 @@ declare module E {
class foobar extends D.bar {
>foobar : foobar
>D : unknown
>D : typeof D
>bar : D.bar
foo();

View File

@ -147,14 +147,14 @@ export var g = C.F5<C.A<C.B>>();
export class h extends C.A<C.B>{ }
>h : h
>C : unknown
>C : typeof C
>A : C.A<T>
>C : unknown
>B : C.B
export interface i extends C.A<C.B> { }
>i : i
>C : unknown
>C : typeof C
>A : C.A<T>
>C : unknown
>B : C.B

View File

@ -30,7 +30,7 @@ declare module templa.mvc {
>templa : unknown
>mvc : unknown
>IModel : IModel
>mvc : unknown
>mvc : typeof mvc
>IController : IController<ModelType>
>ModelType : ModelType
}
@ -42,7 +42,7 @@ declare module templa.mvc.composite {
interface ICompositeControllerModel extends mvc.IModel {
>ICompositeControllerModel : ICompositeControllerModel
>mvc : unknown
>mvc : typeof mvc
>IModel : IModel
getControllers(): mvc.IController<mvc.IModel>[];
@ -64,8 +64,8 @@ module templa.dom.mvc {
>templa : unknown
>mvc : unknown
>IModel : templa.mvc.IModel
>templa : unknown
>mvc : unknown
>templa : typeof templa
>mvc : typeof templa.mvc
>IController : templa.mvc.IController<ModelType>
>ModelType : ModelType
}
@ -82,8 +82,8 @@ module templa.dom.mvc {
>templa : unknown
>mvc : unknown
>IModel : templa.mvc.IModel
>templa : unknown
>mvc : unknown
>templa : typeof templa
>mvc : typeof templa.mvc
>AbstractController : templa.mvc.AbstractController<ModelType>
>ModelType : ModelType
>IElementController : IElementController<ModelType>
@ -110,9 +110,9 @@ module templa.dom.mvc.composite {
>mvc : unknown
>composite : unknown
>ICompositeControllerModel : templa.mvc.composite.ICompositeControllerModel
>templa : unknown
>dom : unknown
>mvc : unknown
>templa : typeof templa
>dom : typeof dom
>mvc : typeof mvc
>AbstractElementController : AbstractElementController<ModelType>
>ModelType : ModelType

View File

@ -15,7 +15,7 @@ module A.B.C {
export class W implements A.C.Z {
>W : W
>A : unknown
>A : typeof A
>C : unknown
>Z : A.C.Z
}

View File

@ -19,9 +19,9 @@ module X.Y.base {
export class W extends A.B.Base.W {
>W : W
>A : unknown
>B : unknown
>Base : unknown
>A : typeof A
>B : typeof A.B
>Base : typeof A.B.Base
>W : A.B.Base.W
name: string;
@ -38,9 +38,9 @@ module X.Y.base.Z {
export class W<TValue> extends X.Y.base.W {
>W : W<TValue>
>TValue : TValue
>X : unknown
>Y : unknown
>base : unknown
>X : typeof X
>Y : typeof Y
>base : typeof base
>W : base.W
value: boolean;

View File

@ -20,8 +20,8 @@ module X.A.B.C {
}
export class W implements X.A.C.Z { // This needs to be refered as X.A.C.Z as A has conflict
>W : W
>X : unknown
>A : unknown
>X : typeof X
>A : typeof A
>C : unknown
>Z : X.A.C.Z
}

View File

@ -17,7 +17,7 @@ module X.A.B.C {
export class W implements A.C.Z { // This can refer to it as A.C.Z
>W : W
>A : unknown
>A : typeof A
>C : unknown
>Z : A.C.Z
}

View File

@ -17,8 +17,8 @@ module X.A.B.C {
export class W implements X.A.C.Z { // This needs to be refered as X.A.C.Z as A has conflict
>W : W
>X : unknown
>A : unknown
>X : typeof X
>A : typeof A
>C : unknown
>Z : X.A.C.Z
}

View File

@ -119,13 +119,13 @@ export module M.Q {
}
export interface b extends M.b { } // ok
>b : b
>M : unknown
>M : typeof M
>b : M.C
export interface I extends M.c.I { } // ok
>I : I
>M : unknown
>c : unknown
>M : typeof M
>c : typeof M.N
>I : M.c.I
export module c {
@ -133,8 +133,8 @@ export module M.Q {
export interface I extends M.c.I { } // ok
>I : I
>M : unknown
>c : unknown
>M : typeof M
>c : typeof M.N
>I : M.c.I
}
}

View File

@ -14,12 +14,12 @@ import ab = A.B;
class D extends ab.C{ }
>D : D
>ab : unknown
>ab : typeof ab
>C : ab.C
class E extends A.B.C{ }
>E : E
>A : unknown
>B : unknown
>A : typeof A
>B : typeof ab
>C : ab.C

View File

@ -9,7 +9,7 @@ declare module M {
class Bar extends M.Foo {
>Bar : Bar
>M : unknown
>M : typeof M
>Foo : M.Foo
}

View File

@ -29,7 +29,7 @@ module N {
export class C3 extends M.B {
>C3 : C3
>M : unknown
>M : typeof M
>B : M.B
}
}

View File

@ -60,7 +60,7 @@ import Backbone = require("extendingClassFromAliasAndUsageInIndexer_backbone");
export class VisualizationModel extends Backbone.Model {
>VisualizationModel : VisualizationModel
>Backbone : unknown
>Backbone : typeof Backbone
>Model : Backbone.Model
// interesting stuff here
@ -72,7 +72,7 @@ import Backbone = require("extendingClassFromAliasAndUsageInIndexer_backbone");
export class VisualizationModel extends Backbone.Model {
>VisualizationModel : VisualizationModel
>Backbone : unknown
>Backbone : typeof Backbone
>Model : Backbone.Model
// different interesting stuff here

View File

@ -191,9 +191,9 @@ module PortalFx.ViewModels.Controls.Validators {
export class Validator<TValue> extends Portal.Controls.Validators.Validator<TValue> {
>Validator : Validator<TValue>
>TValue : TValue
>Portal : unknown
>Controls : unknown
>Validators : unknown
>Portal : typeof Portal
>Controls : typeof Portal.Controls
>Validators : typeof Portal.Controls.Validators
>Validator : Portal.Controls.Validators.Validator<TValue>
>TValue : TValue

View File

@ -12,7 +12,7 @@ declare module EndGate {
interface Number extends EndGate.ICloneable { }
>Number : Number
>EndGate : unknown
>EndGate : typeof EndGate
>ICloneable : EndGate.ICloneable
module EndGate.Tweening {

View File

@ -12,7 +12,7 @@ module EndGate {
interface Number extends EndGate.ICloneable { }
>Number : Number
>EndGate : unknown
>EndGate : typeof EndGate
>ICloneable : EndGate.ICloneable
module EndGate.Tweening {

View File

@ -5,7 +5,7 @@ import foo = require('importUsedInExtendsList1_require');
class Sub extends foo.Super { }
>Sub : Sub
>foo : unknown
>foo : typeof foo
>Super : foo.Super
var s: Sub;

View File

@ -14,13 +14,13 @@ module N {
export class D1 extends M.C1 { }
>D1 : D1
>M : unknown
>M : typeof M
>C1 : M.C1
export class D2<T> extends M.C2<T> { }
>D2 : D2<T>
>T : T
>M : unknown
>M : typeof M
>C2 : M.C2<T>
>T : T
}

View File

@ -1,15 +1,12 @@
tests/cases/compiler/interfaceMayNotBeExtendedWitACall.ts(3,29): error TS1005: ',' expected.
tests/cases/compiler/interfaceMayNotBeExtendedWitACall.ts(3,32): error TS1005: '=>' expected.
tests/cases/compiler/interfaceMayNotBeExtendedWitACall.ts(3,24): error TS2499: An interface can only extend a type reference.
==== tests/cases/compiler/interfaceMayNotBeExtendedWitACall.ts (2 errors) ====
==== tests/cases/compiler/interfaceMayNotBeExtendedWitACall.ts (1 errors) ====
interface color {}
interface blue extends color() { // error
~
!!! error TS1005: ',' expected.
~
!!! error TS1005: '=>' expected.
~~~~~~~
!!! error TS2499: An interface can only extend a type reference.
}

View File

@ -7,5 +7,3 @@ interface blue extends color() { // error
//// [interfaceMayNotBeExtendedWitACall.js]
(function () {
});

View File

@ -4,7 +4,7 @@ module rionegrensis {
export class caniventer extends Lanthanum.nitidus<petrophilus.minutilla, julianae.sumatrana> {
>caniventer : caniventer
>Lanthanum : unknown
>Lanthanum : typeof Lanthanum
>nitidus : Lanthanum.nitidus<T0, T1>
>petrophilus : unknown
>minutilla : petrophilus.minutilla
@ -89,7 +89,7 @@ module rionegrensis {
>veraecrucis : veraecrucis<T0, T1>
>T0 : T0
>T1 : T1
>trivirgatus : unknown
>trivirgatus : typeof trivirgatus
>mixtus : trivirgatus.mixtus<T0, T1>
>gabriellae : unknown
>amicus : gabriellae.amicus
@ -514,7 +514,7 @@ module julianae {
>oralis : oralis<T0, T1>
>T0 : T0
>T1 : T1
>caurinus : unknown
>caurinus : typeof caurinus
>psilurus : caurinus.psilurus
cepapi() : caurinus.psilurus { var x : caurinus.psilurus; () => { var y = this; }; return x; }
@ -751,7 +751,7 @@ module julianae {
}
export class sumatrana extends Lanthanum.jugularis {
>sumatrana : sumatrana
>Lanthanum : unknown
>Lanthanum : typeof Lanthanum
>jugularis : Lanthanum.jugularis
wolffsohni() : Lanthanum.suillus<dammermani.melanops, quasiater.carolinensis> { var x : Lanthanum.suillus<dammermani.melanops, quasiater.carolinensis>; () => { var y = this; }; return x; }
@ -1276,7 +1276,7 @@ module julianae {
}
export class durangae extends dogramacii.aurata {
>durangae : durangae
>dogramacii : unknown
>dogramacii : typeof dogramacii
>aurata : dogramacii.aurata
Californium() : panamensis.setulosus<lutreolus.punicus, dammermani.melanops> { var x : panamensis.setulosus<lutreolus.punicus, dammermani.melanops>; () => { var y = this; }; return x; }
@ -1429,7 +1429,7 @@ module Lanthanum {
>nitidus : nitidus<T0, T1>
>T0 : T0
>T1 : T1
>argurus : unknown
>argurus : typeof argurus
>gilbertii : argurus.gilbertii<T0, T1>
>lavali : unknown
>thaeleri : lavali.thaeleri
@ -1598,7 +1598,7 @@ module Lanthanum {
}
export class megalonyx extends caurinus.johorensis<caurinus.megaphyllus, julianae.steerii> {
>megalonyx : megalonyx
>caurinus : unknown
>caurinus : typeof caurinus
>johorensis : caurinus.johorensis<T0, T1>
>caurinus : unknown
>megaphyllus : caurinus.megaphyllus
@ -1984,7 +1984,7 @@ module rendalli {
export class zuluensis extends julianae.steerii {
>zuluensis : zuluensis
>julianae : unknown
>julianae : typeof julianae
>steerii : julianae.steerii
telfairi() : argurus.wetmorei<Lanthanum.megalonyx, provocax.melanoleuca> { var x : argurus.wetmorei<Lanthanum.megalonyx, provocax.melanoleuca>; () => { var y = this; }; return x; }
@ -2418,7 +2418,7 @@ module rendalli {
>crenulata : crenulata<T0, T1>
>T0 : T0
>T1 : T1
>trivirgatus : unknown
>trivirgatus : typeof trivirgatus
>falconeri : trivirgatus.falconeri
salvanius() : howi.coludo<howi.marcanoi, rionegrensis.caniventer> { var x : howi.coludo<howi.marcanoi, rionegrensis.caniventer>; () => { var y = this; }; return x; }
@ -2612,7 +2612,7 @@ module trivirgatus {
>mixtus : mixtus<T0, T1>
>T0 : T0
>T1 : T1
>argurus : unknown
>argurus : typeof argurus
>pygmaea : argurus.pygmaea<T0, T1>
>argurus : unknown
>oreas : argurus.oreas
@ -3349,7 +3349,7 @@ module ruatanica {
export class americanus extends imperfecta.ciliolabrum<argurus.germaini, lutreolus.foina> {
>americanus : americanus
>imperfecta : unknown
>imperfecta : typeof imperfecta
>ciliolabrum : imperfecta.ciliolabrum<T0, T1>
>argurus : unknown
>germaini : argurus.germaini
@ -3418,7 +3418,7 @@ module lavali {
export class wilsoni extends Lanthanum.nitidus<rionegrensis.caniventer, Lanthanum.jugularis> {
>wilsoni : wilsoni
>Lanthanum : unknown
>Lanthanum : typeof Lanthanum
>nitidus : Lanthanum.nitidus<T0, T1>
>rionegrensis : unknown
>caniventer : rionegrensis.caniventer
@ -3638,7 +3638,7 @@ module lavali {
}
export class otion extends howi.coludo<argurus.oreas, howi.marcanoi> {
>otion : otion
>howi : unknown
>howi : typeof howi
>coludo : howi.coludo<T0, T1>
>argurus : unknown
>oreas : argurus.oreas
@ -4112,7 +4112,7 @@ module lavali {
}
export class thaeleri extends argurus.oreas {
>thaeleri : thaeleri
>argurus : unknown
>argurus : typeof argurus
>oreas : argurus.oreas
coromandra() : julianae.galapagoensis { var x : julianae.galapagoensis; () => { var y = this; }; return x; }
@ -4275,7 +4275,7 @@ module lavali {
}
export class lepturus extends Lanthanum.suillus<dammermani.melanops, quasiater.carolinensis> {
>lepturus : lepturus
>Lanthanum : unknown
>Lanthanum : typeof Lanthanum
>suillus : Lanthanum.suillus<T0, T1>
>dammermani : unknown
>melanops : dammermani.melanops
@ -4350,7 +4350,7 @@ module dogramacii {
export class robustulus extends lavali.wilsoni {
>robustulus : robustulus
>lavali : unknown
>lavali : typeof lavali
>wilsoni : lavali.wilsoni
fossor() : minutus.inez<argurus.peninsulae, julianae.nudicaudus> { var x : minutus.inez<argurus.peninsulae, julianae.nudicaudus>; () => { var y = this; }; return x; }
@ -4924,7 +4924,7 @@ module lutreolus {
export class schlegeli extends lavali.beisa {
>schlegeli : schlegeli
>lavali : unknown
>lavali : typeof lavali
>beisa : lavali.beisa
mittendorfi() : rionegrensis.caniventer { var x : rionegrensis.caniventer; () => { var y = this; }; return x; }
@ -5661,7 +5661,7 @@ module panglima {
>amphibius : amphibius<T0, T1>
>T0 : T0
>T1 : T1
>caurinus : unknown
>caurinus : typeof caurinus
>johorensis : caurinus.johorensis<T0, T1>
>Lanthanum : unknown
>nitidus : Lanthanum.nitidus<T0, T1>
@ -5794,7 +5794,7 @@ module panglima {
>fundatus : fundatus<T0, T1>
>T0 : T0
>T1 : T1
>lutreolus : unknown
>lutreolus : typeof lutreolus
>schlegeli : lutreolus.schlegeli
crassulus(): nigra.gracilis<provocax.melanoleuca, provocax.melanoleuca> { var x: nigra.gracilis<provocax.melanoleuca, provocax.melanoleuca>; () => { var y = this; }; return x; }
@ -5899,7 +5899,7 @@ module panglima {
>abidi : abidi<T0, T1>
>T0 : T0
>T1 : T1
>argurus : unknown
>argurus : typeof argurus
>dauricus : argurus.dauricus<T0, T1>
>argurus : unknown
>germaini : argurus.germaini
@ -6113,7 +6113,7 @@ module minutus {
>himalayana : himalayana<T0, T1>
>T0 : T0
>T1 : T1
>lutreolus : unknown
>lutreolus : typeof lutreolus
>punicus : lutreolus.punicus
simoni(): argurus.netscheri<lavali.lepturus, argurus.dauricus<argurus.oreas, quasiater.carolinensis>> { var x: argurus.netscheri<lavali.lepturus, argurus.dauricus<argurus.oreas, quasiater.carolinensis>>; () => { var y = this; }; return x; }
@ -6356,7 +6356,7 @@ module caurinus {
>mahaganus : mahaganus<T0, T1>
>T0 : T0
>T1 : T1
>panglima : unknown
>panglima : typeof panglima
>fundatus : panglima.fundatus<T0, T1>
>quasiater : unknown
>carolinensis : quasiater.carolinensis
@ -6584,7 +6584,7 @@ module howi {
>angulatus : angulatus<T0, T1>
>T0 : T0
>T1 : T1
>sagitta : unknown
>sagitta : typeof sagitta
>stolzmanni : sagitta.stolzmanni
pennatus(): howi.marcanoi { var x: howi.marcanoi; () => { var y = this; }; return x; }
@ -6791,7 +6791,7 @@ module sagitta {
export class walkeri extends minutus.portoricensis {
>walkeri : walkeri
>minutus : unknown
>minutus : typeof minutus
>portoricensis : minutus.portoricensis
maracajuensis(): samarensis.cahirinus<Lanthanum.jugularis, ruatanica.americanus> { var x: samarensis.cahirinus<Lanthanum.jugularis, ruatanica.americanus>; () => { var y = this; }; return x; }
@ -6822,7 +6822,7 @@ module minutus {
>inez : inez<T0, T1>
>T0 : T0
>T1 : T1
>samarensis : unknown
>samarensis : typeof samarensis
>pelurus : samarensis.pelurus<T0, T1>
>argurus : unknown
>germaini : argurus.germaini
@ -6855,7 +6855,7 @@ module macrorhinos {
export class konganensis extends imperfecta.lasiurus<caurinus.psilurus, caurinus.psilurus> {
>konganensis : konganensis
>imperfecta : unknown
>imperfecta : typeof imperfecta
>lasiurus : imperfecta.lasiurus<T0, T1>
>caurinus : unknown
>psilurus : caurinus.psilurus
@ -6870,7 +6870,7 @@ module panamensis {
>linulus : linulus<T0, T1>
>T0 : T0
>T1 : T1
>ruatanica : unknown
>ruatanica : typeof ruatanica
>hector : ruatanica.hector<T0, T1>
>julianae : unknown
>sumatrana : julianae.sumatrana
@ -7330,7 +7330,7 @@ module samarensis {
>pelurus : pelurus<T0, T1>
>T0 : T0
>T1 : T1
>sagitta : unknown
>sagitta : typeof sagitta
>stolzmanni : sagitta.stolzmanni
Palladium(): panamensis.linulus<macrorhinos.konganensis, rionegrensis.caniventer> { var x: panamensis.linulus<macrorhinos.konganensis, rionegrensis.caniventer>; () => { var y = this; }; return x; }
@ -7587,7 +7587,7 @@ module samarensis {
>fuscus : fuscus<T0, T1>
>T0 : T0
>T1 : T1
>macrorhinos : unknown
>macrorhinos : typeof macrorhinos
>daphaenodon : macrorhinos.daphaenodon
planifrons(): nigra.gracilis<julianae.nudicaudus, dogramacii.aurata> { var x: nigra.gracilis<julianae.nudicaudus, dogramacii.aurata>; () => { var y = this; }; return x; }
@ -8064,7 +8064,7 @@ module sagitta {
>leptoceros : leptoceros<T0, T1>
>T0 : T0
>T1 : T1
>caurinus : unknown
>caurinus : typeof caurinus
>johorensis : caurinus.johorensis<T0, T1>
>argurus : unknown
>peninsulae : argurus.peninsulae
@ -8175,7 +8175,7 @@ module daubentonii {
>nigricans : nigricans<T0, T1>
>T0 : T0
>T1 : T1
>sagitta : unknown
>sagitta : typeof sagitta
>stolzmanni : sagitta.stolzmanni
woosnami(): dogramacii.robustulus { var x: dogramacii.robustulus; () => { var y = this; }; return x; }
@ -8207,7 +8207,7 @@ module argurus {
>pygmaea : pygmaea<T0, T1>
>T0 : T0
>T1 : T1
>rendalli : unknown
>rendalli : typeof rendalli
>moojeni : rendalli.moojeni<T0, T1>
>macrorhinos : unknown
>konganensis : macrorhinos.konganensis
@ -8258,7 +8258,7 @@ module chrysaeolus {
>sarasinorum : sarasinorum<T0, T1>
>T0 : T0
>T1 : T1
>caurinus : unknown
>caurinus : typeof caurinus
>psilurus : caurinus.psilurus
belzebul(): samarensis.pallidus { var x: samarensis.pallidus; () => { var y = this; }; return x; }
@ -8500,7 +8500,7 @@ module argurus {
export class oreas extends lavali.wilsoni {
>oreas : oreas
>lavali : unknown
>lavali : typeof lavali
>wilsoni : lavali.wilsoni
salamonis(): lavali.xanthognathus { var x: lavali.xanthognathus; () => { var y = this; }; return x; }
@ -9129,7 +9129,7 @@ module provocax {
export class melanoleuca extends lavali.wilsoni {
>melanoleuca : melanoleuca
>lavali : unknown
>lavali : typeof lavali
>wilsoni : lavali.wilsoni
Neodymium(): macrorhinos.marmosurus<petrophilus.sodyi<trivirgatus.falconeri, quasiater.bobrinskoi>, lutreolus.foina> { var x: macrorhinos.marmosurus<petrophilus.sodyi<trivirgatus.falconeri, quasiater.bobrinskoi>, lutreolus.foina>; () => { var y = this; }; return x; }
@ -9275,7 +9275,7 @@ module howi {
export class marcanoi extends Lanthanum.megalonyx {
>marcanoi : marcanoi
>Lanthanum : unknown
>Lanthanum : typeof Lanthanum
>megalonyx : Lanthanum.megalonyx
formosae(): Lanthanum.megalonyx { var x: Lanthanum.megalonyx; () => { var y = this; }; return x; }
@ -10362,7 +10362,7 @@ module gabriellae {
>klossii : klossii<T0, T1>
>T0 : T0
>T1 : T1
>imperfecta : unknown
>imperfecta : typeof imperfecta
>lasiurus : imperfecta.lasiurus<T0, T1>
>dogramacii : unknown
>robustulus : dogramacii.robustulus
@ -10871,7 +10871,7 @@ module imperfecta {
>ciliolabrum : ciliolabrum<T0, T1>
>T0 : T0
>T1 : T1
>dogramacii : unknown
>dogramacii : typeof dogramacii
>robustulus : dogramacii.robustulus
leschenaultii(): argurus.dauricus<Lanthanum.jugularis, ruatanica.Praseodymium<argurus.germaini, caurinus.megaphyllus>> { var x: argurus.dauricus<Lanthanum.jugularis, ruatanica.Praseodymium<argurus.germaini, caurinus.megaphyllus>>; () => { var y = this; }; return x; }
@ -11034,7 +11034,7 @@ module petrophilus {
>sodyi : sodyi<T0, T1>
>T0 : T0
>T1 : T1
>quasiater : unknown
>quasiater : typeof quasiater
>bobrinskoi : quasiater.bobrinskoi
saundersiae(): samarensis.pallidus { var x: samarensis.pallidus; () => { var y = this; }; return x; }
@ -11167,7 +11167,7 @@ module caurinus {
export class megaphyllus extends imperfecta.lasiurus<julianae.acariensis, howi.coludo<argurus.oreas, howi.marcanoi>> {
>megaphyllus : megaphyllus
>imperfecta : unknown
>imperfecta : typeof imperfecta
>lasiurus : imperfecta.lasiurus<T0, T1>
>julianae : unknown
>acariensis : julianae.acariensis
@ -11600,7 +11600,7 @@ module lutreolus {
>cor : cor<T0, T1>
>T0 : T0
>T1 : T1
>panglima : unknown
>panglima : typeof panglima
>fundatus : panglima.fundatus<T0, T1>
>panamensis : unknown
>linulus : panamensis.linulus<T0, T1>
@ -11846,7 +11846,7 @@ module argurus {
export class germaini extends gabriellae.amicus {
>germaini : germaini
>gabriellae : unknown
>gabriellae : typeof gabriellae
>amicus : gabriellae.amicus
sharpei(): lavali.wilsoni { var x: lavali.wilsoni; () => { var y = this; }; return x; }
@ -12058,7 +12058,7 @@ module dammermani {
export class melanops extends minutus.inez<sagitta.stolzmanni, dammermani.melanops> {
>melanops : melanops
>minutus : unknown
>minutus : typeof minutus
>inez : minutus.inez<T0, T1>
>sagitta : unknown
>stolzmanni : sagitta.stolzmanni
@ -12307,7 +12307,7 @@ module argurus {
export class peninsulae extends patas.uralensis {
>peninsulae : peninsulae
>patas : unknown
>patas : typeof patas
>uralensis : patas.uralensis
aitkeni(): trivirgatus.mixtus<argurus.dauricus<dogramacii.aurata, dammermani.melanops>, panglima.amphibius<lavali.lepturus, quasiater.carolinensis>> { var x: trivirgatus.mixtus<argurus.dauricus<dogramacii.aurata, dammermani.melanops>, panglima.amphibius<lavali.lepturus, quasiater.carolinensis>>; () => { var y = this; }; return x; }
@ -12771,7 +12771,7 @@ module ruatanica {
>Praseodymium : Praseodymium<T0, T1>
>T0 : T0
>T1 : T1
>ruatanica : unknown
>ruatanica : typeof ruatanica
>hector : hector<T0, T1>
>lutreolus : unknown
>punicus : lutreolus.punicus
@ -13118,7 +13118,7 @@ module caurinus {
>johorensis : johorensis<T0, T1>
>T0 : T0
>T1 : T1
>lutreolus : unknown
>lutreolus : typeof lutreolus
>punicus : lutreolus.punicus
maini(): ruatanica.Praseodymium<lavali.thaeleri, julianae.acariensis> { var x: ruatanica.Praseodymium<lavali.thaeleri, julianae.acariensis>; () => { var y = this; }; return x; }
@ -13564,7 +13564,7 @@ module caurinus {
export class psilurus extends lutreolus.punicus {
>psilurus : psilurus
>lutreolus : unknown
>lutreolus : typeof lutreolus
>punicus : lutreolus.punicus
socialis(): panglima.amphibius<trivirgatus.falconeri, caurinus.psilurus> { var x: panglima.amphibius<trivirgatus.falconeri, caurinus.psilurus>; () => { var y = this; }; return x; }

View File

@ -1,13 +1,12 @@
tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(3,16): error TS2334: 'this' cannot be referenced in a static property initializer.
tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(22,15): error TS2332: 'this' cannot be referenced in current location.
tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(28,13): error TS2331: 'this' cannot be referenced in a module body.
tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(38,25): error TS1133: Type reference expected.
tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(38,30): error TS1005: ';' expected.
tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(38,25): error TS9002: Only type references are currently supported in a class 'extends' clauses.
tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(44,9): error TS2332: 'this' cannot be referenced in current location.
tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(45,9): error TS2332: 'this' cannot be referenced in current location.
==== tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts (7 errors) ====
==== tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts (6 errors) ====
//'this' in static member initializer
class ErrClass1 {
static t = this; // Error
@ -53,9 +52,7 @@ tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(45,9):
class ErrClass3 extends this {
~~~~
!!! error TS1133: Type reference expected.
~
!!! error TS1005: ';' expected.
!!! error TS9002: Only type references are currently supported in a class 'extends' clauses.
}

View File

@ -94,14 +94,13 @@ var M;
//'this' as a type argument
function genericFunc(x) { }
genericFunc < this > (undefined); // Should be an error
var ErrClass3 = (function () {
var ErrClass3 = (function (_super) {
__extends(ErrClass3, _super);
function ErrClass3() {
_super.apply(this, arguments);
}
return ErrClass3;
})();
this;
{
}
})(this);
//'this' as a computed enum value
var SomeEnum;
(function (SomeEnum) {

View File

@ -1,14 +1,13 @@
tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts(3,16): error TS2334: 'this' cannot be referenced in a static property initializer.
tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts(22,15): error TS2332: 'this' cannot be referenced in current location.
tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts(28,13): error TS2331: 'this' cannot be referenced in a module body.
tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts(38,25): error TS1133: Type reference expected.
tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts(38,30): error TS1005: ';' expected.
tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts(38,25): error TS9002: Only type references are currently supported in a class 'extends' clauses.
tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts(44,9): error TS2332: 'this' cannot be referenced in current location.
tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts(45,9): error TS2332: 'this' cannot be referenced in current location.
tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts(48,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided.
==== tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts (8 errors) ====
==== tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts (7 errors) ====
//'this' in static member initializer
class ErrClass1 {
static t = this; // Error
@ -54,9 +53,7 @@ tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalMod
class ErrClass3 extends this {
~~~~
!!! error TS1133: Type reference expected.
~
!!! error TS1005: ';' expected.
!!! error TS9002: Only type references are currently supported in a class 'extends' clauses.
}

View File

@ -94,14 +94,13 @@ var M;
//'this' as a type argument
function genericFunc(x) { }
genericFunc < this > (undefined); // Should be an error
var ErrClass3 = (function () {
var ErrClass3 = (function (_super) {
__extends(ErrClass3, _super);
function ErrClass3() {
_super.apply(this, arguments);
}
return ErrClass3;
})();
this;
{
}
})(this);
//'this' as a computed enum value
var SomeEnum;
(function (SomeEnum) {

View File

@ -17,9 +17,9 @@
////interface test3 extends IFoo./*3*/ {}
////interface test4 implements Foo./*4*/ {}
debugger;
goTo.marker("1");
verify.completionListIsEmpty();
verify.not.completionListIsEmpty();
goTo.marker("2");
verify.completionListIsEmpty();
@ -28,4 +28,4 @@ goTo.marker("3");
verify.completionListIsEmpty();
goTo.marker("4");
verify.completionListIsEmpty();
verify.not.completionListIsEmpty();

View File

@ -15,11 +15,11 @@
////}
////
////(new C()).[|abc|];
test.ranges().forEach(r => {
goTo.position(r.start);
test.ranges().forEach(range => {
debugger;
verify.occurrencesAtPositionContains(range);
});
verify.occurrencesAtPositionCount(test.ranges().length);

View File

@ -7,6 +7,7 @@
//// interface /*2*/X extends /*3*/M./*4*/I { }
var c = classification;
debugger;
verify.semanticClassificationsAre(
c.moduleName("M", test.marker("0").position),
c.interfaceName("I", test.marker("1").position),