Create type aliases for unresolved type symbols (#45976)

* Create type aliases for unresolved type symbols

* Accept new baselines

* Update fourslash tests

* Unresolved import aliases create tagged unresolved symbols

* Add comments

* Accept new baselines

* Add fourslash tests
This commit is contained in:
Anders Hejlsberg 2021-09-23 13:21:27 -07:00 committed by GitHub
parent 039672332f
commit a4f9bf0fce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
443 changed files with 10961 additions and 6377 deletions

View File

@ -748,11 +748,14 @@ namespace ts {
const unknownSymbol = createSymbol(SymbolFlags.Property, "unknown" as __String);
const resolvingSymbol = createSymbol(0, InternalSymbolName.Resolving);
const unresolvedSymbols = new Map<string, TransientSymbol>();
const errorTypes = new Map<string, Type>();
const anyType = createIntrinsicType(TypeFlags.Any, "any");
const autoType = createIntrinsicType(TypeFlags.Any, "any");
const wildcardType = createIntrinsicType(TypeFlags.Any, "any");
const errorType = createIntrinsicType(TypeFlags.Any, "error");
const unresolvedType = createIntrinsicType(TypeFlags.Any, "unresolved");
const nonInferrableAnyType = createIntrinsicType(TypeFlags.Any, "any", ObjectFlags.ContainsWideningType);
const intrinsicMarkerType = createIntrinsicType(TypeFlags.Any, "intrinsic");
const unknownType = createIntrinsicType(TypeFlags.Unknown, "unknown");
@ -4521,7 +4524,9 @@ namespace ts {
const noTruncation = compilerOptions.noErrorTruncation || flags & TypeFormatFlags.NoTruncation;
const typeNode = nodeBuilder.typeToTypeNode(type, enclosingDeclaration, toNodeBuilderFlags(flags) | NodeBuilderFlags.IgnoreErrors | (noTruncation ? NodeBuilderFlags.NoTruncation : 0), writer);
if (typeNode === undefined) return Debug.fail("should always get typenode");
const options = { removeComments: true };
// The unresolved type gets a synthesized comment on `any` to hint to users that it's not a plain `any`.
// Otherwise, we always strip comments out.
const options = { removeComments: type !== unresolvedType };
const printer = createPrinter(options);
const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
printer.writeNode(EmitHint.Unspecified, typeNode, /*sourceFile*/ sourceFile, writer);
@ -4671,6 +4676,12 @@ namespace ts {
}
if (type.flags & TypeFlags.Any) {
if (type.aliasSymbol) {
return factory.createTypeReferenceNode(symbolToEntityNameNode(type.aliasSymbol), mapToTypeNodes(type.aliasTypeArguments, context));
}
if (type === unresolvedType) {
return addSyntheticLeadingComment(factory.createKeywordTypeNode(SyntaxKind.AnyKeyword), SyntaxKind.MultiLineCommentTrivia, "unresolved");
}
context.approximateLength += 3;
return factory.createKeywordTypeNode(type === intrinsicMarkerType ? SyntaxKind.IntrinsicKeyword : SyntaxKind.AnyKeyword);
}
@ -5856,6 +5867,11 @@ namespace ts {
return specifier;
}
function symbolToEntityNameNode(symbol: Symbol): EntityName {
const identifier = factory.createIdentifier(unescapeLeadingUnderscores(symbol.escapedName));
return symbol.parent ? factory.createQualifiedName(symbolToEntityNameNode(symbol.parent), identifier) : identifier;
}
function symbolToTypeNode(symbol: Symbol, context: NodeBuilderContext, meaning: SymbolFlags, overrideTypeArguments?: readonly TypeNode[]): TypeNode {
const chain = lookupSymbolChain(symbol, context, meaning, !(context.flags & NodeBuilderFlags.UseAliasDefinedOutsideCurrentScope)); // If we're using aliases outside the current scope, dont bother with the module
@ -6175,7 +6191,7 @@ namespace ts {
* so a `unique symbol` is returned when appropriate for the input symbol, rather than `typeof sym`
*/
function serializeTypeForDeclaration(context: NodeBuilderContext, type: Type, symbol: Symbol, enclosingDeclaration: Node | undefined, includePrivateSymbol?: (s: Symbol) => void, bundled?: boolean) {
if (type !== errorType && enclosingDeclaration) {
if (!isErrorType(type) && enclosingDeclaration) {
const declWithExistingAnnotation = getDeclarationWithTypeAnnotation(symbol, enclosingDeclaration);
if (declWithExistingAnnotation && !isFunctionLikeDeclaration(declWithExistingAnnotation) && !isGetAccessorDeclaration(declWithExistingAnnotation)) {
// try to reuse the existing annotation
@ -6199,7 +6215,7 @@ namespace ts {
}
function serializeReturnTypeForSignature(context: NodeBuilderContext, type: Type, signature: Signature, includePrivateSymbol?: (s: Symbol) => void, bundled?: boolean) {
if (type !== errorType && context.enclosingDeclaration) {
if (!isErrorType(type) && context.enclosingDeclaration) {
const annotation = signature.declaration && getEffectiveReturnTypeNode(signature.declaration);
if (!!findAncestor(annotation, n => n === context.enclosingDeclaration) && annotation) {
const annotated = getTypeFromTypeNode(annotation);
@ -6339,7 +6355,7 @@ namespace ts {
);
}
}
if (isTypeReferenceNode(node) && isInJSDoc(node) && (!existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(node, getTypeFromTypeNode(node)) || getIntendedTypeFromJSDocTypeReference(node) || unknownSymbol === resolveTypeReferenceName(getTypeReferenceName(node), SymbolFlags.Type, /*ignoreErrors*/ true))) {
if (isTypeReferenceNode(node) && isInJSDoc(node) && (!existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(node, getTypeFromTypeNode(node)) || getIntendedTypeFromJSDocTypeReference(node) || unknownSymbol === resolveTypeReferenceName(node, SymbolFlags.Type, /*ignoreErrors*/ true))) {
return setOriginalNode(typeToTypeNodeHelper(getTypeFromTypeNode(node), context), node);
}
if (isLiteralImportTypeNode(node)) {
@ -8261,6 +8277,12 @@ namespace ts {
return type && (type.flags & TypeFlags.Any) !== 0;
}
function isErrorType(type: Type) {
// The only 'any' types that have alias symbols are those manufactured by getTypeFromTypeAliasReference for
// a reference to an unresolved symbol. We want those to behave like the errorType.
return type === errorType || !!(type.flags & TypeFlags.Any && type.aliasSymbol);
}
// Return the type of a binding element parent. We check SymbolLinks first to see if a type has been
// assigned by contextual typing.
function getTypeForBindingElementParent(node: BindingElementGrandparent) {
@ -8806,7 +8828,7 @@ namespace ts {
if (!declaredType) {
return type;
}
else if (declaredType !== errorType && type !== errorType && !isTypeIdenticalTo(declaredType, type)) {
else if (!isErrorType(declaredType) && !isErrorType(type) && !isTypeIdenticalTo(declaredType, type)) {
errorNextVariableOrPropertyDeclarationMustHaveSameType(/*firstDeclaration*/ undefined, declaredType, declaration, type);
}
}
@ -9767,7 +9789,7 @@ namespace ts {
if (!implementsTypeNodes) continue;
for (const node of implementsTypeNodes) {
const implementsType = getTypeFromTypeNode(node);
if (implementsType !== errorType) {
if (!isErrorType(implementsType)) {
if (resolvedImplementsTypes === emptyArray) {
resolvedImplementsTypes = [implementsType as ObjectType];
}
@ -9851,7 +9873,7 @@ namespace ts {
baseType = getReturnTypeOfSignature(constructors[0]);
}
if (baseType === errorType) {
if (isErrorType(baseType)) {
return type.resolvedBaseTypes = emptyArray;
}
const reducedBaseType = getReducedType(baseType);
@ -9909,7 +9931,7 @@ namespace ts {
if (declaration.kind === SyntaxKind.InterfaceDeclaration && getInterfaceBaseTypeNodes(declaration as InterfaceDeclaration)) {
for (const node of getInterfaceBaseTypeNodes(declaration as InterfaceDeclaration)!) {
const baseType = getReducedType(getTypeFromTypeNode(node));
if (baseType !== errorType) {
if (!isErrorType(baseType)) {
if (isValidBaseType(baseType)) {
if (type !== baseType && !hasBaseType(baseType, type)) {
if (type.resolvedBaseTypes === emptyArray) {
@ -11861,7 +11883,7 @@ namespace ts {
let mergedInstantiations = false;
for (const current of containingType.types) {
const type = getApparentType(current);
if (!(type === errorType || type.flags & TypeFlags.Never)) {
if (!(isErrorType(type) || type.flags & TypeFlags.Never)) {
const prop = getPropertyOfType(type, name, skipObjectFunctionPropertyAugment);
const modifiers = prop ? getDeclarationModifierFlagsFromSymbol(prop) : 0;
if (prop) {
@ -12898,7 +12920,7 @@ namespace ts {
}
else {
let type = getTypeFromTypeNode(constraintDeclaration);
if (type.flags & TypeFlags.Any && type !== errorType) { // Allow errorType to propegate to keep downstream errors suppressed
if (type.flags & TypeFlags.Any && !isErrorType(type)) { // Allow errorType to propegate to keep downstream errors suppressed
// use keyofConstraintType as the base constraint for mapped type key constraints (unknown isn;t assignable to that, but `any` was),
// use unknown otherwise
type = constraintDeclaration.parent.parent.kind === SyntaxKind.MappedType ? keyofConstraintType : unknownType;
@ -13088,6 +13110,18 @@ namespace ts {
* declared type. Instantiations are cached using the type identities of the type arguments as the key.
*/
function getTypeFromTypeAliasReference(node: NodeWithTypeArguments, symbol: Symbol): Type {
if (getCheckFlags(symbol) & CheckFlags.Unresolved) {
const typeArguments = typeArgumentsFromTypeReferenceNode(node);
const id = getAliasId(symbol, typeArguments);
let errorType = errorTypes.get(id);
if (!errorType) {
errorType = createIntrinsicType(TypeFlags.Any, "error");
errorType.aliasSymbol = symbol;
errorType.aliasTypeArguments = typeArguments;
errorTypes.set(id, errorType);
}
return errorType;
}
const type = getDeclaredTypeOfSymbol(symbol);
const typeParameters = getSymbolLinks(symbol).typeParameters;
if (typeParameters) {
@ -13136,12 +13170,39 @@ namespace ts {
return undefined;
}
function resolveTypeReferenceName(typeReferenceName: EntityNameExpression | EntityName | undefined, meaning: SymbolFlags, ignoreErrors?: boolean) {
if (!typeReferenceName) {
function getSymbolPath(symbol: Symbol): string {
return symbol.parent ? `${getSymbolPath(symbol.parent)}.${symbol.escapedName}` : symbol.escapedName as string;
}
function getUnresolvedSymbolForEntityName(name: EntityNameOrEntityNameExpression) {
const identifier = name.kind === SyntaxKind.QualifiedName ? name.right :
name.kind === SyntaxKind.PropertyAccessExpression ? name.name :
name;
const text = identifier.escapedText;
if (text) {
const parentSymbol = name.kind === SyntaxKind.QualifiedName ? getUnresolvedSymbolForEntityName(name.left) :
name.kind === SyntaxKind.PropertyAccessExpression ? getUnresolvedSymbolForEntityName(name.expression) :
undefined;
const path = parentSymbol ? `${getSymbolPath(parentSymbol)}.${text}` : text as string;
let result = unresolvedSymbols.get(path);
if (!result) {
unresolvedSymbols.set(path, result = createSymbol(SymbolFlags.TypeAlias, text, CheckFlags.Unresolved));
result.parent = parentSymbol;
result.declaredType = unresolvedType;
}
return result;
}
return unknownSymbol;
}
function resolveTypeReferenceName(typeReference: TypeReferenceType, meaning: SymbolFlags, ignoreErrors?: boolean) {
const name = getTypeReferenceName(typeReference);
if (!name) {
return unknownSymbol;
}
return resolveEntityName(typeReferenceName, meaning, ignoreErrors) || unknownSymbol;
const symbol = resolveEntityName(name, meaning, ignoreErrors);
return symbol && symbol !== unknownSymbol ? symbol :
ignoreErrors ? unknownSymbol : getUnresolvedSymbolForEntityName(name);
}
function getTypeReferenceType(node: NodeWithTypeArguments, symbol: Symbol): Type {
@ -13167,7 +13228,7 @@ namespace ts {
}
else {
// Resolve the type reference as a Type for the purpose of reporting errors.
resolveTypeReferenceName(getTypeReferenceName(node), SymbolFlags.Type);
resolveTypeReferenceName(node, SymbolFlags.Type);
return getTypeOfSymbol(symbol);
}
}
@ -13321,18 +13382,18 @@ namespace ts {
if (isJSDocTypeReference(node)) {
type = getIntendedTypeFromJSDocTypeReference(node);
if (!type) {
symbol = resolveTypeReferenceName(getTypeReferenceName(node), meaning, /*ignoreErrors*/ true);
symbol = resolveTypeReferenceName(node, meaning, /*ignoreErrors*/ true);
if (symbol === unknownSymbol) {
symbol = resolveTypeReferenceName(getTypeReferenceName(node), meaning | SymbolFlags.Value);
symbol = resolveTypeReferenceName(node, meaning | SymbolFlags.Value);
}
else {
resolveTypeReferenceName(getTypeReferenceName(node), meaning); // Resolve again to mark errors, if any
resolveTypeReferenceName(node, meaning); // Resolve again to mark errors, if any
}
type = getTypeReferenceType(node, symbol);
}
}
if (!type) {
symbol = resolveTypeReferenceName(getTypeReferenceName(node), meaning);
symbol = resolveTypeReferenceName(node, meaning);
type = getTypeReferenceType(node, symbol);
}
// Cache both the resolved symbol and the resolved type. The resolved symbol is needed when we check the
@ -13646,7 +13707,7 @@ namespace ts {
function mayResolveTypeAlias(node: Node): boolean {
switch (node.kind) {
case SyntaxKind.TypeReference:
return isJSDocTypeReference(node) || !!(resolveTypeReferenceName((node as TypeReferenceNode).typeName, SymbolFlags.Type).flags & SymbolFlags.TypeAlias);
return isJSDocTypeReference(node) || !!(resolveTypeReferenceName(node as TypeReferenceNode, SymbolFlags.Type).flags & SymbolFlags.TypeAlias);
case SyntaxKind.TypeQuery:
return true;
case SyntaxKind.TypeOperator:
@ -16330,7 +16391,7 @@ namespace ts {
const mappedTypeVariable = instantiateType(typeVariable, mapper);
if (typeVariable !== mappedTypeVariable) {
return mapTypeWithAlias(getReducedType(mappedTypeVariable), t => {
if (t.flags & (TypeFlags.AnyOrUnknown | TypeFlags.InstantiableNonPrimitive | TypeFlags.Object | TypeFlags.Intersection) && t !== wildcardType && t !== errorType) {
if (t.flags & (TypeFlags.AnyOrUnknown | TypeFlags.InstantiableNonPrimitive | TypeFlags.Object | TypeFlags.Intersection) && t !== wildcardType && !isErrorType(t)) {
if (!type.declaration.nameType) {
if (isArrayType(t)) {
return instantiateMappedArrayType(t, type, prependTypeMapping(typeVariable, t, mapper));
@ -16375,7 +16436,7 @@ namespace ts {
function instantiateMappedArrayType(arrayType: Type, mappedType: MappedType, mapper: TypeMapper) {
const elementType = instantiateMappedTypeTemplate(mappedType, numberType, /*isOptional*/ true, mapper);
return elementType === errorType ? errorType :
return isErrorType(elementType) ? errorType :
createArrayType(elementType, getModifiedReadonlyState(isReadonlyArrayType(arrayType), getMappedTypeModifiers(mappedType)));
}
@ -18095,7 +18156,7 @@ namespace ts {
const targetTypes = (target as IntersectionType).types;
const intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes, errorNode);
const intrinsicClassAttributes = getJsxType(JsxNames.IntrinsicClassAttributes, errorNode);
if (intrinsicAttributes !== errorType && intrinsicClassAttributes !== errorType &&
if (!isErrorType(intrinsicAttributes) && !isErrorType(intrinsicClassAttributes) &&
(contains(targetTypes, intrinsicAttributes) || contains(targetTypes, intrinsicClassAttributes))) {
// do not report top error
return result;
@ -26097,7 +26158,7 @@ namespace ts {
let propsType = getTypeOfFirstParameterOfSignatureWithFallback(sig, unknownType);
propsType = getJsxManagedAttributesFromLocatedAttributes(context, getJsxNamespaceAt(context), propsType);
const intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes, context);
if (intrinsicAttribs !== errorType) {
if (!isErrorType(intrinsicAttribs)) {
propsType = intersectTypes(intrinsicAttribs, propsType);
}
return propsType;
@ -26196,7 +26257,7 @@ namespace ts {
// Normal case -- add in IntrinsicClassElements<T> and IntrinsicElements
let apparentAttributesType = attributesType;
const intrinsicClassAttribs = getJsxType(JsxNames.IntrinsicClassAttributes, context);
if (intrinsicClassAttribs !== errorType) {
if (!isErrorType(intrinsicClassAttribs)) {
const typeParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(intrinsicClassAttribs.symbol);
const hostClassType = getReturnTypeOfSignature(sig);
apparentAttributesType = intersectTypes(
@ -26208,7 +26269,7 @@ namespace ts {
}
const intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes, context);
if (intrinsicAttribs !== errorType) {
if (!isErrorType(intrinsicAttribs)) {
apparentAttributesType = intersectTypes(intrinsicAttribs, apparentAttributesType);
}
@ -26719,7 +26780,7 @@ namespace ts {
checkSpreadPropOverrides(mergedType, allPropertiesTable, memberDecl);
}
offset = propertiesArray.length;
if (spread === errorType) {
if (isErrorType(spread)) {
continue;
}
spread = getSpreadType(spread, mergedType, node.symbol, objectFlags, inConstContext);
@ -26779,7 +26840,7 @@ namespace ts {
}
}
if (spread === errorType) {
if (isErrorType(spread)) {
return errorType;
}
@ -27073,7 +27134,7 @@ namespace ts {
const links = getNodeLinks(node);
if (!links.resolvedSymbol) {
const intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements, node);
if (intrinsicElementsType !== errorType) {
if (!isErrorType(intrinsicElementsType)) {
// Property case
if (!isIdentifier(node.tagName)) return Debug.fail();
const intrinsicProp = getPropertyOfType(intrinsicElementsType, node.tagName.escapedText);
@ -27247,7 +27308,7 @@ namespace ts {
// var CustomTag: "h1" = "h1";
// <CustomTag> Hello World </CustomTag>
const intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements, location);
if (intrinsicElementsType !== errorType) {
if (!isErrorType(intrinsicElementsType)) {
const stringLiteralTypeName = type.value;
const intrinsicProp = getPropertyOfType(intrinsicElementsType, escapeLeadingUnderscores(stringLiteralTypeName));
if (intrinsicProp) {
@ -27319,7 +27380,7 @@ namespace ts {
function getJsxElementClassTypeAt(location: Node): Type | undefined {
const type = getJsxType(JsxNames.ElementClass, location);
if (type === errorType) return undefined;
if (isErrorType(type)) return undefined;
return type;
}
@ -27688,7 +27749,7 @@ namespace ts {
function checkNonNullNonVoidType(type: Type, node: Node): Type {
const nonNullType = checkNonNullType(type, node);
if (nonNullType !== errorType && nonNullType.flags & TypeFlags.Void) {
if (nonNullType.flags & TypeFlags.Void) {
error(node, Diagnostics.Object_is_possibly_undefined);
}
return nonNullType;
@ -27845,7 +27906,7 @@ namespace ts {
if (isAnyLike) {
if (lexicallyScopedSymbol) {
return apparentType;
return isErrorType(apparentType) ? errorType : apparentType;
}
if (!getContainingClass(right)) {
grammarErrorOnNode(right, Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies);
@ -27869,7 +27930,7 @@ namespace ts {
if (isIdentifier(left) && parentSymbol) {
markAliasReferenced(parentSymbol, node);
}
return apparentType;
return isErrorType(apparentType) ? errorType : apparentType;;
}
prop = getPropertyOfType(apparentType, right.escapedText);
}
@ -28375,7 +28436,7 @@ namespace ts {
type: Type): boolean {
// Short-circuiting for improved performance.
if (type === errorType || isTypeAny(type)) {
if (isTypeAny(type)) {
return true;
}
@ -28401,7 +28462,7 @@ namespace ts {
property: Symbol): boolean {
// Short-circuiting for improved performance.
if (containingType === errorType || isTypeAny(containingType)) {
if (isTypeAny(containingType)) {
return true;
}
@ -28481,7 +28542,7 @@ namespace ts {
const indexExpression = node.argumentExpression;
const indexType = checkExpression(indexExpression);
if (objectType === errorType || objectType === silentNeverType) {
if (isErrorType(objectType) || objectType === silentNeverType) {
return objectType;
}
@ -29784,7 +29845,7 @@ namespace ts {
}
return anySignature;
}
if (superType !== errorType) {
if (!isErrorType(superType)) {
// In super call, the candidate signatures are the matching arity signatures of the base constructor function instantiated
// with the type arguments specified in the extends clause.
const baseTypeNode = getEffectiveBaseTypeNode(getContainingClass(node)!);
@ -29820,7 +29881,7 @@ namespace ts {
}
const apparentType = getApparentType(funcType);
if (apparentType === errorType) {
if (isErrorType(apparentType)) {
// Another error has already been reported
return resolveErrorCall(node);
}
@ -29838,7 +29899,7 @@ namespace ts {
if (isUntypedFunctionCall(funcType, apparentType, callSignatures.length, numConstructSignatures)) {
// The unknownType indicates that an error already occurred (and was reported). No
// need to report another error in this case.
if (funcType !== errorType && node.typeArguments) {
if (!isErrorType(funcType) && node.typeArguments) {
error(node, Diagnostics.Untyped_function_calls_may_not_accept_type_arguments);
}
return resolveUntypedCall(node);
@ -29921,7 +29982,7 @@ namespace ts {
// signatures for overload resolution. The result type of the function call becomes
// the result type of the operation.
expressionType = getApparentType(expressionType);
if (expressionType === errorType) {
if (isErrorType(expressionType)) {
// Another error has already been reported
return resolveErrorCall(node);
}
@ -30174,7 +30235,7 @@ namespace ts {
const tagType = checkExpression(node.tag);
const apparentType = getApparentType(tagType);
if (apparentType === errorType) {
if (isErrorType(apparentType)) {
// Another error has already been reported
return resolveErrorCall(node);
}
@ -30231,7 +30292,7 @@ namespace ts {
function resolveDecorator(node: Decorator, candidatesOutArray: Signature[] | undefined, checkMode: CheckMode): Signature {
const funcType = checkExpression(node.expression);
const apparentType = getApparentType(funcType);
if (apparentType === errorType) {
if (isErrorType(apparentType)) {
return resolveErrorCall(node);
}
@ -30301,7 +30362,7 @@ namespace ts {
}
const exprTypes = checkExpression(node.tagName);
const apparentType = getApparentType(exprTypes);
if (apparentType === errorType) {
if (isErrorType(apparentType)) {
return resolveErrorCall(node);
}
@ -30652,7 +30713,7 @@ namespace ts {
}
function getTypeWithSyntheticDefaultImportType(type: Type, symbol: Symbol, originalSymbol: Symbol): Type {
if (allowSyntheticDefaultImports && type && type !== errorType) {
if (allowSyntheticDefaultImports && type && !isErrorType(type)) {
const synthType = type as SyntheticDefaultModuleType;
if (!synthType.syntheticType) {
const file = originalSymbol.declarations?.find(isSourceFile);
@ -30763,7 +30824,7 @@ namespace ts {
checkSourceElement(type);
exprType = getRegularTypeOfObjectLiteral(getBaseTypeOfLiteralType(exprType));
const targetType = getTypeFromTypeNode(type);
if (produceDiagnostics && targetType !== errorType) {
if (produceDiagnostics && !isErrorType(targetType)) {
const widenedType = getWidenedType(exprType);
if (!isTypeComparableTo(targetType, widenedType)) {
checkTypeComparableTo(exprType, targetType, errNode,
@ -30804,7 +30865,7 @@ namespace ts {
return getGlobalImportMetaExpressionType();
case SyntaxKind.NewKeyword:
const type = checkNewTargetMetaProperty(node);
return type === errorType ? errorType : createNewTargetExpressionType(type);
return isErrorType(type) ? errorType : createNewTargetExpressionType(type);
default:
Debug.assertNever(node.keywordToken);
}
@ -31881,7 +31942,7 @@ namespace ts {
const operandType = checkExpression(node.expression);
const awaitedType = checkAwaitedType(operandType, /*withAlias*/ true, node, Diagnostics.Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member);
if (awaitedType === operandType && awaitedType !== errorType && !(operandType.flags & TypeFlags.AnyOrUnknown)) {
if (awaitedType === operandType && !isErrorType(awaitedType) && !(operandType.flags & TypeFlags.AnyOrUnknown)) {
addErrorOrSuggestion(/*isError*/ false, createDiagnosticForNode(node, Diagnostics.await_has_no_effect_on_the_type_of_this_expression));
}
return awaitedType;
@ -32604,7 +32665,7 @@ namespace ts {
else if (isTypeAny(leftType) || isTypeAny(rightType)) {
// Otherwise, the result is of type Any.
// NOTE: unknown type here denotes error type. Old compiler treated this case as any type so do we.
resultType = leftType === errorType || rightType === errorType ? errorType : anyType;
resultType = isErrorType(leftType) || isErrorType(rightType) ? errorType : anyType;
}
// Symbols are not allowed at all in arithmetic expressions
@ -34221,7 +34282,7 @@ namespace ts {
function getTypeParametersForTypeReference(node: TypeReferenceNode | ExpressionWithTypeArguments) {
const type = getTypeFromTypeReference(node);
if (type !== errorType) {
if (!isErrorType(type)) {
const symbol = getNodeLinks(node).resolvedSymbol;
if (symbol) {
return symbol.flags & SymbolFlags.TypeAlias && getSymbolLinks(symbol).typeParameters ||
@ -34238,7 +34299,7 @@ namespace ts {
}
forEach(node.typeArguments, checkSourceElement);
const type = getTypeFromTypeReference(node);
if (type !== errorType) {
if (!isErrorType(type)) {
if (node.typeArguments && produceDiagnostics) {
const typeParameters = getTypeParametersForTypeReference(node);
if (typeParameters) {
@ -35164,7 +35225,7 @@ namespace ts {
const returnType = getTypeFromTypeNode(returnTypeNode);
if (languageVersion >= ScriptTarget.ES2015) {
if (returnType === errorType) {
if (isErrorType(returnType)) {
return;
}
const globalPromiseType = getGlobalPromiseType(/*reportErrors*/ true);
@ -35179,7 +35240,7 @@ namespace ts {
// Always mark the type node as referenced if it points to a value
markTypeNodeAsReferenced(returnTypeNode);
if (returnType === errorType) {
if (isErrorType(returnType)) {
return;
}
@ -35191,7 +35252,7 @@ namespace ts {
const promiseConstructorSymbol = resolveEntityName(promiseConstructorName, SymbolFlags.Value, /*ignoreErrors*/ true);
const promiseConstructorType = promiseConstructorSymbol ? getTypeOfSymbol(promiseConstructorSymbol) : errorType;
if (promiseConstructorType === errorType) {
if (isErrorType(promiseConstructorType)) {
if (promiseConstructorName.kind === SyntaxKind.Identifier && promiseConstructorName.escapedText === "Promise" && getTargetType(returnType) === getGlobalPromiseType(/*reportErrors*/ false)) {
error(returnTypeNode, Diagnostics.An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option);
}
@ -36364,7 +36425,7 @@ namespace ts {
// initializer is consistent with type associated with the node
const declarationType = convertAutoToAny(getWidenedTypeForVariableLikeDeclaration(node));
if (type !== errorType && declarationType !== errorType &&
if (!isErrorType(type) && !isErrorType(declarationType) &&
!isTypeIdenticalTo(type, declarationType) &&
!(symbol.flags & SymbolFlags.Assignment)) {
errorNextVariableOrPropertyDeclarationMustHaveSameType(symbol.valueDeclaration, type, node, declarationType);
@ -38035,7 +38096,7 @@ namespace ts {
checkTypeReferenceNode(typeRefNode);
if (produceDiagnostics) {
const t = getReducedType(getTypeFromTypeNode(typeRefNode));
if (t !== errorType) {
if (!isErrorType(t)) {
if (isValidBaseType(t)) {
const genericDiag = t.symbol && t.symbol.flags & SymbolFlags.Class ?
Diagnostics.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass :
@ -40258,7 +40319,8 @@ namespace ts {
}
else if (isTypeReferenceIdentifier(name as EntityName)) {
const meaning = name.parent.kind === SyntaxKind.TypeReference ? SymbolFlags.Type : SymbolFlags.Namespace;
return resolveEntityName(name as EntityName, meaning, /*ignoreErrors*/ false, /*dontResolveAlias*/ true);
const symbol = resolveEntityName(name as EntityName, meaning, /*ignoreErrors*/ false, /*dontResolveAlias*/ true);
return symbol && symbol !== unknownSymbol ? symbol : getUnresolvedSymbolForEntityName(name as EntityName);
}
if (name.parent.kind === SyntaxKind.TypePredicate) {
return resolveEntityName(name as Identifier, /*meaning*/ SymbolFlags.FunctionScopedVariable);
@ -40518,7 +40580,7 @@ namespace ts {
const symbol = getSymbolAtLocation(node);
if (symbol) {
const declaredType = getDeclaredTypeOfSymbol(symbol);
return declaredType !== errorType ? declaredType : getTypeOfSymbol(symbol);
return !isErrorType(declaredType) ? declaredType : getTypeOfSymbol(symbol);
}
}
@ -41062,7 +41124,7 @@ namespace ts {
return isTypeOnly ? TypeReferenceSerializationKind.ObjectType : TypeReferenceSerializationKind.Unknown;
}
const type = getDeclaredTypeOfSymbol(typeSymbol);
if (type === errorType) {
if (isErrorType(type)) {
return isTypeOnly ? TypeReferenceSerializationKind.ObjectType : TypeReferenceSerializationKind.Unknown;
}
else if (type.flags & TypeFlags.AnyOrUnknown) {

View File

@ -4957,6 +4957,7 @@ namespace ts {
HasNeverType = 1 << 17, // Synthetic property with at least one never type in constituents
Mapped = 1 << 18, // Property of mapped type
StripOptional = 1 << 19, // Strip optionality in mapped property
Unresolved = 1 << 20, // Unresolved type alias symbol
Synthetic = SyntheticProperty | SyntheticMethod,
Discriminant = HasNonUniformType | HasLiteralType,
Partial = ReadPartial | WritePartial

View File

@ -2,5 +2,6 @@
var v = (a: ) => {
>v : Symbol(v, Decl(ArrowFunction1.ts, 0, 3))
>a : Symbol(a, Decl(ArrowFunction1.ts, 0, 9))
> : Symbol(unknown)
};

View File

@ -19,6 +19,7 @@ module clodule1 {
function f(x: T) { }
>f : Symbol(f, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 8, 17))
>x : Symbol(x, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 9, 15))
>T : Symbol(T)
}
class clodule2<T>{
@ -38,10 +39,12 @@ module clodule2 {
var x: T;
>x : Symbol(x, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 19, 7))
>T : Symbol(T)
class D<U extends T>{
>D : Symbol(D, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 19, 13))
>U : Symbol(U, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 21, 12))
>T : Symbol(T)
id: string;
>id : Symbol(D.id, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 21, 25))
@ -92,6 +95,7 @@ module clodule4 {
name: T;
>name : Symbol(D.name, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 44, 13))
>T : Symbol(T)
}
}

View File

@ -15,8 +15,8 @@ module clodule1 {
>clodule1 : typeof clodule1
function f(x: T) { }
>f : (x: any) => void
>x : any
>f : (x: T) => void
>x : T
}
class clodule2<T>{
@ -33,7 +33,7 @@ module clodule2 {
>clodule2 : typeof clodule2
var x: T;
>x : any
>x : T
class D<U extends T>{
>D : D<U>
@ -83,7 +83,7 @@ module clodule4 {
>D : D
name: T;
>name : any
>name : T
}
}

View File

@ -5,5 +5,6 @@ function * foo() {
// Legal to use 'yield' in a type context.
var v: yield;
>v : Symbol(v, Decl(FunctionDeclaration13_es6.ts, 2, 6))
>yield : Symbol(yield)
}

View File

@ -4,6 +4,6 @@ function * foo() {
// Legal to use 'yield' in a type context.
var v: yield;
>v : any
>v : yield
}

View File

@ -2,4 +2,5 @@
function A(): (public B) => C {
>A : Symbol(A, Decl(ParameterList5.ts, 0, 0))
>B : Symbol(B, Decl(ParameterList5.ts, 0, 15))
>C : Symbol(C)
}

View File

@ -1,5 +1,5 @@
=== tests/cases/compiler/ParameterList5.ts ===
function A(): (public B) => C {
>A : () => (B: any) => any
>A : () => (B: any) => C
>B : any
}

View File

@ -1,4 +1,5 @@
=== tests/cases/conformance/parser/ecmascript5/TupleTypes/TupleType6.ts ===
var v: [number,,]
>v : Symbol(v, Decl(TupleType6.ts, 0, 3))
> : Symbol(unknown)

View File

@ -48,6 +48,7 @@ export module A {
// collision with 'Origin' var in other part of merged module
export var Origin: Point = { x: 0, y: 0 };
>Origin : Symbol(Origin, Decl(part2.ts, 2, 14))
>Point : Symbol(Point)
>x : Symbol(x, Decl(part2.ts, 2, 32))
>y : Symbol(y, Decl(part2.ts, 2, 38))
@ -59,7 +60,9 @@ export module A {
constructor(public tl: Point, public br: Point) { }
>tl : Symbol(Plane.tl, Decl(part2.ts, 6, 24))
>Point : Symbol(Point)
>br : Symbol(Plane.br, Decl(part2.ts, 6, 41))
>Point : Symbol(Point)
}
}
}

View File

@ -45,7 +45,7 @@ export module A {
// collision with 'Origin' var in other part of merged module
export var Origin: Point = { x: 0, y: 0 };
>Origin : any
>Origin : Point
>{ x: 0, y: 0 } : { x: number; y: number; }
>x : number
>0 : 0
@ -59,8 +59,8 @@ export module A {
>Plane : Plane
constructor(public tl: Point, public br: Point) { }
>tl : any
>br : any
>tl : Point
>br : Point
}
}
}

View File

@ -5,4 +5,5 @@ export class Q {
set bet(arg: DoesNotExist) {}
>bet : Symbol(Q.bet, Decl(accessorDeclarationEmitVisibilityErrors.ts, 0, 16))
>arg : Symbol(arg, Decl(accessorDeclarationEmitVisibilityErrors.ts, 1, 12))
>DoesNotExist : Symbol(DoesNotExist)
}

View File

@ -3,6 +3,6 @@ export class Q {
>Q : Q
set bet(arg: DoesNotExist) {}
>bet : any
>arg : any
>bet : DoesNotExist
>arg : DoesNotExist
}

View File

@ -44,6 +44,7 @@ function use() {
var p3:booz.bar;
>p3 : Symbol(p3, Decl(aliasBug.ts, 15, 5))
>booz : Symbol(booz, Decl(aliasBug.ts, 7, 21))
>bar : Symbol(booz.bar)
var p22 = new provide.Provide();
>p22 : Symbol(p22, Decl(aliasBug.ts, 16, 5))

View File

@ -41,7 +41,7 @@ function use() {
>foo : any
var p3:booz.bar;
>p3 : any
>p3 : booz.bar
>booz : any
var p22 = new provide.Provide();

View File

@ -74,6 +74,7 @@ function use() {
var p3:booz.bar;
>p3 : Symbol(p3, Decl(aliasErrors.ts, 25, 5))
>booz : Symbol(booz, Decl(aliasErrors.ts, 6, 21))
>bar : Symbol(booz.bar)
var p22 = new provide.Provide();
>p22 : Symbol(p22, Decl(aliasErrors.ts, 26, 5))

View File

@ -81,7 +81,7 @@ function use() {
>foo : any
var p3:booz.bar;
>p3 : any
>p3 : booz.bar
>booz : any
var p22 = new provide.Provide();

View File

@ -47,5 +47,6 @@ originalZZZ;
const y: originalZZZ = x;
>y : Symbol(y, Decl(index.ts, 8, 5))
>originalZZZ : Symbol(originalZZZ)
>x : Symbol(x, Decl(index.ts, 2, 5))

View File

@ -48,6 +48,6 @@ originalZZZ;
>originalZZZ : 123
const y: originalZZZ = x;
>y : any
>y : originalZZZ
>x : zzz

View File

@ -17,7 +17,7 @@ declare module "OuterModule" {
public x: m2.c;
>x : Symbol(SubModule.x, Decl(ambientExternalModuleWithRelativeExternalImportDeclaration.ts, 4, 35))
>m2 : Symbol(m2, Decl(ambientExternalModuleWithRelativeExternalImportDeclaration.ts, 0, 30))
>c : Symbol(m2)
>c : Symbol(m2.c)
constructor();
}

View File

@ -15,7 +15,7 @@ declare module "OuterModule" {
>InstanceVar : number
public x: m2.c;
>x : any
>x : m2.c
>m2 : any
constructor();

View File

@ -44,6 +44,7 @@ assertEqual(animal.type, 'cat' as const);
>animal.type : Symbol(type, Decl(assertionFunctionsCanNarrowByDiscriminant.ts, 0, 15), Decl(assertionFunctionsCanNarrowByDiscriminant.ts, 5, 15))
>animal : Symbol(animal, Decl(assertionFunctionsCanNarrowByDiscriminant.ts, 14, 5))
>type : Symbol(type, Decl(assertionFunctionsCanNarrowByDiscriminant.ts, 0, 15), Decl(assertionFunctionsCanNarrowByDiscriminant.ts, 5, 15))
>const : Symbol(const)
animal.canMeow; // since is cat, should not be an error
>animal.canMeow : Symbol(Cat.canMeow, Decl(assertionFunctionsCanNarrowByDiscriminant.ts, 1, 16))
@ -61,6 +62,7 @@ assertEqual(animalOrUndef?.type, 'cat' as const);
>animalOrUndef?.type : Symbol(type, Decl(assertionFunctionsCanNarrowByDiscriminant.ts, 0, 15), Decl(assertionFunctionsCanNarrowByDiscriminant.ts, 5, 15))
>animalOrUndef : Symbol(animalOrUndef, Decl(assertionFunctionsCanNarrowByDiscriminant.ts, 19, 5))
>type : Symbol(type, Decl(assertionFunctionsCanNarrowByDiscriminant.ts, 0, 15), Decl(assertionFunctionsCanNarrowByDiscriminant.ts, 5, 15))
>const : Symbol(const)
animalOrUndef.canMeow; // since is cat, should not be an error
>animalOrUndef.canMeow : Symbol(Cat.canMeow, Decl(assertionFunctionsCanNarrowByDiscriminant.ts, 1, 16))

View File

@ -17,6 +17,7 @@ interface Derived2 extends Derived { baz: string; }
var a: A;
>a : Symbol(a, Decl(assignmentCompatWithStringIndexer3.ts, 6, 3))
>A : Symbol(A)
var b1: { [x: string]: string; }
>b1 : Symbol(b1, Decl(assignmentCompatWithStringIndexer3.ts, 7, 3))

View File

@ -11,7 +11,7 @@ interface Derived2 extends Derived { baz: string; }
>baz : string
var a: A;
>a : any
>a : A
var b1: { [x: string]: string; }
>b1 : { [x: string]: string; }
@ -19,13 +19,13 @@ var b1: { [x: string]: string; }
a = b1; // error
>a = b1 : { [x: string]: string; }
>a : any
>a : A
>b1 : { [x: string]: string; }
b1 = a; // error
>b1 = a : any
>b1 = a : A
>b1 : { [x: string]: string; }
>a : any
>a : A
module Generics {
>Generics : typeof Generics

View File

@ -6,5 +6,6 @@ var foo = async (): Promise<void> => {
// Legal to use 'await' in a type context.
var v: await;
>v : Symbol(v, Decl(asyncArrowFunction10_es2017.ts, 2, 6))
>await : Symbol(await)
}

View File

@ -5,6 +5,6 @@ var foo = async (): Promise<void> => {
// Legal to use 'await' in a type context.
var v: await;
>v : any
>v : await
}

View File

@ -6,5 +6,6 @@ var foo = async (): Promise<void> => {
// Legal to use 'await' in a type context.
var v: await;
>v : Symbol(v, Decl(asyncArrowFunction10_es5.ts, 2, 6))
>await : Symbol(await)
}

View File

@ -5,6 +5,6 @@ var foo = async (): Promise<void> => {
// Legal to use 'await' in a type context.
var v: await;
>v : any
>v : await
}

View File

@ -6,5 +6,6 @@ var foo = async (): Promise<void> => {
// Legal to use 'await' in a type context.
var v: await;
>v : Symbol(v, Decl(asyncArrowFunction10_es6.ts, 2, 6))
>await : Symbol(await)
}

View File

@ -5,6 +5,6 @@ var foo = async (): Promise<void> => {
// Legal to use 'await' in a type context.
var v: await;
>v : any
>v : await
}

View File

@ -6,7 +6,7 @@ declare var p: Promise<number>;
>p : Promise<number>
declare var mp: MyPromise<number>;
>mp : any
>mp : MyPromise<number>
async function f0() { }
>f0 : () => Promise<void>
@ -15,7 +15,7 @@ async function f1(): Promise<void> { }
>f1 : () => Promise<void>
async function f3(): MyPromise<void> { }
>f3 : () => any
>f3 : () => MyPromise<void>
let f4 = async function() { }
>f4 : () => Promise<void>
@ -26,8 +26,8 @@ let f5 = async function(): Promise<void> { }
>async function(): Promise<void> { } : () => Promise<void>
let f6 = async function(): MyPromise<void> { }
>f6 : () => any
>async function(): MyPromise<void> { } : () => any
>f6 : () => MyPromise<void>
>async function(): MyPromise<void> { } : () => MyPromise<void>
let f7 = async () => { };
>f7 : () => Promise<void>
@ -38,8 +38,8 @@ let f8 = async (): Promise<void> => { };
>async (): Promise<void> => { } : () => Promise<void>
let f9 = async (): MyPromise<void> => { };
>f9 : () => any
>async (): MyPromise<void> => { } : () => any
>f9 : () => MyPromise<void>
>async (): MyPromise<void> => { } : () => MyPromise<void>
let f10 = async () => p;
>f10 : () => Promise<number>
@ -47,23 +47,23 @@ let f10 = async () => p;
>p : Promise<number>
let f11 = async () => mp;
>f11 : () => Promise<any>
>async () => mp : () => Promise<any>
>mp : any
>f11 : () => Promise<MyPromise<number>>
>async () => mp : () => Promise<MyPromise<number>>
>mp : MyPromise<number>
let f12 = async (): Promise<number> => mp;
>f12 : () => Promise<number>
>async (): Promise<number> => mp : () => Promise<number>
>mp : any
>mp : MyPromise<number>
let f13 = async (): MyPromise<number> => p;
>f13 : () => any
>async (): MyPromise<number> => p : () => any
>f13 : () => MyPromise<number>
>async (): MyPromise<number> => p : () => MyPromise<number>
>p : Promise<number>
let o = {
>o : { m1(): Promise<void>; m2(): Promise<void>; m3(): any; }
>{ async m1() { }, async m2(): Promise<void> { }, async m3(): MyPromise<void> { }} : { m1(): Promise<void>; m2(): Promise<void>; m3(): any; }
>o : { m1(): Promise<void>; m2(): Promise<void>; m3(): MyPromise<void>; }
>{ async m1() { }, async m2(): Promise<void> { }, async m3(): MyPromise<void> { }} : { m1(): Promise<void>; m2(): Promise<void>; m3(): MyPromise<void>; }
async m1() { },
>m1 : () => Promise<void>
@ -72,7 +72,7 @@ let o = {
>m2 : () => Promise<void>
async m3(): MyPromise<void> { }
>m3 : () => any
>m3 : () => MyPromise<void>
};
@ -86,7 +86,7 @@ class C {
>m2 : () => Promise<void>
async m3(): MyPromise<void> { }
>m3 : () => any
>m3 : () => MyPromise<void>
static async m4() { }
>m4 : () => Promise<void>
@ -95,7 +95,7 @@ class C {
>m5 : () => Promise<void>
static async m6(): MyPromise<void> { }
>m6 : () => any
>m6 : () => MyPromise<void>
}
module M {

View File

@ -6,7 +6,7 @@ declare var p: Promise<number>;
>p : Promise<number>
declare var mp: MyPromise<number>;
>mp : any
>mp : MyPromise<number>
async function f0() { }
>f0 : () => Promise<void>
@ -15,7 +15,7 @@ async function f1(): Promise<void> { }
>f1 : () => Promise<void>
async function f3(): MyPromise<void> { }
>f3 : () => any
>f3 : () => MyPromise<void>
let f4 = async function() { }
>f4 : () => Promise<void>
@ -26,8 +26,8 @@ let f5 = async function(): Promise<void> { }
>async function(): Promise<void> { } : () => Promise<void>
let f6 = async function(): MyPromise<void> { }
>f6 : () => any
>async function(): MyPromise<void> { } : () => any
>f6 : () => MyPromise<void>
>async function(): MyPromise<void> { } : () => MyPromise<void>
let f7 = async () => { };
>f7 : () => Promise<void>
@ -38,8 +38,8 @@ let f8 = async (): Promise<void> => { };
>async (): Promise<void> => { } : () => Promise<void>
let f9 = async (): MyPromise<void> => { };
>f9 : () => any
>async (): MyPromise<void> => { } : () => any
>f9 : () => MyPromise<void>
>async (): MyPromise<void> => { } : () => MyPromise<void>
let f10 = async () => p;
>f10 : () => Promise<number>
@ -47,23 +47,23 @@ let f10 = async () => p;
>p : Promise<number>
let f11 = async () => mp;
>f11 : () => Promise<any>
>async () => mp : () => Promise<any>
>mp : any
>f11 : () => Promise<MyPromise<number>>
>async () => mp : () => Promise<MyPromise<number>>
>mp : MyPromise<number>
let f12 = async (): Promise<number> => mp;
>f12 : () => Promise<number>
>async (): Promise<number> => mp : () => Promise<number>
>mp : any
>mp : MyPromise<number>
let f13 = async (): MyPromise<number> => p;
>f13 : () => any
>async (): MyPromise<number> => p : () => any
>f13 : () => MyPromise<number>
>async (): MyPromise<number> => p : () => MyPromise<number>
>p : Promise<number>
let o = {
>o : { m1(): Promise<void>; m2(): Promise<void>; m3(): any; }
>{ async m1() { }, async m2(): Promise<void> { }, async m3(): MyPromise<void> { }} : { m1(): Promise<void>; m2(): Promise<void>; m3(): any; }
>o : { m1(): Promise<void>; m2(): Promise<void>; m3(): MyPromise<void>; }
>{ async m1() { }, async m2(): Promise<void> { }, async m3(): MyPromise<void> { }} : { m1(): Promise<void>; m2(): Promise<void>; m3(): MyPromise<void>; }
async m1() { },
>m1 : () => Promise<void>
@ -72,7 +72,7 @@ let o = {
>m2 : () => Promise<void>
async m3(): MyPromise<void> { }
>m3 : () => any
>m3 : () => MyPromise<void>
};
@ -86,7 +86,7 @@ class C {
>m2 : () => Promise<void>
async m3(): MyPromise<void> { }
>m3 : () => any
>m3 : () => MyPromise<void>
static async m4() { }
>m4 : () => Promise<void>
@ -95,7 +95,7 @@ class C {
>m5 : () => Promise<void>
static async m6(): MyPromise<void> { }
>m6 : () => any
>m6 : () => MyPromise<void>
}
module M {

View File

@ -6,7 +6,7 @@ declare var p: Promise<number>;
>p : Promise<number>
declare var mp: MyPromise<number>;
>mp : any
>mp : MyPromise<number>
async function f0() { }
>f0 : () => Promise<void>
@ -15,7 +15,7 @@ async function f1(): Promise<void> { }
>f1 : () => Promise<void>
async function f3(): MyPromise<void> { }
>f3 : () => any
>f3 : () => MyPromise<void>
let f4 = async function() { }
>f4 : () => Promise<void>
@ -26,8 +26,8 @@ let f5 = async function(): Promise<void> { }
>async function(): Promise<void> { } : () => Promise<void>
let f6 = async function(): MyPromise<void> { }
>f6 : () => any
>async function(): MyPromise<void> { } : () => any
>f6 : () => MyPromise<void>
>async function(): MyPromise<void> { } : () => MyPromise<void>
let f7 = async () => { };
>f7 : () => Promise<void>
@ -38,8 +38,8 @@ let f8 = async (): Promise<void> => { };
>async (): Promise<void> => { } : () => Promise<void>
let f9 = async (): MyPromise<void> => { };
>f9 : () => any
>async (): MyPromise<void> => { } : () => any
>f9 : () => MyPromise<void>
>async (): MyPromise<void> => { } : () => MyPromise<void>
let f10 = async () => p;
>f10 : () => Promise<number>
@ -47,23 +47,23 @@ let f10 = async () => p;
>p : Promise<number>
let f11 = async () => mp;
>f11 : () => Promise<any>
>async () => mp : () => Promise<any>
>mp : any
>f11 : () => Promise<MyPromise<number>>
>async () => mp : () => Promise<MyPromise<number>>
>mp : MyPromise<number>
let f12 = async (): Promise<number> => mp;
>f12 : () => Promise<number>
>async (): Promise<number> => mp : () => Promise<number>
>mp : any
>mp : MyPromise<number>
let f13 = async (): MyPromise<number> => p;
>f13 : () => any
>async (): MyPromise<number> => p : () => any
>f13 : () => MyPromise<number>
>async (): MyPromise<number> => p : () => MyPromise<number>
>p : Promise<number>
let o = {
>o : { m1(): Promise<void>; m2(): Promise<void>; m3(): any; }
>{ async m1() { }, async m2(): Promise<void> { }, async m3(): MyPromise<void> { }} : { m1(): Promise<void>; m2(): Promise<void>; m3(): any; }
>o : { m1(): Promise<void>; m2(): Promise<void>; m3(): MyPromise<void>; }
>{ async m1() { }, async m2(): Promise<void> { }, async m3(): MyPromise<void> { }} : { m1(): Promise<void>; m2(): Promise<void>; m3(): MyPromise<void>; }
async m1() { },
>m1 : () => Promise<void>
@ -72,7 +72,7 @@ let o = {
>m2 : () => Promise<void>
async m3(): MyPromise<void> { }
>m3 : () => any
>m3 : () => MyPromise<void>
};
@ -86,7 +86,7 @@ class C {
>m2 : () => Promise<void>
async m3(): MyPromise<void> { }
>m3 : () => any
>m3 : () => MyPromise<void>
static async m4() { }
>m4 : () => Promise<void>
@ -95,7 +95,7 @@ class C {
>m5 : () => Promise<void>
static async m6(): MyPromise<void> { }
>m6 : () => any
>m6 : () => MyPromise<void>
}
module M {

View File

@ -6,5 +6,6 @@ async function foo(): Promise<void> {
// Legal to use 'await' in a type context.
var v: await;
>v : Symbol(v, Decl(asyncFunctionDeclaration13_es2017.ts, 2, 6))
>await : Symbol(await)
}

View File

@ -4,6 +4,6 @@ async function foo(): Promise<void> {
// Legal to use 'await' in a type context.
var v: await;
>v : any
>v : await
}

View File

@ -6,5 +6,6 @@ async function foo(): Promise<void> {
// Legal to use 'await' in a type context.
var v: await;
>v : Symbol(v, Decl(asyncFunctionDeclaration13_es5.ts, 2, 6))
>await : Symbol(await)
}

View File

@ -4,6 +4,6 @@ async function foo(): Promise<void> {
// Legal to use 'await' in a type context.
var v: await;
>v : any
>v : await
}

View File

@ -6,5 +6,6 @@ async function foo(): Promise<void> {
// Legal to use 'await' in a type context.
var v: await;
>v : Symbol(v, Decl(asyncFunctionDeclaration13_es6.ts, 2, 6))
>await : Symbol(await)
}

View File

@ -4,6 +4,6 @@ async function foo(): Promise<void> {
// Legal to use 'await' in a type context.
var v: await;
>v : any
>v : await
}

View File

@ -5,6 +5,8 @@ import x = require("./file1");
import "./file2";
let a: x.A; // should not work
>a : Symbol(a, Decl(file3.ts, 2, 3))
>x : Symbol(x)
>A : Symbol(x.A)
=== tests/cases/compiler/file1.ts ===
var x = 1;

View File

@ -4,7 +4,7 @@ import x = require("./file1");
import "./file2";
let a: x.A; // should not work
>a : any
>a : x.A
>x : any
=== tests/cases/compiler/file1.ts ===

View File

@ -5,6 +5,8 @@ import x = require("file1");
import "file2";
let a: x.A; // should not work
>a : Symbol(a, Decl(file3.ts, 2, 3))
>x : Symbol(x)
>A : Symbol(x.A)
=== tests/cases/compiler/file1.d.ts ===
declare module "file1" {

View File

@ -4,7 +4,7 @@ import x = require("file1");
import "file2";
let a: x.A; // should not work
>a : any
>a : x.A
>x : any
=== tests/cases/compiler/file1.d.ts ===

View File

@ -5,6 +5,8 @@ import x = require("./file1");
import "./file2";
let a: x.A; // should not work
>a : Symbol(a, Decl(file3.ts, 2, 3))
>x : Symbol(x)
>A : Symbol(x.A)
=== tests/cases/compiler/file1.ts ===
function foo() {}

View File

@ -4,7 +4,7 @@ import x = require("./file1");
import "./file2";
let a: x.A; // should not work
>a : any
>a : x.A
>x : any
=== tests/cases/compiler/file1.ts ===

View File

@ -5,6 +5,8 @@ import x = require("file1");
import "file2";
let a: x.A; // should not work
>a : Symbol(a, Decl(file3.ts, 2, 3))
>x : Symbol(x)
>A : Symbol(x.A)
=== tests/cases/compiler/file1.d.ts ===
declare module "file1" {

View File

@ -4,7 +4,7 @@ import x = require("file1");
import "file2";
let a: x.A; // should not work
>a : any
>a : x.A
>x : any
=== tests/cases/compiler/file1.d.ts ===

View File

@ -8,11 +8,11 @@ export declare var a: {
test1: a1.connectModule;
>test1 : Symbol(test1, Decl(badExternalModuleReference.ts, 1, 23))
>a1 : Symbol(a1, Decl(badExternalModuleReference.ts, 0, 0))
>connectModule : Symbol(a1)
>connectModule : Symbol(a1.connectModule)
(): a1.connectExport;
>a1 : Symbol(a1, Decl(badExternalModuleReference.ts, 0, 0))
>connectExport : Symbol(a1)
>connectExport : Symbol(a1.connectExport)
};

View File

@ -3,10 +3,10 @@ import a1 = require("garbage");
>a1 : any
export declare var a: {
>a : { (): any; test1: any; }
>a : { (): a1.connectExport; test1: a1.connectModule; }
test1: a1.connectModule;
>test1 : any
>test1 : a1.connectModule
>a1 : any
(): a1.connectExport;

View File

@ -20,6 +20,7 @@ class Gen<T> extends base<T>() {} // Error, T not in scope
>Gen : Symbol(Gen, Decl(baseExpressionTypeParameters.ts, 7, 1))
>T : Symbol(T, Decl(baseExpressionTypeParameters.ts, 9, 10))
>base : Symbol(base, Decl(baseExpressionTypeParameters.ts, 0, 0))
>T : Symbol(T)
class Spec extends Gen<string> {}
>Spec : Symbol(Spec, Decl(baseExpressionTypeParameters.ts, 9, 33))

View File

@ -16,7 +16,7 @@ function base<T>() {
class Gen<T> extends base<T>() {} // Error, T not in scope
>Gen : Gen<T>
>base<T>() : base<any>.Base
>base<T>() : base<T>.Base
>base : <T>() => typeof Base
class Spec extends Gen<string> {}
@ -25,7 +25,7 @@ class Spec extends Gen<string> {}
<string>Spec.prop;
><string>Spec.prop : string
>Spec.prop : any
>Spec.prop : T
>Spec : typeof Spec
>prop : any
>prop : T

View File

@ -63,6 +63,7 @@ stringVal = bigintVal.toLocaleString('de-DE', { style: 'currency', currency: 'EU
// Test BigInt64Array
let bigIntArray: BigInt64Array = new BigInt64Array();
>bigIntArray : Symbol(bigIntArray, Decl(bigintWithoutLib.ts, 17, 3))
>BigInt64Array : Symbol(BigInt64Array)
bigIntArray = new BigInt64Array(10);
>bigIntArray : Symbol(bigIntArray, Decl(bigintWithoutLib.ts, 17, 3))
@ -100,6 +101,7 @@ let arrayBufferLike: ArrayBufferView = bigIntArray;
// Test BigUint64Array
let bigUintArray: BigUint64Array = new BigUint64Array();
>bigUintArray : Symbol(bigUintArray, Decl(bigintWithoutLib.ts, 29, 3))
>BigUint64Array : Symbol(BigUint64Array)
bigUintArray = new BigUint64Array(10);
>bigUintArray : Symbol(bigUintArray, Decl(bigintWithoutLib.ts, 29, 3))

View File

@ -109,20 +109,20 @@ stringVal = bigintVal.toLocaleString('de-DE', { style: 'currency', currency: 'EU
// Test BigInt64Array
let bigIntArray: BigInt64Array = new BigInt64Array();
>bigIntArray : any
>bigIntArray : BigInt64Array
>new BigInt64Array() : any
>BigInt64Array : any
bigIntArray = new BigInt64Array(10);
>bigIntArray = new BigInt64Array(10) : any
>bigIntArray : any
>bigIntArray : BigInt64Array
>new BigInt64Array(10) : any
>BigInt64Array : any
>10 : 10
bigIntArray = new BigInt64Array([1n, 2n, 3n]);
>bigIntArray = new BigInt64Array([1n, 2n, 3n]) : any
>bigIntArray : any
>bigIntArray : BigInt64Array
>new BigInt64Array([1n, 2n, 3n]) : any
>BigInt64Array : any
>[1n, 2n, 3n] : bigint[]
@ -132,7 +132,7 @@ bigIntArray = new BigInt64Array([1n, 2n, 3n]);
bigIntArray = new BigInt64Array([1, 2, 3]);
>bigIntArray = new BigInt64Array([1, 2, 3]) : any
>bigIntArray : any
>bigIntArray : BigInt64Array
>new BigInt64Array([1, 2, 3]) : any
>BigInt64Array : any
>[1, 2, 3] : number[]
@ -142,7 +142,7 @@ bigIntArray = new BigInt64Array([1, 2, 3]);
bigIntArray = new BigInt64Array(new ArrayBuffer(80));
>bigIntArray = new BigInt64Array(new ArrayBuffer(80)) : any
>bigIntArray : any
>bigIntArray : BigInt64Array
>new BigInt64Array(new ArrayBuffer(80)) : any
>BigInt64Array : any
>new ArrayBuffer(80) : ArrayBuffer
@ -151,7 +151,7 @@ bigIntArray = new BigInt64Array(new ArrayBuffer(80));
bigIntArray = new BigInt64Array(new ArrayBuffer(80), 8);
>bigIntArray = new BigInt64Array(new ArrayBuffer(80), 8) : any
>bigIntArray : any
>bigIntArray : BigInt64Array
>new BigInt64Array(new ArrayBuffer(80), 8) : any
>BigInt64Array : any
>new ArrayBuffer(80) : ArrayBuffer
@ -161,7 +161,7 @@ bigIntArray = new BigInt64Array(new ArrayBuffer(80), 8);
bigIntArray = new BigInt64Array(new ArrayBuffer(80), 8, 3);
>bigIntArray = new BigInt64Array(new ArrayBuffer(80), 8, 3) : any
>bigIntArray : any
>bigIntArray : BigInt64Array
>new BigInt64Array(new ArrayBuffer(80), 8, 3) : any
>BigInt64Array : any
>new ArrayBuffer(80) : ArrayBuffer
@ -173,36 +173,36 @@ bigIntArray = new BigInt64Array(new ArrayBuffer(80), 8, 3);
let len: number = bigIntArray.length;
>len : number
>bigIntArray.length : any
>bigIntArray : any
>bigIntArray : BigInt64Array
>length : any
bigIntArray.length = 10;
>bigIntArray.length = 10 : 10
>bigIntArray.length : any
>bigIntArray : any
>bigIntArray : BigInt64Array
>length : any
>10 : 10
let arrayBufferLike: ArrayBufferView = bigIntArray;
>arrayBufferLike : ArrayBufferView
>bigIntArray : any
>bigIntArray : BigInt64Array
// Test BigUint64Array
let bigUintArray: BigUint64Array = new BigUint64Array();
>bigUintArray : any
>bigUintArray : BigUint64Array
>new BigUint64Array() : any
>BigUint64Array : any
bigUintArray = new BigUint64Array(10);
>bigUintArray = new BigUint64Array(10) : any
>bigUintArray : any
>bigUintArray : BigUint64Array
>new BigUint64Array(10) : any
>BigUint64Array : any
>10 : 10
bigUintArray = new BigUint64Array([1n, 2n, 3n]);
>bigUintArray = new BigUint64Array([1n, 2n, 3n]) : any
>bigUintArray : any
>bigUintArray : BigUint64Array
>new BigUint64Array([1n, 2n, 3n]) : any
>BigUint64Array : any
>[1n, 2n, 3n] : bigint[]
@ -212,7 +212,7 @@ bigUintArray = new BigUint64Array([1n, 2n, 3n]);
bigUintArray = new BigUint64Array([1, 2, 3]);
>bigUintArray = new BigUint64Array([1, 2, 3]) : any
>bigUintArray : any
>bigUintArray : BigUint64Array
>new BigUint64Array([1, 2, 3]) : any
>BigUint64Array : any
>[1, 2, 3] : number[]
@ -222,7 +222,7 @@ bigUintArray = new BigUint64Array([1, 2, 3]);
bigUintArray = new BigUint64Array(new ArrayBuffer(80));
>bigUintArray = new BigUint64Array(new ArrayBuffer(80)) : any
>bigUintArray : any
>bigUintArray : BigUint64Array
>new BigUint64Array(new ArrayBuffer(80)) : any
>BigUint64Array : any
>new ArrayBuffer(80) : ArrayBuffer
@ -231,7 +231,7 @@ bigUintArray = new BigUint64Array(new ArrayBuffer(80));
bigUintArray = new BigUint64Array(new ArrayBuffer(80), 8);
>bigUintArray = new BigUint64Array(new ArrayBuffer(80), 8) : any
>bigUintArray : any
>bigUintArray : BigUint64Array
>new BigUint64Array(new ArrayBuffer(80), 8) : any
>BigUint64Array : any
>new ArrayBuffer(80) : ArrayBuffer
@ -241,7 +241,7 @@ bigUintArray = new BigUint64Array(new ArrayBuffer(80), 8);
bigUintArray = new BigUint64Array(new ArrayBuffer(80), 8, 3);
>bigUintArray = new BigUint64Array(new ArrayBuffer(80), 8, 3) : any
>bigUintArray : any
>bigUintArray : BigUint64Array
>new BigUint64Array(new ArrayBuffer(80), 8, 3) : any
>BigUint64Array : any
>new ArrayBuffer(80) : ArrayBuffer
@ -254,20 +254,20 @@ len = bigIntArray.length;
>len = bigIntArray.length : any
>len : number
>bigIntArray.length : any
>bigIntArray : any
>bigIntArray : BigInt64Array
>length : any
bigIntArray.length = 10;
>bigIntArray.length = 10 : 10
>bigIntArray.length : any
>bigIntArray : any
>bigIntArray : BigInt64Array
>length : any
>10 : 10
arrayBufferLike = bigIntArray;
>arrayBufferLike = bigIntArray : any
>arrayBufferLike = bigIntArray : BigInt64Array
>arrayBufferLike : ArrayBufferView
>bigIntArray : any
>bigIntArray : BigInt64Array
// Test added DataView methods
const dataView = new DataView(new ArrayBuffer(80));

View File

@ -132,6 +132,7 @@ export declare class Promise<R> implements Promise.Thenable<R> {
>dit : Symbol(dit, Decl(bluebirdStaticThis.ts, 21, 20))
>Promise : Symbol(Promise, Decl(bluebirdStaticThis.ts, 0, 0), Decl(bluebirdStaticThis.ts, 108, 1))
>Promise : Symbol(Promise, Decl(bluebirdStaticThis.ts, 0, 0), Decl(bluebirdStaticThis.ts, 108, 1))
>Resolver : Symbol(Promise.Resolver)
>R : Symbol(R, Decl(bluebirdStaticThis.ts, 21, 17))
static cast<R>(dit: typeof Promise, value: Promise.Thenable<R>): Promise<R>;
@ -334,6 +335,7 @@ export declare class Promise<R> implements Promise.Thenable<R> {
>R : Symbol(R, Decl(bluebirdStaticThis.ts, 56, 18))
>Promise : Symbol(Promise, Decl(bluebirdStaticThis.ts, 0, 0), Decl(bluebirdStaticThis.ts, 108, 1))
>Promise : Symbol(Promise, Decl(bluebirdStaticThis.ts, 0, 0), Decl(bluebirdStaticThis.ts, 108, 1))
>Inspection : Symbol(Promise.Inspection)
>R : Symbol(R, Decl(bluebirdStaticThis.ts, 56, 18))
static settle<R>(dit: typeof Promise, values: Promise.Thenable<R[]>): Promise<Promise.Inspection<R>[]>;
@ -347,6 +349,7 @@ export declare class Promise<R> implements Promise.Thenable<R> {
>R : Symbol(R, Decl(bluebirdStaticThis.ts, 57, 18))
>Promise : Symbol(Promise, Decl(bluebirdStaticThis.ts, 0, 0), Decl(bluebirdStaticThis.ts, 108, 1))
>Promise : Symbol(Promise, Decl(bluebirdStaticThis.ts, 0, 0), Decl(bluebirdStaticThis.ts, 108, 1))
>Inspection : Symbol(Promise.Inspection)
>R : Symbol(R, Decl(bluebirdStaticThis.ts, 57, 18))
static settle<R>(dit: typeof Promise, values: Promise.Thenable<R>[]): Promise<Promise.Inspection<R>[]>;
@ -360,6 +363,7 @@ export declare class Promise<R> implements Promise.Thenable<R> {
>R : Symbol(R, Decl(bluebirdStaticThis.ts, 58, 18))
>Promise : Symbol(Promise, Decl(bluebirdStaticThis.ts, 0, 0), Decl(bluebirdStaticThis.ts, 108, 1))
>Promise : Symbol(Promise, Decl(bluebirdStaticThis.ts, 0, 0), Decl(bluebirdStaticThis.ts, 108, 1))
>Inspection : Symbol(Promise.Inspection)
>R : Symbol(R, Decl(bluebirdStaticThis.ts, 58, 18))
static settle<R>(dit: typeof Promise, values: R[]): Promise<Promise.Inspection<R>[]>;
@ -371,6 +375,7 @@ export declare class Promise<R> implements Promise.Thenable<R> {
>R : Symbol(R, Decl(bluebirdStaticThis.ts, 59, 18))
>Promise : Symbol(Promise, Decl(bluebirdStaticThis.ts, 0, 0), Decl(bluebirdStaticThis.ts, 108, 1))
>Promise : Symbol(Promise, Decl(bluebirdStaticThis.ts, 0, 0), Decl(bluebirdStaticThis.ts, 108, 1))
>Inspection : Symbol(Promise.Inspection)
>R : Symbol(R, Decl(bluebirdStaticThis.ts, 59, 18))
static any<R>(dit: typeof Promise, values: Promise.Thenable<Promise.Thenable<R>[]>): Promise<R>;

View File

@ -86,7 +86,7 @@ export declare class Promise<R> implements Promise.Thenable<R> {
>reason : any
static defer<R>(dit: typeof Promise): Promise.Resolver<R>;
>defer : <R>(dit: typeof Promise) => any
>defer : <R>(dit: typeof Promise) => Promise.Resolver<R>
>dit : typeof Promise
>Promise : typeof Promise
>Promise : any
@ -221,7 +221,7 @@ export declare class Promise<R> implements Promise.Thenable<R> {
>object : Object
static settle<R>(dit: typeof Promise, values: Promise.Thenable<Promise.Thenable<R>[]>): Promise<Promise.Inspection<R>[]>;
>settle : { <R>(dit: typeof Promise, values: Promise.Thenable<Promise.Thenable<R>[]>): Promise<Promise.Inspection<R>[]>; <R>(dit: typeof Promise, values: Promise.Thenable<R[]>): Promise<any[]>; <R>(dit: typeof Promise, values: Promise.Thenable<R>[]): Promise<any[]>; <R>(dit: typeof Promise, values: R[]): Promise<any[]>; }
>settle : { <R>(dit: typeof Promise, values: Promise.Thenable<Promise.Thenable<R>[]>): Promise<Promise.Inspection<R>[]>; <R>(dit: typeof Promise, values: Promise.Thenable<R[]>): Promise<Promise.Inspection<R>[]>; <R>(dit: typeof Promise, values: Promise.Thenable<R>[]): Promise<Promise.Inspection<R>[]>; <R>(dit: typeof Promise, values: R[]): Promise<Promise.Inspection<R>[]>; }
>dit : typeof Promise
>Promise : typeof Promise
>values : Promise.Thenable<Promise.Thenable<R>[]>
@ -230,7 +230,7 @@ export declare class Promise<R> implements Promise.Thenable<R> {
>Promise : any
static settle<R>(dit: typeof Promise, values: Promise.Thenable<R[]>): Promise<Promise.Inspection<R>[]>;
>settle : { <R>(dit: typeof Promise, values: Promise.Thenable<Promise.Thenable<R>[]>): Promise<any[]>; <R>(dit: typeof Promise, values: Promise.Thenable<R[]>): Promise<Promise.Inspection<R>[]>; <R>(dit: typeof Promise, values: Promise.Thenable<R>[]): Promise<any[]>; <R>(dit: typeof Promise, values: R[]): Promise<any[]>; }
>settle : { <R>(dit: typeof Promise, values: Promise.Thenable<Promise.Thenable<R>[]>): Promise<Promise.Inspection<R>[]>; <R>(dit: typeof Promise, values: Promise.Thenable<R[]>): Promise<Promise.Inspection<R>[]>; <R>(dit: typeof Promise, values: Promise.Thenable<R>[]): Promise<Promise.Inspection<R>[]>; <R>(dit: typeof Promise, values: R[]): Promise<Promise.Inspection<R>[]>; }
>dit : typeof Promise
>Promise : typeof Promise
>values : Promise.Thenable<R[]>
@ -238,7 +238,7 @@ export declare class Promise<R> implements Promise.Thenable<R> {
>Promise : any
static settle<R>(dit: typeof Promise, values: Promise.Thenable<R>[]): Promise<Promise.Inspection<R>[]>;
>settle : { <R>(dit: typeof Promise, values: Promise.Thenable<Promise.Thenable<R>[]>): Promise<any[]>; <R>(dit: typeof Promise, values: Promise.Thenable<R[]>): Promise<any[]>; <R>(dit: typeof Promise, values: Promise.Thenable<R>[]): Promise<Promise.Inspection<R>[]>; <R>(dit: typeof Promise, values: R[]): Promise<any[]>; }
>settle : { <R>(dit: typeof Promise, values: Promise.Thenable<Promise.Thenable<R>[]>): Promise<Promise.Inspection<R>[]>; <R>(dit: typeof Promise, values: Promise.Thenable<R[]>): Promise<Promise.Inspection<R>[]>; <R>(dit: typeof Promise, values: Promise.Thenable<R>[]): Promise<Promise.Inspection<R>[]>; <R>(dit: typeof Promise, values: R[]): Promise<Promise.Inspection<R>[]>; }
>dit : typeof Promise
>Promise : typeof Promise
>values : Promise.Thenable<R>[]
@ -246,7 +246,7 @@ export declare class Promise<R> implements Promise.Thenable<R> {
>Promise : any
static settle<R>(dit: typeof Promise, values: R[]): Promise<Promise.Inspection<R>[]>;
>settle : { <R>(dit: typeof Promise, values: Promise.Thenable<Promise.Thenable<R>[]>): Promise<any[]>; <R>(dit: typeof Promise, values: Promise.Thenable<R[]>): Promise<any[]>; <R>(dit: typeof Promise, values: Promise.Thenable<R>[]): Promise<any[]>; <R>(dit: typeof Promise, values: R[]): Promise<Promise.Inspection<R>[]>; }
>settle : { <R>(dit: typeof Promise, values: Promise.Thenable<Promise.Thenable<R>[]>): Promise<Promise.Inspection<R>[]>; <R>(dit: typeof Promise, values: Promise.Thenable<R[]>): Promise<Promise.Inspection<R>[]>; <R>(dit: typeof Promise, values: Promise.Thenable<R>[]): Promise<Promise.Inspection<R>[]>; <R>(dit: typeof Promise, values: R[]): Promise<Promise.Inspection<R>[]>; }
>dit : typeof Promise
>Promise : typeof Promise
>values : R[]

View File

@ -1,6 +1,7 @@
=== tests/cases/conformance/types/primitives/boolean/boolInsteadOfBoolean.ts ===
var x: bool;
>x : Symbol(x, Decl(boolInsteadOfBoolean.ts, 0, 3))
>bool : Symbol(bool)
var a: boolean = x;
>a : Symbol(a, Decl(boolInsteadOfBoolean.ts, 1, 3))

View File

@ -1,13 +1,13 @@
=== tests/cases/conformance/types/primitives/boolean/boolInsteadOfBoolean.ts ===
var x: bool;
>x : any
>x : bool
var a: boolean = x;
>a : boolean
>x : any
>x : bool
x = a;
>x = a : boolean
>x : any
>x : bool
>a : boolean

View File

@ -1,3 +1,6 @@
=== tests/cases/compiler/callExpressionWithMissingTypeArgument1.ts ===
Foo<a,,b>();
No type information for this code.
>a : Symbol(a)
> : Symbol(unknown)
>b : Symbol(b)

View File

@ -114,4 +114,5 @@ pli(...[reads, writes, writes] as const)
>reads : Symbol(reads, Decl(callWithSpread4.ts, 10, 11))
>writes : Symbol(writes, Decl(callWithSpread4.ts, 9, 11))
>writes : Symbol(writes, Decl(callWithSpread4.ts, 9, 11))
>const : Symbol(const)

View File

@ -26,9 +26,9 @@ class SharedClass {
constructor() {
/** @type {SharedId<S>} */
this.id;
>this.id : SharedId<any>
>this.id : SharedId<S>
>this : this
>id : SharedId<any>
>id : SharedId<S>
}
}
/** @type {SharedId<number>} */

View File

@ -15,6 +15,6 @@ exports.SomeName;
/** @type {exports.SomeName} */
const myString = 'str';
>myString : any
>myString : exports.SomeName
>'str' : "str"

View File

@ -27,11 +27,14 @@ module Editor {
public static MakeHead(): List<T> { // should error
>MakeHead : Symbol(List.MakeHead, Decl(classTypeParametersInStatics.ts, 9, 9))
>List : Symbol(List, Decl(classTypeParametersInStatics.ts, 0, 15))
>T : Symbol(T)
var entry: List<T> = new List<T>(true, null);
>entry : Symbol(entry, Decl(classTypeParametersInStatics.ts, 12, 15))
>List : Symbol(List, Decl(classTypeParametersInStatics.ts, 0, 15))
>T : Symbol(T)
>List : Symbol(List, Decl(classTypeParametersInStatics.ts, 0, 15))
>T : Symbol(T)
entry.prev = entry;
>entry.prev : Symbol(List.prev, Decl(classTypeParametersInStatics.ts, 4, 29))

View File

@ -22,28 +22,28 @@ module Editor {
>MakeHead : () => List<T>
var entry: List<T> = new List<T>(true, null);
>entry : List<any>
>new List<T>(true, null) : List<any>
>entry : List<T>
>new List<T>(true, null) : List<T>
>List : typeof List
>true : true
>null : null
entry.prev = entry;
>entry.prev = entry : List<any>
>entry.prev : List<any>
>entry : List<any>
>prev : List<any>
>entry : List<any>
>entry.prev = entry : List<T>
>entry.prev : List<T>
>entry : List<T>
>prev : List<T>
>entry : List<T>
entry.next = entry;
>entry.next = entry : List<any>
>entry.next : List<any>
>entry : List<any>
>next : List<any>
>entry : List<any>
>entry.next = entry : List<T>
>entry.next : List<T>
>entry : List<T>
>next : List<T>
>entry : List<T>
return entry;
>entry : List<any>
>entry : List<T>
}
public static MakeHead2<T>(): List<T> { // should not error

View File

@ -15,6 +15,8 @@ import test from "./test";
export type test
>test : Symbol(test, Decl(types1.ts, 0, 26))
> : Symbol(unknown)
=== tests/cases/compiler/types2.ts ===
import test from "./test";
>test : Symbol(test, Decl(types2.ts, 0, 6), Decl(types2.ts, 0, 26))
@ -22,6 +24,8 @@ import test from "./test";
export type test =
>test : Symbol(test, Decl(types2.ts, 0, 26))
> : Symbol(unknown)
=== tests/cases/compiler/types3.ts ===
import test from "./test";
>test : Symbol(test, Decl(types3.ts, 0, 6), Decl(types3.ts, 0, 26))

View File

@ -15,4 +15,5 @@ class C<T> {
[foo<T>()]() { }
>[foo<T>()] : Symbol(C[foo<T>()], Decl(computedPropertyNames32_ES5.ts, 4, 5))
>foo : Symbol(foo, Decl(computedPropertyNames32_ES5.ts, 0, 0))
>T : Symbol(T)
}

View File

@ -15,4 +15,5 @@ class C<T> {
[foo<T>()]() { }
>[foo<T>()] : Symbol(C[foo<T>()], Decl(computedPropertyNames32_ES6.ts, 4, 5))
>foo : Symbol(foo, Decl(computedPropertyNames32_ES6.ts, 0, 0))
>T : Symbol(T)
}

View File

@ -16,6 +16,7 @@ class C<T> {
[foo<T>()]() { }
>[foo<T>()] : Symbol([foo<T>()], Decl(computedPropertyNames34_ES5.ts, 3, 19))
>foo : Symbol(foo, Decl(computedPropertyNames34_ES5.ts, 0, 0))
>T : Symbol(T)
};
return 0;

View File

@ -16,6 +16,7 @@ class C<T> {
[foo<T>()]() { }
>[foo<T>()] : Symbol([foo<T>()], Decl(computedPropertyNames34_ES6.ts, 3, 19))
>foo : Symbol(foo, Decl(computedPropertyNames34_ES6.ts, 0, 0))
>T : Symbol(T)
};
return 0;

View File

@ -13,4 +13,5 @@ interface I<T> {
[foo<T>()](): void;
>[foo<T>()] : Symbol(I[foo<T>()], Decl(computedPropertyNames35_ES5.ts, 2, 18))
>foo : Symbol(foo, Decl(computedPropertyNames35_ES5.ts, 0, 0))
>T : Symbol(T)
}

View File

@ -13,4 +13,5 @@ interface I<T> {
[foo<T>()](): void;
>[foo<T>()] : Symbol(I[foo<T>()], Decl(computedPropertyNames35_ES6.ts, 2, 18))
>foo : Symbol(foo, Decl(computedPropertyNames35_ES6.ts, 0, 0))
>T : Symbol(T)
}

View File

@ -1,5 +1,6 @@
=== tests/cases/compiler/conflictMarkerTrivia4.ts ===
const x = <div>
>x : Symbol(x, Decl(conflictMarkerTrivia4.ts, 0, 5))
>div : Symbol(div)
<<<<<<< HEAD

View File

@ -1,7 +1,7 @@
=== tests/cases/compiler/conflictMarkerTrivia4.ts ===
const x = <div>
>x : any
><div> : any
>x : div
><div> : div
<<<<<<< HEAD
> : any

View File

@ -27,12 +27,14 @@ let foo = Foo.A as const;
>Foo.A : Symbol(Foo.A, Decl(enum.ts, 0, 17))
>Foo : Symbol(Foo, Decl(test.ts, 0, 8))
>A : Symbol(Foo.A, Decl(enum.ts, 0, 17))
>const : Symbol(const)
let bar = Bar.A as const;
>bar : Symbol(bar, Decl(test.ts, 7, 3))
>Bar.A : Symbol(Bar.A, Decl(test.ts, 2, 10))
>Bar : Symbol(Bar, Decl(test.ts, 0, 27))
>A : Symbol(Bar.A, Decl(test.ts, 2, 10))
>const : Symbol(const)
=== tests/cases/conformance/expressions/typeAssertions/ns.ts ===
namespace ns {
@ -48,6 +50,7 @@ namespace ns {
>ns : Symbol(ns, Decl(ns.ts, 0, 0))
>Foo : Symbol(Foo, Decl(ns.ts, 0, 14))
>X : Symbol(Foo.X, Decl(ns.ts, 1, 21))
>const : Symbol(const)
}
=== tests/cases/conformance/expressions/typeAssertions/more.ts ===
@ -59,4 +62,5 @@ export enum Foo { X }
>(Foo).X : Symbol(Foo.X, Decl(more.ts, 0, 17))
>Foo : Symbol(Foo, Decl(more.ts, 0, 0))
>X : Symbol(Foo.X, Decl(more.ts, 0, 17))
>const : Symbol(const)

View File

@ -1,57 +1,75 @@
=== tests/cases/conformance/expressions/typeAssertions/constAssertions.ts ===
let v1 = 'abc' as const;
>v1 : Symbol(v1, Decl(constAssertions.ts, 0, 3))
>const : Symbol(const)
let v2 = `abc` as const;
>v2 : Symbol(v2, Decl(constAssertions.ts, 1, 3))
>const : Symbol(const)
let v3 = 10 as const;
>v3 : Symbol(v3, Decl(constAssertions.ts, 2, 3))
>const : Symbol(const)
let v4 = -10 as const;
>v4 : Symbol(v4, Decl(constAssertions.ts, 3, 3))
>const : Symbol(const)
let v5 = +10 as const;
>v5 : Symbol(v5, Decl(constAssertions.ts, 4, 3))
>const : Symbol(const)
let v6 = 10n as const;
>v6 : Symbol(v6, Decl(constAssertions.ts, 5, 3))
>const : Symbol(const)
let v7 = -10n as const;
>v7 : Symbol(v7, Decl(constAssertions.ts, 6, 3))
>const : Symbol(const)
let v8 = true as const;
>v8 : Symbol(v8, Decl(constAssertions.ts, 7, 3))
>const : Symbol(const)
let v9 = false as const;
>v9 : Symbol(v9, Decl(constAssertions.ts, 8, 3))
>const : Symbol(const)
let c1 = 'abc' as const;
>c1 : Symbol(c1, Decl(constAssertions.ts, 10, 3))
>const : Symbol(const)
let c2 = `abc` as const;
>c2 : Symbol(c2, Decl(constAssertions.ts, 11, 3))
>const : Symbol(const)
let c3 = 10 as const;
>c3 : Symbol(c3, Decl(constAssertions.ts, 12, 3))
>const : Symbol(const)
let c4 = -10 as const;
>c4 : Symbol(c4, Decl(constAssertions.ts, 13, 3))
>const : Symbol(const)
let c5 = +10 as const;
>c5 : Symbol(c5, Decl(constAssertions.ts, 14, 3))
>const : Symbol(const)
let c6 = 10n as const;
>c6 : Symbol(c6, Decl(constAssertions.ts, 15, 3))
>const : Symbol(const)
let c7 = -10n as const;
>c7 : Symbol(c7, Decl(constAssertions.ts, 16, 3))
>const : Symbol(const)
let c8 = true as const;
>c8 : Symbol(c8, Decl(constAssertions.ts, 17, 3))
>const : Symbol(const)
let c9 = false as const;
>c9 : Symbol(c9, Decl(constAssertions.ts, 18, 3))
>const : Symbol(const)
let vv1 = v1;
>vv1 : Symbol(vv1, Decl(constAssertions.ts, 20, 3))
@ -63,15 +81,19 @@ let vc1 = c1;
let a1 = [] as const;
>a1 : Symbol(a1, Decl(constAssertions.ts, 23, 3))
>const : Symbol(const)
let a2 = [1, 2, 3] as const;
>a2 : Symbol(a2, Decl(constAssertions.ts, 24, 3))
>const : Symbol(const)
let a3 = [10, 'hello', true] as const;
>a3 : Symbol(a3, Decl(constAssertions.ts, 25, 3))
>const : Symbol(const)
let a4 = [...[1, 2, 3]] as const;
>a4 : Symbol(a4, Decl(constAssertions.ts, 26, 3))
>const : Symbol(const)
let a5 = [1, 2, 3];
>a5 : Symbol(a5, Decl(constAssertions.ts, 27, 3))
@ -79,6 +101,7 @@ let a5 = [1, 2, 3];
let a6 = [...a5] as const;
>a6 : Symbol(a6, Decl(constAssertions.ts, 28, 3))
>a5 : Symbol(a5, Decl(constAssertions.ts, 27, 3))
>const : Symbol(const)
let a7 = [...a6];
>a7 : Symbol(a7, Decl(constAssertions.ts, 29, 3))
@ -87,6 +110,7 @@ let a7 = [...a6];
let a8 = ['abc', ...a7] as const;
>a8 : Symbol(a8, Decl(constAssertions.ts, 30, 3))
>a7 : Symbol(a7, Decl(constAssertions.ts, 29, 3))
>const : Symbol(const)
let a9 = [...a8];
>a9 : Symbol(a9, Decl(constAssertions.ts, 31, 3))
@ -100,6 +124,7 @@ let o1 = { x: 10, y: 20 } as const;
>o1 : Symbol(o1, Decl(constAssertions.ts, 35, 3))
>x : Symbol(x, Decl(constAssertions.ts, 35, 10))
>y : Symbol(y, Decl(constAssertions.ts, 35, 17))
>const : Symbol(const)
let o2 = { a: 1, 'b': 2, ['c']: 3, d() {}, ['e' + '']: 4 } as const;
>o2 : Symbol(o2, Decl(constAssertions.ts, 36, 3))
@ -109,11 +134,13 @@ let o2 = { a: 1, 'b': 2, ['c']: 3, d() {}, ['e' + '']: 4 } as const;
>'c' : Symbol(['c'], Decl(constAssertions.ts, 36, 24))
>d : Symbol(d, Decl(constAssertions.ts, 36, 34))
>['e' + ''] : Symbol(['e' + ''], Decl(constAssertions.ts, 36, 42))
>const : Symbol(const)
let o3 = { ...o1, ...o2 } as const;
>o3 : Symbol(o3, Decl(constAssertions.ts, 37, 3))
>o1 : Symbol(o1, Decl(constAssertions.ts, 35, 3))
>o2 : Symbol(o2, Decl(constAssertions.ts, 36, 3))
>const : Symbol(const)
let o4 = { a: 1, b: 2 };
>o4 : Symbol(o4, Decl(constAssertions.ts, 38, 3))
@ -123,6 +150,7 @@ let o4 = { a: 1, b: 2 };
let o5 = { ...o4 } as const;
>o5 : Symbol(o5, Decl(constAssertions.ts, 39, 3))
>o4 : Symbol(o4, Decl(constAssertions.ts, 38, 3))
>const : Symbol(const)
let o6 = { ...o5 };
>o6 : Symbol(o6, Decl(constAssertions.ts, 40, 3))
@ -131,6 +159,7 @@ let o6 = { ...o5 };
let o7 = { ...d } as const;
>o7 : Symbol(o7, Decl(constAssertions.ts, 41, 3))
>d : Symbol(d, Decl(constAssertions.ts, 33, 11))
>const : Symbol(const)
let o8 = { ...o7 };
>o8 : Symbol(o8, Decl(constAssertions.ts, 42, 3))
@ -143,18 +172,23 @@ let o9 = { x: 10, foo() { this.x = 20 } } as const; // Error
>this.x : Symbol(x, Decl(constAssertions.ts, 43, 10))
>this : Symbol(__object, Decl(constAssertions.ts, 43, 8))
>x : Symbol(x, Decl(constAssertions.ts, 43, 10))
>const : Symbol(const)
let p1 = (10) as const;
>p1 : Symbol(p1, Decl(constAssertions.ts, 45, 3))
>const : Symbol(const)
let p2 = ((-10)) as const;
>p2 : Symbol(p2, Decl(constAssertions.ts, 46, 3))
>const : Symbol(const)
let p3 = ([(10)]) as const;
>p3 : Symbol(p3, Decl(constAssertions.ts, 47, 3))
>const : Symbol(const)
let p4 = [[[[10]]]] as const;
>p4 : Symbol(p4, Decl(constAssertions.ts, 48, 3))
>const : Symbol(const)
let x1 = { x: 10, y: [20, 30], z: { a: { b: 42 } } } as const;
>x1 : Symbol(x1, Decl(constAssertions.ts, 50, 3))
@ -163,21 +197,27 @@ let x1 = { x: 10, y: [20, 30], z: { a: { b: 42 } } } as const;
>z : Symbol(z, Decl(constAssertions.ts, 50, 30))
>a : Symbol(a, Decl(constAssertions.ts, 50, 35))
>b : Symbol(b, Decl(constAssertions.ts, 50, 40))
>const : Symbol(const)
let q1 = <const> 10;
>q1 : Symbol(q1, Decl(constAssertions.ts, 52, 3))
>const : Symbol(const)
let q2 = <const> 'abc';
>q2 : Symbol(q2, Decl(constAssertions.ts, 53, 3))
>const : Symbol(const)
let q3 = <const> true;
>q3 : Symbol(q3, Decl(constAssertions.ts, 54, 3))
>const : Symbol(const)
let q4 = <const> [1, 2, 3];
>q4 : Symbol(q4, Decl(constAssertions.ts, 55, 3))
>const : Symbol(const)
let q5 = <const> { x: 10, y: 20 };
>q5 : Symbol(q5, Decl(constAssertions.ts, 56, 3))
>const : Symbol(const)
>x : Symbol(x, Decl(constAssertions.ts, 56, 18))
>y : Symbol(y, Decl(constAssertions.ts, 56, 25))
@ -191,29 +231,36 @@ declare function id<T>(x: T): T;
let e1 = v1 as const; // Error
>e1 : Symbol(e1, Decl(constAssertions.ts, 60, 3))
>v1 : Symbol(v1, Decl(constAssertions.ts, 0, 3))
>const : Symbol(const)
let e2 = (true ? 1 : 0) as const; // Error
>e2 : Symbol(e2, Decl(constAssertions.ts, 61, 3))
>const : Symbol(const)
let e3 = id(1) as const; // Error
>e3 : Symbol(e3, Decl(constAssertions.ts, 62, 3))
>id : Symbol(id, Decl(constAssertions.ts, 56, 34))
>const : Symbol(const)
let t1 = 'foo' as const;
>t1 : Symbol(t1, Decl(constAssertions.ts, 64, 3))
>const : Symbol(const)
let t2 = 'bar' as const;
>t2 : Symbol(t2, Decl(constAssertions.ts, 65, 3))
>const : Symbol(const)
let t3 = `${t1}-${t2}` as const;
>t3 : Symbol(t3, Decl(constAssertions.ts, 66, 3))
>t1 : Symbol(t1, Decl(constAssertions.ts, 64, 3))
>t2 : Symbol(t2, Decl(constAssertions.ts, 65, 3))
>const : Symbol(const)
let t4 = `${`(${t1})`}-${`(${t2})`}` as const;
>t4 : Symbol(t4, Decl(constAssertions.ts, 67, 3))
>t1 : Symbol(t1, Decl(constAssertions.ts, 64, 3))
>t2 : Symbol(t2, Decl(constAssertions.ts, 65, 3))
>const : Symbol(const)
function ff1(x: 'foo' | 'bar', y: 1 | 2) {
>ff1 : Symbol(ff1, Decl(constAssertions.ts, 67, 46))
@ -223,6 +270,7 @@ function ff1(x: 'foo' | 'bar', y: 1 | 2) {
return `${x}-${y}` as const;
>x : Symbol(x, Decl(constAssertions.ts, 69, 13))
>y : Symbol(y, Decl(constAssertions.ts, 69, 30))
>const : Symbol(const)
}
function ff2<T extends string, U extends string>(x: T, y: U) {
@ -237,6 +285,7 @@ function ff2<T extends string, U extends string>(x: T, y: U) {
return `${x}-${y}` as const;
>x : Symbol(x, Decl(constAssertions.ts, 73, 49))
>y : Symbol(y, Decl(constAssertions.ts, 73, 54))
>const : Symbol(const)
}
const ts1 = ff2('foo', 'bar');
@ -259,6 +308,7 @@ function ff3(x: 'foo' | 'bar', y: object) {
return `${x}${y}` as const;
>x : Symbol(x, Decl(constAssertions.ts, 81, 13))
>y : Symbol(y, Decl(constAssertions.ts, 81, 30))
>const : Symbol(const)
}
type Action = "verify" | "write";
@ -292,6 +342,7 @@ function ff4(verify: boolean, contentMatches: boolean) {
>Outcome : Symbol(Outcome, Decl(constAssertions.ts, 86, 41))
>action : Symbol(action, Decl(constAssertions.ts, 90, 9))
>contentMatch : Symbol(contentMatch, Decl(constAssertions.ts, 91, 9))
>const : Symbol(const)
return outcome;
>outcome : Symbol(outcome, Decl(constAssertions.ts, 92, 9))
@ -314,6 +365,7 @@ function ff5(verify: boolean, contentMatches: boolean) {
>outcome : Symbol(outcome, Decl(constAssertions.ts, 99, 9))
>action : Symbol(action, Decl(constAssertions.ts, 97, 9))
>contentMatch : Symbol(contentMatch, Decl(constAssertions.ts, 98, 9))
>const : Symbol(const)
return outcome;
>outcome : Symbol(outcome, Decl(constAssertions.ts, 99, 9))
@ -328,6 +380,7 @@ function accessorNames<S extends string>(propName: S) {
return [`get-${propName}`, `set-${propName}`] as const;
>propName : Symbol(propName, Decl(constAssertions.ts, 103, 41))
>propName : Symbol(propName, Decl(constAssertions.ts, 103, 41))
>const : Symbol(const)
}
const ns1 = accessorNames('foo');

View File

@ -74,6 +74,7 @@ const foo3 = { a: E1.a } as const
>E1.a : Symbol(E1.a, Decl(constantEnumAssert.ts, 0, 9))
>E1 : Symbol(E1, Decl(constantEnumAssert.ts, 0, 0))
>a : Symbol(E1.a, Decl(constantEnumAssert.ts, 0, 9))
>const : Symbol(const)
const foo4 = { a: E2.a } as const
>foo4 : Symbol(foo4, Decl(constantEnumAssert.ts, 32, 5))
@ -81,6 +82,7 @@ const foo4 = { a: E2.a } as const
>E2.a : Symbol(E2.a, Decl(constantEnumAssert.ts, 5, 9))
>E2 : Symbol(E2, Decl(constantEnumAssert.ts, 3, 1))
>a : Symbol(E2.a, Decl(constantEnumAssert.ts, 5, 9))
>const : Symbol(const)
const foo5 = { a: E3.a } as const
>foo5 : Symbol(foo5, Decl(constantEnumAssert.ts, 34, 5))
@ -88,6 +90,7 @@ const foo5 = { a: E3.a } as const
>E3.a : Symbol(E3.a, Decl(constantEnumAssert.ts, 10, 9))
>E3 : Symbol(E3, Decl(constantEnumAssert.ts, 8, 1))
>a : Symbol(E3.a, Decl(constantEnumAssert.ts, 10, 9))
>const : Symbol(const)
const foo6 = { a: E4.a } as const
>foo6 : Symbol(foo6, Decl(constantEnumAssert.ts, 36, 5))
@ -95,6 +98,7 @@ const foo6 = { a: E4.a } as const
>E4.a : Symbol(E4.a, Decl(constantEnumAssert.ts, 16, 15))
>E4 : Symbol(E4, Decl(constantEnumAssert.ts, 14, 1))
>a : Symbol(E4.a, Decl(constantEnumAssert.ts, 16, 15))
>const : Symbol(const)
const foo7 = { a: E5.a } as const
>foo7 : Symbol(foo7, Decl(constantEnumAssert.ts, 38, 5))
@ -102,6 +106,7 @@ const foo7 = { a: E5.a } as const
>E5.a : Symbol(a, Decl(constantEnumAssert.ts, 21, 12))
>E5 : Symbol(E5, Decl(constantEnumAssert.ts, 21, 5))
>a : Symbol(a, Decl(constantEnumAssert.ts, 21, 12))
>const : Symbol(const)
const foo8 = { a: E1.a as const }
>foo8 : Symbol(foo8, Decl(constantEnumAssert.ts, 40, 5))
@ -109,6 +114,7 @@ const foo8 = { a: E1.a as const }
>E1.a : Symbol(E1.a, Decl(constantEnumAssert.ts, 0, 9))
>E1 : Symbol(E1, Decl(constantEnumAssert.ts, 0, 0))
>a : Symbol(E1.a, Decl(constantEnumAssert.ts, 0, 9))
>const : Symbol(const)
const foo9 = { a: E2.a as const }
>foo9 : Symbol(foo9, Decl(constantEnumAssert.ts, 42, 5))
@ -116,6 +122,7 @@ const foo9 = { a: E2.a as const }
>E2.a : Symbol(E2.a, Decl(constantEnumAssert.ts, 5, 9))
>E2 : Symbol(E2, Decl(constantEnumAssert.ts, 3, 1))
>a : Symbol(E2.a, Decl(constantEnumAssert.ts, 5, 9))
>const : Symbol(const)
const foo10 = { a: E3.a as const }
>foo10 : Symbol(foo10, Decl(constantEnumAssert.ts, 44, 5))
@ -123,6 +130,7 @@ const foo10 = { a: E3.a as const }
>E3.a : Symbol(E3.a, Decl(constantEnumAssert.ts, 10, 9))
>E3 : Symbol(E3, Decl(constantEnumAssert.ts, 8, 1))
>a : Symbol(E3.a, Decl(constantEnumAssert.ts, 10, 9))
>const : Symbol(const)
const foo11 = { a: E4.a as const }
>foo11 : Symbol(foo11, Decl(constantEnumAssert.ts, 46, 5))
@ -130,6 +138,7 @@ const foo11 = { a: E4.a as const }
>E4.a : Symbol(E4.a, Decl(constantEnumAssert.ts, 16, 15))
>E4 : Symbol(E4, Decl(constantEnumAssert.ts, 14, 1))
>a : Symbol(E4.a, Decl(constantEnumAssert.ts, 16, 15))
>const : Symbol(const)
const foo12 = { a: E5.a as const }
>foo12 : Symbol(foo12, Decl(constantEnumAssert.ts, 48, 5))
@ -137,4 +146,5 @@ const foo12 = { a: E5.a as const }
>E5.a : Symbol(a, Decl(constantEnumAssert.ts, 21, 12))
>E5 : Symbol(E5, Decl(constantEnumAssert.ts, 21, 5))
>a : Symbol(a, Decl(constantEnumAssert.ts, 21, 12))
>const : Symbol(const)

View File

@ -2,6 +2,7 @@
function foo5<T extends hm>(test: T) { }
>foo5 : Symbol(foo5, Decl(constraintErrors1.ts, 0, 0))
>T : Symbol(T, Decl(constraintErrors1.ts, 0, 14))
>hm : Symbol(hm)
>test : Symbol(test, Decl(constraintErrors1.ts, 0, 28))
>T : Symbol(T, Decl(constraintErrors1.ts, 0, 14))

View File

@ -1,5 +1,5 @@
=== tests/cases/compiler/constraintErrors1.ts ===
function foo5<T extends hm>(test: T) { }
>foo5 : <T extends any>(test: T) => void
>foo5 : <T extends hm>(test: T) => void
>test : T

View File

@ -144,7 +144,7 @@ module TypeScriptAllInOne {
var local5 = <fs.File>null;
>local5 : Symbol(local5, Decl(constructorWithIncompleteTypeAnnotation.ts, 74, 15))
>fs : Symbol(fs, Decl(constructorWithIncompleteTypeAnnotation.ts, 8, 1))
>File : Symbol(fs)
>File : Symbol(fs.File)
var local6 = local5 instanceof fs.File;
>local6 : Symbol(local6, Decl(constructorWithIncompleteTypeAnnotation.ts, 75, 15))
@ -537,6 +537,7 @@ module TypeScriptAllInOne {
Foo(): bool;
>Foo : Symbol(IF.Foo, Decl(constructorWithIncompleteTypeAnnotation.ts, 211, 18))
>bool : Symbol(bool)
}
class CLASS implements IF {
@ -556,6 +557,7 @@ module TypeScriptAllInOne {
}
public Foo(): bool {
>Foo : Symbol(CLASS.Foo, Decl(constructorWithIncompleteTypeAnnotation.ts, 221, 9))
>bool : Symbol(bool)
var myEvent = () => { return 1; };
>myEvent : Symbol(myEvent, Decl(constructorWithIncompleteTypeAnnotation.ts, 223, 15))
@ -604,6 +606,7 @@ module TypeScriptAllInOne {
constructor(private value: number, public name: string) : }
>value : Symbol(Overloading.value, Decl(constructorWithIncompleteTypeAnnotation.ts, 253, 20))
>name : Symbol(Overloading.name, Decl(constructorWithIncompleteTypeAnnotation.ts, 253, 42))
> : Symbol(fs)
public Overloads(value: string);
public Overloads( while : string, ...rest: string[]) { &

View File

@ -200,15 +200,15 @@ module TypeScriptAllInOne {
>local : number
var local5 = <fs.File>null;
>local5 : any
><fs.File>null : any
>local5 : fs.File
><fs.File>null : fs.File
>fs : any
>null : null
var local6 = local5 instanceof fs.File;
>local6 : boolean
>local5 instanceof fs.File : boolean
>local5 : any
>local5 : fs.File
>fs.File : any
>fs : any
>File : any
@ -540,10 +540,10 @@ module TypeScriptAllInOne {
>retVal += xx.Foo() ? 0 : 1 : number
>retVal : number
>xx.Foo() ? 0 : 1 : 0 | 1
>xx.Foo() : any
>xx.Foo : () => any
>xx.Foo() : bool
>xx.Foo : () => bool
>xx : IF
>Foo : () => any
>Foo : () => bool
>0 : 0
>1 : 1
@ -797,7 +797,7 @@ module TypeScriptAllInOne {
interface IF {
Foo(): bool;
>Foo : () => any
>Foo : () => bool
}
class CLASS implements IF {
@ -820,7 +820,7 @@ module TypeScriptAllInOne {
>0 : 0
}
public Foo(): bool {
>Foo : () => any
>Foo : () => bool
var myEvent = () => { return 1; };
>myEvent : () => number

View File

@ -14,6 +14,7 @@ declare function f(): void;
>a : Symbol(a, Decl(controlFlowAssignmentPatternOrder.ts, 3, 7))
>b : Symbol(b, Decl(controlFlowAssignmentPatternOrder.ts, 4, 7))
>a : Symbol(a, Decl(controlFlowAssignmentPatternOrder.ts, 3, 7))
>const : Symbol(const)
const bb: 0 = b;
>bb : Symbol(bb, Decl(controlFlowAssignmentPatternOrder.ts, 6, 9))
@ -31,6 +32,7 @@ declare function f(): void;
>a : Symbol(a, Decl(controlFlowAssignmentPatternOrder.ts, 9, 7))
>b : Symbol(b, Decl(controlFlowAssignmentPatternOrder.ts, 10, 7))
>a : Symbol(a, Decl(controlFlowAssignmentPatternOrder.ts, 9, 7))
>const : Symbol(const)
const bb: 9 = b;
>bb : Symbol(bb, Decl(controlFlowAssignmentPatternOrder.ts, 12, 9))
@ -48,6 +50,8 @@ declare function f(): void;
>a : Symbol(a, Decl(controlFlowAssignmentPatternOrder.ts, 15, 7))
>b : Symbol(b, Decl(controlFlowAssignmentPatternOrder.ts, 16, 7))
>a : Symbol(a, Decl(controlFlowAssignmentPatternOrder.ts, 15, 7))
>const : Symbol(const)
>const : Symbol(const)
const bb: 0 | 8 = b;
>bb : Symbol(bb, Decl(controlFlowAssignmentPatternOrder.ts, 18, 9))
@ -65,6 +69,8 @@ declare function f(): void;
>a : Symbol(a, Decl(controlFlowAssignmentPatternOrder.ts, 21, 7))
>b : Symbol(b, Decl(controlFlowAssignmentPatternOrder.ts, 22, 7))
>a : Symbol(a, Decl(controlFlowAssignmentPatternOrder.ts, 21, 7))
>const : Symbol(const)
>const : Symbol(const)
const bb: 0 | 8 = b;
>bb : Symbol(bb, Decl(controlFlowAssignmentPatternOrder.ts, 24, 9))
@ -83,6 +89,7 @@ declare function f(): void;
>a : Symbol(a, Decl(controlFlowAssignmentPatternOrder.ts, 28, 7))
>b : Symbol(b, Decl(controlFlowAssignmentPatternOrder.ts, 29, 7))
>a : Symbol(a, Decl(controlFlowAssignmentPatternOrder.ts, 28, 7))
>const : Symbol(const)
>f : Symbol(f, Decl(controlFlowAssignmentPatternOrder.ts, 0, 0))
const bb: 0 = b;
@ -101,6 +108,7 @@ declare function f(): void;
>a : Symbol(a, Decl(controlFlowAssignmentPatternOrder.ts, 34, 7))
>b : Symbol(b, Decl(controlFlowAssignmentPatternOrder.ts, 35, 7))
>a : Symbol(a, Decl(controlFlowAssignmentPatternOrder.ts, 34, 7))
>const : Symbol(const)
>f : Symbol(f, Decl(controlFlowAssignmentPatternOrder.ts, 0, 0))
const bb: 9 = b;
@ -119,6 +127,8 @@ declare function f(): void;
>a : Symbol(a, Decl(controlFlowAssignmentPatternOrder.ts, 40, 7))
>b : Symbol(b, Decl(controlFlowAssignmentPatternOrder.ts, 41, 7))
>a : Symbol(a, Decl(controlFlowAssignmentPatternOrder.ts, 40, 7))
>const : Symbol(const)
>const : Symbol(const)
>f : Symbol(f, Decl(controlFlowAssignmentPatternOrder.ts, 0, 0))
const bb: 0 | 8 = b;
@ -137,6 +147,8 @@ declare function f(): void;
>a : Symbol(a, Decl(controlFlowAssignmentPatternOrder.ts, 46, 7))
>b : Symbol(b, Decl(controlFlowAssignmentPatternOrder.ts, 47, 7))
>a : Symbol(a, Decl(controlFlowAssignmentPatternOrder.ts, 46, 7))
>const : Symbol(const)
>const : Symbol(const)
>f : Symbol(f, Decl(controlFlowAssignmentPatternOrder.ts, 0, 0))
const bb: 0 | 8 = b;
@ -157,6 +169,7 @@ declare function f(): void;
>a : Symbol(a, Decl(controlFlowAssignmentPatternOrder.ts, 53, 7))
>b : Symbol(b, Decl(controlFlowAssignmentPatternOrder.ts, 54, 7))
>a : Symbol(a, Decl(controlFlowAssignmentPatternOrder.ts, 53, 7))
>const : Symbol(const)
const bb: 0 = b;
>bb : Symbol(bb, Decl(controlFlowAssignmentPatternOrder.ts, 56, 9))
@ -175,6 +188,7 @@ declare function f(): void;
>a : Symbol(a, Decl(controlFlowAssignmentPatternOrder.ts, 59, 7))
>b : Symbol(b, Decl(controlFlowAssignmentPatternOrder.ts, 60, 7))
>a : Symbol(a, Decl(controlFlowAssignmentPatternOrder.ts, 59, 7))
>const : Symbol(const)
const bb: 9 = b;
>bb : Symbol(bb, Decl(controlFlowAssignmentPatternOrder.ts, 62, 9))
@ -193,6 +207,8 @@ declare function f(): void;
>a : Symbol(a, Decl(controlFlowAssignmentPatternOrder.ts, 65, 7))
>b : Symbol(b, Decl(controlFlowAssignmentPatternOrder.ts, 66, 7))
>a : Symbol(a, Decl(controlFlowAssignmentPatternOrder.ts, 65, 7))
>const : Symbol(const)
>const : Symbol(const)
const bb: 0 | 8 = b;
>bb : Symbol(bb, Decl(controlFlowAssignmentPatternOrder.ts, 68, 9))
@ -211,6 +227,8 @@ declare function f(): void;
>a : Symbol(a, Decl(controlFlowAssignmentPatternOrder.ts, 71, 7))
>b : Symbol(b, Decl(controlFlowAssignmentPatternOrder.ts, 72, 7))
>a : Symbol(a, Decl(controlFlowAssignmentPatternOrder.ts, 71, 7))
>const : Symbol(const)
>const : Symbol(const)
const bb: 0 | 8 = b;
>bb : Symbol(bb, Decl(controlFlowAssignmentPatternOrder.ts, 74, 9))

View File

@ -8,6 +8,7 @@
>a : Symbol(a, Decl(controlFlowBindingPatternOrder.ts, 2, 7))
>b : Symbol(b, Decl(controlFlowBindingPatternOrder.ts, 3, 12))
>a : Symbol(a, Decl(controlFlowBindingPatternOrder.ts, 2, 7))
>const : Symbol(const)
const bb: 0 = b;
>bb : Symbol(bb, Decl(controlFlowBindingPatternOrder.ts, 4, 9))
@ -21,6 +22,7 @@
>a : Symbol(a, Decl(controlFlowBindingPatternOrder.ts, 7, 7))
>b : Symbol(b, Decl(controlFlowBindingPatternOrder.ts, 8, 12))
>a : Symbol(a, Decl(controlFlowBindingPatternOrder.ts, 7, 7))
>const : Symbol(const)
const bb: 9 = b;
>bb : Symbol(bb, Decl(controlFlowBindingPatternOrder.ts, 9, 9))
@ -34,6 +36,8 @@
>a : Symbol(a, Decl(controlFlowBindingPatternOrder.ts, 12, 7))
>b : Symbol(b, Decl(controlFlowBindingPatternOrder.ts, 13, 12))
>a : Symbol(a, Decl(controlFlowBindingPatternOrder.ts, 12, 7))
>const : Symbol(const)
>const : Symbol(const)
const bb: 0 | 8 = b;
>bb : Symbol(bb, Decl(controlFlowBindingPatternOrder.ts, 14, 9))
@ -47,6 +51,8 @@
>a : Symbol(a, Decl(controlFlowBindingPatternOrder.ts, 17, 7))
>b : Symbol(b, Decl(controlFlowBindingPatternOrder.ts, 18, 12))
>a : Symbol(a, Decl(controlFlowBindingPatternOrder.ts, 17, 7))
>const : Symbol(const)
>const : Symbol(const)
const bb: 0 | 8 = b;
>bb : Symbol(bb, Decl(controlFlowBindingPatternOrder.ts, 19, 9))

View File

@ -4,5 +4,6 @@ export interface Test {
[index: TypeNotFound]: any;
>index : Symbol(index, Decl(declarationEmitIndexTypeNotFound.ts, 1, 5))
>TypeNotFound : Symbol(TypeNotFound)
}

View File

@ -1,6 +1,6 @@
=== tests/cases/compiler/declarationEmitIndexTypeNotFound.ts ===
export interface Test {
[index: TypeNotFound]: any;
>index : any
>index : TypeNotFound
}

View File

@ -5,12 +5,14 @@ export interface Foo {
preFetch: <T1 extends T2> (c: T1) => void; // Type T2 is not defined
>preFetch : Symbol(Foo.preFetch, Decl(declarationEmitLambdaWithMissingTypeParameterNoCrash.ts, 0, 22))
>T1 : Symbol(T1, Decl(declarationEmitLambdaWithMissingTypeParameterNoCrash.ts, 1, 15))
>T2 : Symbol(T2)
>c : Symbol(c, Decl(declarationEmitLambdaWithMissingTypeParameterNoCrash.ts, 1, 31))
>T1 : Symbol(T1, Decl(declarationEmitLambdaWithMissingTypeParameterNoCrash.ts, 1, 15))
preFetcher: new <T1 extends T2> (c: T1) => void; // Type T2 is not defined
>preFetcher : Symbol(Foo.preFetcher, Decl(declarationEmitLambdaWithMissingTypeParameterNoCrash.ts, 1, 46))
>T1 : Symbol(T1, Decl(declarationEmitLambdaWithMissingTypeParameterNoCrash.ts, 2, 21))
>T2 : Symbol(T2)
>c : Symbol(c, Decl(declarationEmitLambdaWithMissingTypeParameterNoCrash.ts, 2, 37))
>T1 : Symbol(T1, Decl(declarationEmitLambdaWithMissingTypeParameterNoCrash.ts, 2, 21))
}

View File

@ -1,11 +1,11 @@
=== tests/cases/compiler/declarationEmitLambdaWithMissingTypeParameterNoCrash.ts ===
export interface Foo {
preFetch: <T1 extends T2> (c: T1) => void; // Type T2 is not defined
>preFetch : <T1 extends any>(c: T1) => void
>preFetch : <T1 extends T2>(c: T1) => void
>c : T1
preFetcher: new <T1 extends T2> (c: T1) => void; // Type T2 is not defined
>preFetcher : new <T1 extends any>(c: T1) => void
>preFetcher : new <T1 extends T2>(c: T1) => void
>c : T1
}

View File

@ -12,5 +12,6 @@ export type RowToColumns<TColumns> = {
[TName in StringKeyOf<TColumns>]: any;
>TName : Symbol(TName, Decl(FromFactor.ts, 1, 5))
>StringKeyOf : Symbol(StringKeyOf)
>TColumns : Symbol(TColumns, Decl(FromFactor.ts, 0, 25))
}

View File

@ -2,4 +2,5 @@
type A<T extends Unknown> = {}
>A : Symbol(A, Decl(declarationEmitTypeAliasTypeParameterExtendingUnknownSymbol.ts, 0, 0))
>T : Symbol(T, Decl(declarationEmitTypeAliasTypeParameterExtendingUnknownSymbol.ts, 0, 7))
>Unknown : Symbol(Unknown)

View File

@ -5,5 +5,6 @@ export class B {
@Decorate
member: Map<string, number>;
>member : Symbol(B.member, Decl(decoratorMetadataNoLibIsolatedModulesTypes.ts, 0, 16))
>Map : Symbol(Map)
}

View File

@ -6,6 +6,6 @@ export class B {
>Decorate : any
member: Map<string, number>;
>member : any
>member : Map<string, number>
}

View File

@ -27,12 +27,12 @@ class MyClass {
db: db.db;
>db : Symbol(MyClass.db, Decl(service.ts, 5, 15))
>db : Symbol(db, Decl(service.ts, 0, 6))
>db : Symbol(db)
>db : Symbol(db.db)
constructor(db: db.db) {
>db : Symbol(db, Decl(service.ts, 8, 16))
>db : Symbol(db, Decl(service.ts, 0, 6))
>db : Symbol(db)
>db : Symbol(db.db)
this.db = db;
>this.db : Symbol(MyClass.db, Decl(service.ts, 5, 15))

View File

@ -25,26 +25,26 @@ class MyClass {
>MyClass : MyClass
db: db.db;
>db : any
>db : db.db
>db : any
constructor(db: db.db) {
>db : any
>db : db.db
>db : any
this.db = db;
>this.db = db : any
>this.db : any
>this.db = db : db.db
>this.db : db.db
>this : this
>db : any
>db : any
>db : db.db
>db : db.db
this.db.doSomething();
>this.db.doSomething() : any
>this.db.doSomething : any
>this.db : any
>this.db : db.db
>this : this
>db : any
>db : db.db
>doSomething : any
}
}

View File

@ -26,9 +26,13 @@ class MyClass {
db: db.db; //error
>db : Symbol(MyClass.db, Decl(service.ts, 5, 15))
>db : Symbol(db)
>db : Symbol(db.db)
constructor(db: db.db) { // error
>db : Symbol(db, Decl(service.ts, 8, 16))
>db : Symbol(db)
>db : Symbol(db.db)
this.db = db;
>this.db : Symbol(MyClass.db, Decl(service.ts, 5, 15))

View File

@ -25,26 +25,26 @@ class MyClass {
>MyClass : MyClass
db: db.db; //error
>db : any
>db : db.db
>db : any
constructor(db: db.db) { // error
>db : any
>db : db.db
>db : any
this.db = db;
>this.db = db : any
>this.db : any
>this.db = db : db.db
>this.db : db.db
>this : this
>db : any
>db : any
>db : db.db
>db : db.db
this.db.doSomething();
>this.db.doSomething() : any
>this.db.doSomething : any
>this.db : any
>this.db : db.db
>this : this
>db : any
>db : db.db
>doSomething : any
}
}

View File

@ -43,7 +43,7 @@ var x: Entity;
var y: Entity.I;
>y : Symbol(y, Decl(m2.ts, 5, 3))
>Entity : Symbol(Entity, Decl(m2.ts, 0, 6))
>I : Symbol(Entity)
>I : Symbol(Entity.I)
Entity.x;
>Entity : Symbol(Entity, Decl(m2.ts, 0, 6))

View File

@ -38,10 +38,10 @@ Entity();
>Entity : any
var x: Entity;
>x : any
>x : Entity
var y: Entity.I;
>y : any
>y : Entity.I
>Entity : any
Entity.x;

View File

@ -35,7 +35,7 @@ var x: Entity;
var y: Entity.I;
>y : Symbol(y, Decl(m2.ts, 5, 3))
>Entity : Symbol(Entity, Decl(m2.ts, 0, 6))
>I : Symbol(Entity)
>I : Symbol(Entity.I)
var z = new Entity();
>z : Symbol(z, Decl(m2.ts, 6, 3))

View File

@ -25,10 +25,10 @@ Entity();
>Entity : any
var x: Entity;
>x : any
>x : Entity
var y: Entity.I;
>y : any
>y : Entity.I
>Entity : any
var z = new Entity();

View File

@ -35,7 +35,7 @@ var x: Entity;
var y: Entity.I;
>y : Symbol(y, Decl(m2.ts, 5, 3))
>Entity : Symbol(Entity, Decl(m2.ts, 0, 6))
>I : Symbol(Entity)
>I : Symbol(Entity.I)
var z = new Entity();
>z : Symbol(z, Decl(m2.ts, 6, 3))

View File

@ -25,10 +25,10 @@ Entity();
>Entity : any
var x: Entity;
>x : any
>x : Entity
var y: Entity.I;
>y : any
>y : Entity.I
>Entity : any
var z = new Entity();

Some files were not shown because too many files have changed in this diff Show More