Merge branch 'master' into templates

Conflicts:
	src/compiler/checker.ts
	src/services/services.ts
This commit is contained in:
Daniel Rosenwasser 2014-10-28 18:49:35 -07:00
commit d522c88295
409 changed files with 5105 additions and 4570 deletions

View File

@ -130,6 +130,7 @@ module ts {
var emptyObjectType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined);
var anyFunctionType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined);
var noConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined);
var inferenceFailureType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined);
var anySignature = createSignature(undefined, undefined, emptyArray, anyType, 0, false, false);
var unknownSignature = createSignature(undefined, undefined, emptyArray, unknownType, 0, false, false);
@ -3169,33 +3170,39 @@ module ts {
var identityRelation: Map<boolean> = {};
function isTypeIdenticalTo(source: Type, target: Type): boolean {
return checkTypeRelatedTo(source, target, identityRelation, /*errorNode*/ undefined, /*chainedMessage*/ undefined, /*terminalMessage*/ undefined);
return checkTypeRelatedTo(source, target, identityRelation, /*errorNode*/ undefined);
}
function isTypeSubtypeOf(source: Type, target: Type): boolean {
return checkTypeSubtypeOf(source, target, /*errorNode*/ undefined, /*chainedMessage*/ undefined, /*terminalMessage*/ undefined);
return checkTypeSubtypeOf(source, target, /*errorNode*/ undefined);
}
function checkTypeSubtypeOf(source: Type, target: Type, errorNode: Node, chainedMessage: DiagnosticMessage, terminalMessage: DiagnosticMessage): boolean {
return checkTypeRelatedTo(source, target, subtypeRelation, errorNode, chainedMessage, terminalMessage);
function checkTypeSubtypeOf(
source: Type,
target: Type,
errorNode: Node,
headMessage?: DiagnosticMessage,
containingMessageChain?: DiagnosticMessageChain): boolean {
return checkTypeRelatedTo(source, target, subtypeRelation, errorNode, headMessage, containingMessageChain);
}
function isTypeAssignableTo(source: Type, target: Type): boolean {
return checkTypeAssignableTo(source, target, /*errorNode*/ undefined, /*chainedMessage*/ undefined, /*terminalMessage*/ undefined);
return checkTypeAssignableTo(source, target, /*errorNode*/ undefined);
}
function checkTypeAssignableTo(source: Type, target: Type, errorNode: Node, chainedMessage: DiagnosticMessage, terminalMessage: DiagnosticMessage): boolean {
return checkTypeRelatedTo(source, target, assignableRelation, errorNode, chainedMessage, terminalMessage);
function checkTypeAssignableTo(source: Type, target: Type, errorNode: Node, headMessage?: DiagnosticMessage): boolean {
return checkTypeRelatedTo(source, target, assignableRelation, errorNode, headMessage);
}
function isTypeRelatedTo(source: Type, target: Type, relation: Map<boolean>): boolean {
return checkTypeRelatedTo(source, target, relation, /*errorNode*/ undefined, /*chainedMessage*/ undefined, /*terminalMessage*/ undefined);
return checkTypeRelatedTo(source, target, relation, /*errorNode*/ undefined);
}
function isSignatureAssignableTo(source: Signature, target: Signature): boolean {
var sourceType = getOrCreateTypeFromSignature(source);
var targetType = getOrCreateTypeFromSignature(target);
return checkTypeRelatedTo(sourceType, targetType, assignableRelation, /*errorNode*/ undefined, /*chainedMessage*/ undefined, /*terminalMessage*/ undefined);
return checkTypeRelatedTo(sourceType, targetType, assignableRelation, /*errorNode*/ undefined);
}
function isPropertyIdenticalTo(sourceProp: Symbol, targetProp: Symbol): boolean {
@ -3229,7 +3236,7 @@ module ts {
var typeName2 = typeToString(base);
var errorInfo = chainDiagnosticMessages(undefined, Diagnostics.Named_properties_0_of_types_1_and_2_are_not_identical, prop.name, typeName1, typeName2);
errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Interface_0_cannot_simultaneously_extend_types_1_and_2_Colon, typeToString(type), typeName1, typeName2);
errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Interface_0_cannot_simultaneously_extend_types_1_and_2, typeToString(type), typeName1, typeName2);
addDiagnostic(createDiagnosticForNodeFromMessageChain(typeNode, errorInfo, program.getCompilerHost().getNewLine()));
}
}
@ -3259,7 +3266,14 @@ module ts {
}
}
function checkTypeRelatedTo(source: Type, target: Type, relation: Map<boolean>, errorNode: Node, chainedMessage: DiagnosticMessage, terminalMessage: DiagnosticMessage): boolean {
function checkTypeRelatedTo(
source: Type,
target: Type,
relation: Map<boolean>,
errorNode: Node,
headMessage?: DiagnosticMessage,
containingMessageChain?: DiagnosticMessageChain): boolean {
var errorInfo: DiagnosticMessageChain;
var sourceStack: ObjectType[];
var targetStack: ObjectType[];
@ -3269,11 +3283,14 @@ module ts {
Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking");
var result = isRelatedToWithCustomErrors(source, target, errorNode !== undefined, chainedMessage, terminalMessage);
var result = isRelatedToWithCustomErrors(source, target, errorNode !== undefined, headMessage);
if (overflow) {
error(errorNode, Diagnostics.Excessive_stack_depth_comparing_types_0_and_1, typeToString(source), typeToString(target));
}
else if (errorInfo) {
if (containingMessageChain) {
errorInfo = concatenateDiagnosticMessageChains(containingMessageChain, errorInfo);
}
addDiagnostic(createDiagnosticForNodeFromMessageChain(errorNode, errorInfo, program.getCompilerHost().getNewLine()));
}
return result;
@ -3283,10 +3300,10 @@ module ts {
}
function isRelatedTo(source: Type, target: Type, reportErrors?: boolean): boolean {
return isRelatedToWithCustomErrors(source, target, reportErrors, /*chainedMessage*/ undefined, /*terminalMessage*/ undefined);
return isRelatedToWithCustomErrors(source, target, reportErrors, /*headMessage*/ undefined);
}
function isRelatedToWithCustomErrors(source: Type, target: Type, reportErrors: boolean, chainedMessage: DiagnosticMessage, terminalMessage: DiagnosticMessage): boolean {
function isRelatedToWithCustomErrors(source: Type, target: Type, reportErrors: boolean, headMessage: DiagnosticMessage): boolean {
if (relation === identityRelation) {
// both types are the same - covers 'they are the same primitive type or both are Any' or the same type parameter cases
if (source === target) return true;
@ -3338,15 +3355,8 @@ module ts {
}
}
if (reportErrors) {
// The error should end in a period when this is the deepest error in the chain
// (when errorInfo is undefined). Otherwise, it has a colon before the nested
// error.
chainedMessage = chainedMessage || Diagnostics.Type_0_is_not_assignable_to_type_1_Colon;
terminalMessage = terminalMessage || Diagnostics.Type_0_is_not_assignable_to_type_1;
var diagnosticKey = errorInfo ? chainedMessage : terminalMessage;
Debug.assert(diagnosticKey !== undefined);
reportError(diagnosticKey, typeToString(source), typeToString(target));
headMessage = headMessage || Diagnostics.Type_0_is_not_assignable_to_type_1;
reportError(headMessage, typeToString(source), typeToString(target));
}
return false;
}
@ -3526,7 +3536,7 @@ module ts {
}
if (!isRelatedTo(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors)) {
if (reportErrors) {
reportError(Diagnostics.Types_of_property_0_are_incompatible_Colon, symbolToString(targetProp));
reportError(Diagnostics.Types_of_property_0_are_incompatible, symbolToString(targetProp));
}
return false;
}
@ -3632,7 +3642,7 @@ module ts {
if (!isRelatedTo(s, t, reportErrors)) {
if (!isRelatedTo(t, s, false)) {
if (reportErrors) {
reportError(Diagnostics.Types_of_parameters_0_and_1_are_incompatible_Colon,
reportError(Diagnostics.Types_of_parameters_0_and_1_are_incompatible,
source.parameters[i < sourceMax ? i : sourceMax].name,
target.parameters[i < targetMax ? i : targetMax].name);
}
@ -3676,7 +3686,7 @@ module ts {
}
if (!isRelatedTo(sourceType, targetType, reportErrors)) {
if (reportErrors) {
reportError(Diagnostics.Index_signatures_are_incompatible_Colon);
reportError(Diagnostics.Index_signatures_are_incompatible);
}
return false;
}
@ -3707,7 +3717,7 @@ module ts {
}
if (!compatible) {
if (reportErrors) {
reportError(Diagnostics.Index_signatures_are_incompatible_Colon);
reportError(Diagnostics.Index_signatures_are_incompatible);
}
return false;
}
@ -3769,6 +3779,42 @@ module ts {
return forEach(types, t => isSupertypeOfEach(t, types) ? t : undefined);
}
function reportNoCommonSupertypeError(types: Type[], errorLocation: Node, errorMessageChainHead: DiagnosticMessageChain): void {
var bestSupertype: Type;
var bestSupertypeDownfallType: Type; // The type that caused bestSupertype not to be the common supertype
var bestSupertypeScore = 0;
for (var i = 0; i < types.length; i++) {
var score = 0;
var downfallType: Type = undefined;
for (var j = 0; j < types.length; j++) {
if (isTypeSubtypeOf(types[j], types[i])) {
score++;
}
else if (!downfallType) {
downfallType = types[j];
}
}
if (score > bestSupertypeScore) {
bestSupertype = types[i];
bestSupertypeDownfallType = downfallType;
bestSupertypeScore = score;
}
// types.length - 1 is the maximum score, given that getCommonSupertype returned false
if (bestSupertypeScore === types.length - 1) {
break;
}
}
// In the following errors, the {1} slot is before the {0} slot because checkTypeSubtypeOf supplies the
// subtype as the first argument to the error
checkTypeSubtypeOf(bestSupertypeDownfallType, bestSupertype, errorLocation,
Diagnostics.Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0,
errorMessageChainHead);
}
function isTypeOfObjectLiteral(type: Type): boolean {
return (type.flags & TypeFlags.Anonymous) && type.symbol && (type.symbol.flags & SymbolFlags.ObjectLiteral) ? true : false;
}
@ -4025,30 +4071,33 @@ module ts {
}
function getInferredType(context: InferenceContext, index: number): Type {
var result = context.inferredTypes[index];
if (!result) {
var inferredType = context.inferredTypes[index];
if (!inferredType) {
var inferences = context.inferences[index];
if (inferences.length) {
// Infer widened union or supertype, or the undefined type for no common supertype
var unionOrSuperType = context.inferUnionTypes ? getUnionType(inferences) : getCommonSupertype(inferences);
var inferredType = unionOrSuperType ? getWidenedType(unionOrSuperType) : undefinedType;
inferredType = unionOrSuperType ? getWidenedType(unionOrSuperType) : inferenceFailureType;
}
else {
// Infer the empty object type when no inferences were made
inferredType = emptyObjectType;
}
var constraint = getConstraintOfTypeParameter(context.typeParameters[index]);
var result = constraint && !isTypeAssignableTo(inferredType, constraint) ? constraint : inferredType;
context.inferredTypes[index] = result;
if (inferredType !== inferenceFailureType) {
var constraint = getConstraintOfTypeParameter(context.typeParameters[index]);
inferredType = constraint && !isTypeAssignableTo(inferredType, constraint) ? constraint : inferredType;
}
context.inferredTypes[index] = inferredType;
}
return result;
return inferredType;
}
function getInferredTypes(context: InferenceContext): Type[] {
for (var i = 0; i < context.inferredTypes.length; i++) {
getInferredType(context, i);
}
context.inferences = undefined;
return context.inferredTypes;
}
@ -5098,7 +5147,7 @@ module ts {
return getSignatureInstantiation(signature, getInferredTypes(context));
}
function inferTypeArguments(signature: Signature, args: Expression[], excludeArgument?: boolean[]): Type[] {
function inferTypeArguments(signature: Signature, args: Expression[], excludeArgument?: boolean[]): InferenceContext {
var typeParameters = signature.typeParameters;
var context = createInferenceContext(typeParameters, /*inferUnionTypes*/ false);
var mapper = createInferenceMapper(context);
@ -5125,23 +5174,36 @@ module ts {
}
}
var inferredTypes = getInferredTypes(context);
// Inference has failed if the undefined type is in list of inferences
return contains(inferredTypes, undefinedType) ? undefined : inferredTypes;
// Inference has failed if the inferenceFailureType type is in list of inferences
context.failedTypeParameterIndex = indexOf(inferredTypes, inferenceFailureType);
// Wipe out the inferenceFailureType from the array so that error recovery can work properly
for (var i = 0; i < inferredTypes.length; i++) {
if (inferredTypes[i] === inferenceFailureType) {
inferredTypes[i] = unknownType;
}
}
return context;
}
function checkTypeArguments(signature: Signature, typeArguments: TypeNode[]): Type[] {
function checkTypeArguments(signature: Signature, typeArguments: TypeNode[], typeArgumentResultTypes: Type[], reportErrors: boolean): boolean {
var typeParameters = signature.typeParameters;
var result: Type[] = [];
var typeArgumentsAreAssignable = true;
for (var i = 0; i < typeParameters.length; i++) {
var typeArgNode = typeArguments[i];
var typeArgument = getTypeFromTypeNode(typeArgNode);
var constraint = getConstraintOfTypeParameter(typeParameters[i]);
if (constraint && fullTypeCheck) {
checkTypeAssignableTo(typeArgument, constraint, typeArgNode, Diagnostics.Type_0_does_not_satisfy_the_constraint_1_Colon, Diagnostics.Type_0_does_not_satisfy_the_constraint_1);
// Do not push on this array! It has a preallocated length
typeArgumentResultTypes[i] = typeArgument;
if (typeArgumentsAreAssignable /* so far */) {
var constraint = getConstraintOfTypeParameter(typeParameters[i]);
if (constraint) {
typeArgumentsAreAssignable = checkTypeAssignableTo(typeArgument, constraint, reportErrors ? typeArgNode : undefined,
Diagnostics.Type_0_does_not_satisfy_the_constraint_1);
}
}
result.push(typeArgument);
}
return result;
return typeArgumentsAreAssignable;
}
function checkApplicableSignature(node: CallExpression, signature: Signature, relation: Map<boolean>, excludeArgument: boolean[], reportErrors: boolean) {
@ -5158,7 +5220,6 @@ module ts {
checkExpressionWithContextualType(arg, paramType, excludeArgument && excludeArgument[i] ? identityMapper : undefined);
// Use argument expression as error location when reporting errors
var isValidArgument = checkTypeRelatedTo(argType, paramType, relation, reportErrors ? arg : undefined,
Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1,
Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1);
if (!isValidArgument) {
return false;
@ -5185,47 +5246,84 @@ module ts {
excludeArgument[i] = true;
}
}
var relation = candidates.length === 1 ? assignableRelation : subtypeRelation;
var lastCandidate: Signature;
while (true) {
for (var i = 0; i < candidates.length; i++) {
if (!signatureHasCorrectArity(node, candidates[i])) {
continue;
}
while (true) {
var candidate = candidates[i];
if (candidate.typeParameters) {
var typeArguments = node.typeArguments ?
checkTypeArguments(candidate, node.typeArguments) :
inferTypeArguments(candidate, args, excludeArgument);
if (!typeArguments) {
break;
}
candidate = getSignatureInstantiation(candidate, typeArguments);
}
lastCandidate = candidate;
if (!checkApplicableSignature(node, candidate, relation, excludeArgument, /*reportErrors*/ false)) {
break;
}
var index = excludeArgument ? indexOf(excludeArgument, true) : -1;
if (index < 0) {
return candidate;
}
excludeArgument[index] = false;
}
}
if (relation === assignableRelation) {
break;
}
relation = assignableRelation;
// The following variables are captured and modified by calls to chooseOverload.
// If overload resolution or type argument inference fails, we want to report the
// best error possible. The best error is one which says that an argument was not
// assignable to a parameter. This implies that everything else about the overload
// was fine. So if there is any overload that is only incorrect because of an
// argument, we will report an error on that one.
//
// function foo(s: string) {}
// function foo(n: number) {} // Report argument error on this overload
// function foo() {}
// foo(true);
//
// If none of the overloads even made it that far, there are two possibilities.
// There was a problem with type arguments for some overload, in which case
// report an error on that. Or none of the overloads even had correct arity,
// in which case give an arity error.
//
// function foo<T>(x: T, y: T) {} // Report type argument inference error
// function foo() {}
// foo(0, true);
//
var candidateForArgumentError: Signature;
var candidateForTypeArgumentError: Signature;
var resultOfFailedInference: InferenceContext;
var result: Signature;
// Section 4.12.1:
// if the candidate list contains one or more signatures for which the type of each argument
// expression is a subtype of each corresponding parameter type, the return type of the first
// of those signatures becomes the return type of the function call.
// Otherwise, the return type of the first signature in the candidate list becomes the return
// type of the function call.
//
// Whether the call is an error is determined by assignability of the arguments. The subtype pass
// is just important for choosing the best signature. So in the case where there is only one
// signature, the subtype pass is useless. So skipping it is an optimization.
if (candidates.length > 1) {
result = chooseOverload(candidates, subtypeRelation, excludeArgument);
}
if (!result) {
// Reinitialize these pointers for round two
candidateForArgumentError = undefined;
candidateForTypeArgumentError = undefined;
resultOfFailedInference = undefined;
result = chooseOverload(candidates, assignableRelation, excludeArgument);
}
if (result) {
return result;
}
// No signatures were applicable. Now report errors based on the last applicable signature with
// no arguments excluded from assignability checks.
// If candidate is undefined, it means that no candidates had a suitable arity. In that case,
// skip the checkApplicableSignature check.
if (lastCandidate) {
checkApplicableSignature(node, lastCandidate, relation, /*excludeArgument*/ undefined, /*reportErrors*/ true);
if (candidateForArgumentError) {
// excludeArgument is undefined, in this case also equivalent to [undefined, undefined, ...]
// The importance of excludeArgument is to prevent us from typing function expression parameters
// in arguments too early. If possible, we'd like to only type them once we know the correct
// overload. However, this matters for the case where the call is correct. When the call is
// an error, we don't need to exclude any arguments, although it would cause no harm to do so.
checkApplicableSignature(node, candidateForArgumentError, assignableRelation, /*excludeArgument*/ undefined, /*reportErrors*/ true);
}
else if (candidateForTypeArgumentError) {
if (node.typeArguments) {
checkTypeArguments(candidateForTypeArgumentError, node.typeArguments, [], /*reportErrors*/ true)
}
else {
Debug.assert(resultOfFailedInference.failedTypeParameterIndex >= 0);
var failedTypeParameter = candidateForTypeArgumentError.typeParameters[resultOfFailedInference.failedTypeParameterIndex];
var inferenceCandidates = resultOfFailedInference.inferences[resultOfFailedInference.failedTypeParameterIndex];
var diagnosticChainHead = chainDiagnosticMessages(/*details*/ undefined, // details will be provided by call to reportNoCommonSupertypeError
Diagnostics.The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly,
typeToString(failedTypeParameter));
reportNoCommonSupertypeError(inferenceCandidates, node.func, diagnosticChainHead);
}
}
else {
error(node, Diagnostics.Supplied_parameters_do_not_match_any_signature_of_call_target);
@ -5246,6 +5344,70 @@ module ts {
return resolveErrorCall(node);
function chooseOverload(candidates: Signature[], relation: Map<boolean>, excludeArgument: boolean[]) {
for (var i = 0; i < candidates.length; i++) {
if (!signatureHasCorrectArity(node, candidates[i])) {
continue;
}
var originalCandidate = candidates[i];
var inferenceResult: InferenceContext;
while (true) {
var candidate = originalCandidate;
if (candidate.typeParameters) {
var typeArgumentTypes: Type[];
var typeArgumentsAreValid: boolean;
if (node.typeArguments) {
typeArgumentTypes = new Array<Type>(candidate.typeParameters.length);
typeArgumentsAreValid = checkTypeArguments(candidate, node.typeArguments, typeArgumentTypes, /*reportErrors*/ false)
}
else {
inferenceResult = inferTypeArguments(candidate, args, excludeArgument);
typeArgumentsAreValid = inferenceResult.failedTypeParameterIndex < 0;
typeArgumentTypes = inferenceResult.inferredTypes;
}
if (!typeArgumentsAreValid) {
break;
}
candidate = getSignatureInstantiation(candidate, typeArgumentTypes);
}
if (!checkApplicableSignature(node, candidate, relation, excludeArgument, /*reportErrors*/ false)) {
break;
}
var index = excludeArgument ? indexOf(excludeArgument, true) : -1;
if (index < 0) {
return candidate;
}
excludeArgument[index] = false;
}
// A post-mortem of this iteration of the loop. The signature was not applicable,
// so we want to track it as a candidate for reporting an error. If the candidate
// had no type parameters, or had no issues related to type arguments, we can
// report an error based on the arguments. If there was an issue with type
// arguments, then we can only report an error based on the type arguments.
if (originalCandidate.typeParameters) {
var instantiatedCandidate = candidate;
if (typeArgumentsAreValid) {
candidateForArgumentError = instantiatedCandidate;
}
else {
candidateForTypeArgumentError = originalCandidate;
if (!node.typeArguments) {
resultOfFailedInference = inferenceResult;
}
}
}
else {
Debug.assert(originalCandidate === candidate);
candidateForArgumentError = originalCandidate;
}
}
return undefined;
}
// The candidate list orders groups in reverse, but within a group signatures are kept in declaration order
// A nit here is that we reorder only signatures that belong to the same symbol,
// so order how inherited signatures are processed is still preserved.
@ -5441,7 +5603,7 @@ module ts {
if (fullTypeCheck && targetType !== unknownType) {
var widenedType = getWidenedType(exprType, /*supressNoImplicitAnyErrors*/ true);
if (!(isTypeAssignableTo(targetType, widenedType))) {
checkTypeAssignableTo(exprType, targetType, node, Diagnostics.Neither_type_0_nor_type_1_is_assignable_to_the_other_Colon, Diagnostics.Neither_type_0_nor_type_1_is_assignable_to_the_other);
checkTypeAssignableTo(exprType, targetType, node, Diagnostics.Neither_type_0_nor_type_1_is_assignable_to_the_other);
}
}
return targetType;
@ -5622,7 +5784,7 @@ module ts {
else {
var exprType = checkExpression(node.body);
if (node.type) {
checkTypeAssignableTo(exprType, getTypeFromTypeNode(node.type), node.body, undefined, undefined);
checkTypeAssignableTo(exprType, getTypeFromTypeNode(node.type), node.body, /*headMessage*/ undefined);
}
checkFunctionExpressionBodies(node.body);
}
@ -5928,7 +6090,7 @@ module ts {
// Use default messages
if (ok) {
// to avoid cascading errors check assignability only if 'isReference' check succeeded and no errors were reported
checkTypeAssignableTo(valueType, leftType, node.left, /*chainedMessage*/ undefined, /*terminalMessage*/ undefined);
checkTypeAssignableTo(valueType, leftType, node.left, /*headMessage*/ undefined);
}
}
}
@ -6327,7 +6489,7 @@ module ts {
var constraint = getConstraintOfTypeParameter((<TypeReference>type).target.typeParameters[i]);
if (fullTypeCheck && constraint) {
var typeArgument = (<TypeReference>type).typeArguments[i];
checkTypeAssignableTo(typeArgument, constraint, node, Diagnostics.Type_0_does_not_satisfy_the_constraint_1_Colon, Diagnostics.Type_0_does_not_satisfy_the_constraint_1);
checkTypeAssignableTo(typeArgument, constraint, node, Diagnostics.Type_0_does_not_satisfy_the_constraint_1);
}
}
}
@ -6969,7 +7131,7 @@ module ts {
if (node.initializer) {
if (!(getNodeLinks(node.initializer).flags & NodeCheckFlags.TypeChecked)) {
// Use default messages
checkTypeAssignableTo(checkAndMarkExpression(node.initializer), type, node, /*chainedMessage*/ undefined, /*terminalMessage*/ undefined);
checkTypeAssignableTo(checkAndMarkExpression(node.initializer), type, node, /*headMessage*/ undefined);
}
checkCollisionWithConstDeclarations(node);
}
@ -7082,7 +7244,7 @@ module ts {
func.type ||
(func.kind === SyntaxKind.GetAccessor && getSetAccessorTypeAnnotationNode(<AccessorDeclaration>getDeclarationOfKind(func.symbol, SyntaxKind.SetAccessor)));
if (checkAssignability) {
checkTypeAssignableTo(checkExpression(node.expression), returnType, node.expression, /*chainedMessage*/ undefined, /*terminalMessage*/ undefined);
checkTypeAssignableTo(checkExpression(node.expression), returnType, node.expression, /*headMessage*/ undefined);
}
else if (func.kind == SyntaxKind.Constructor) {
// constructor doesn't have explicit return type annotation and yet its return type is known - declaring type
@ -7110,7 +7272,7 @@ module ts {
var caseType = checkExpression(clause.expression);
if (!isTypeAssignableTo(expressionType, caseType)) {
// check 'expressionType isAssignableTo caseType' failed, try the reversed check and report errors if it fails
checkTypeAssignableTo(caseType, expressionType, clause.expression, /*chainedMessage*/ undefined, /*terminalMessage*/ undefined);
checkTypeAssignableTo(caseType, expressionType, clause.expression, /*headMessage*/ undefined);
}
}
checkBlock(clause);
@ -7247,10 +7409,10 @@ module ts {
if (type.baseTypes.length) {
if (fullTypeCheck) {
var baseType = type.baseTypes[0];
checkTypeAssignableTo(type, baseType, node.name, Diagnostics.Class_0_incorrectly_extends_base_class_1_Colon, Diagnostics.Class_0_incorrectly_extends_base_class_1);
checkTypeAssignableTo(type, baseType, node.name, Diagnostics.Class_0_incorrectly_extends_base_class_1);
var staticBaseType = getTypeOfSymbol(baseType.symbol);
checkTypeAssignableTo(staticType, getTypeWithoutConstructors(staticBaseType), node.name,
Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1_Colon, Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1);
Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1);
if (baseType.symbol !== resolveEntityName(node, node.baseType.typeName, SymbolFlags.Value)) {
error(node.baseType, Diagnostics.Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0, typeToString(baseType));
}
@ -7269,7 +7431,7 @@ module ts {
if (t !== unknownType) {
var declaredType = (t.flags & TypeFlags.Reference) ? (<TypeReference>t).target : t;
if (declaredType.flags & (TypeFlags.Class | TypeFlags.Interface)) {
checkTypeAssignableTo(type, t, node.name, Diagnostics.Class_0_incorrectly_implements_interface_1_Colon, Diagnostics.Class_0_incorrectly_implements_interface_1);
checkTypeAssignableTo(type, t, node.name, Diagnostics.Class_0_incorrectly_implements_interface_1);
}
else {
error(typeRefNode, Diagnostics.A_class_may_only_implement_another_class_or_interface);
@ -7414,7 +7576,7 @@ module ts {
// run subsequent checks only if first set succeeded
if (checkInheritedPropertiesAreIdentical(type, node.name)) {
forEach(type.baseTypes, baseType => {
checkTypeAssignableTo(type, baseType, node.name, Diagnostics.Interface_0_incorrectly_extends_interface_1_Colon, Diagnostics.Interface_0_incorrectly_extends_interface_1);
checkTypeAssignableTo(type, baseType, node.name , Diagnostics.Interface_0_incorrectly_extends_interface_1);
});
checkIndexConstraints(type);
}
@ -7466,7 +7628,7 @@ module ts {
// If it is a constant value (not undefined), it is syntactically constrained to be a number.
// Also, we do not need to check this for ambients because there is already
// a syntax error if it is not a constant.
checkTypeAssignableTo(checkExpression(initializer), enumType, initializer, /*chainedMessage*/ undefined, /*terminalMessage*/ undefined);
checkTypeAssignableTo(checkExpression(initializer), enumType, initializer, /*headMessage*/ undefined);
}
}
else if (ambient) {

View File

@ -281,6 +281,12 @@ module ts {
};
}
export function concatenateDiagnosticMessageChains(headChain: DiagnosticMessageChain, tailChain: DiagnosticMessageChain): DiagnosticMessageChain {
Debug.assert(!headChain.next);
headChain.next = tailChain;
return headChain;
}
export function flattenDiagnosticChain(file: SourceFile, start: number, length: number, diagnosticChain: DiagnosticMessageChain, newLine: string): Diagnostic {
Debug.assert(start >= 0, "start must be non-negative, is " + start);
Debug.assert(length >= 0, "length must be non-negative, is " + length);

View File

@ -142,17 +142,16 @@ module ts {
Global_type_0_must_have_1_type_parameter_s: { code: 2317, category: DiagnosticCategory.Error, key: "Global type '{0}' must have {1} type parameter(s)." },
Cannot_find_global_type_0: { code: 2318, category: DiagnosticCategory.Error, key: "Cannot find global type '{0}'." },
Named_properties_0_of_types_1_and_2_are_not_identical: { code: 2319, category: DiagnosticCategory.Error, key: "Named properties '{0}' of types '{1}' and '{2}' are not identical." },
Interface_0_cannot_simultaneously_extend_types_1_and_2_Colon: { code: 2320, category: DiagnosticCategory.Error, key: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}':" },
Interface_0_cannot_simultaneously_extend_types_1_and_2: { code: 2320, category: DiagnosticCategory.Error, key: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'." },
Excessive_stack_depth_comparing_types_0_and_1: { code: 2321, category: DiagnosticCategory.Error, key: "Excessive stack depth comparing types '{0}' and '{1}'." },
Type_0_is_not_assignable_to_type_1_Colon: { code: 2322, category: DiagnosticCategory.Error, key: "Type '{0}' is not assignable to type '{1}':" },
Type_0_is_not_assignable_to_type_1: { code: 2323, category: DiagnosticCategory.Error, key: "Type '{0}' is not assignable to type '{1}'." },
Property_0_is_missing_in_type_1: { code: 2324, category: DiagnosticCategory.Error, key: "Property '{0}' is missing in type '{1}'." },
Property_0_is_private_in_type_1_but_not_in_type_2: { code: 2325, category: DiagnosticCategory.Error, key: "Property '{0}' is private in type '{1}' but not in type '{2}'." },
Types_of_property_0_are_incompatible_Colon: { code: 2326, category: DiagnosticCategory.Error, key: "Types of property '{0}' are incompatible:" },
Types_of_property_0_are_incompatible: { code: 2326, category: DiagnosticCategory.Error, key: "Types of property '{0}' are incompatible." },
Property_0_is_optional_in_type_1_but_required_in_type_2: { code: 2327, category: DiagnosticCategory.Error, key: "Property '{0}' is optional in type '{1}' but required in type '{2}'." },
Types_of_parameters_0_and_1_are_incompatible_Colon: { code: 2328, category: DiagnosticCategory.Error, key: "Types of parameters '{0}' and '{1}' are incompatible:" },
Types_of_parameters_0_and_1_are_incompatible: { code: 2328, category: DiagnosticCategory.Error, key: "Types of parameters '{0}' and '{1}' are incompatible." },
Index_signature_is_missing_in_type_0: { code: 2329, category: DiagnosticCategory.Error, key: "Index signature is missing in type '{0}'." },
Index_signatures_are_incompatible_Colon: { code: 2330, category: DiagnosticCategory.Error, key: "Index signatures are incompatible:" },
Index_signatures_are_incompatible: { code: 2330, category: DiagnosticCategory.Error, key: "Index signatures are incompatible." },
this_cannot_be_referenced_in_a_module_body: { code: 2331, category: DiagnosticCategory.Error, key: "'this' cannot be referenced in a module body." },
this_cannot_be_referenced_in_current_location: { code: 2332, category: DiagnosticCategory.Error, key: "'this' cannot be referenced in current location." },
this_cannot_be_referenced_in_constructor_arguments: { code: 2333, category: DiagnosticCategory.Error, key: "'this' cannot be referenced in constructor arguments." },
@ -165,7 +164,6 @@ module ts {
Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword: { code: 2340, category: DiagnosticCategory.Error, key: "Only public and protected methods of the base class are accessible via the 'super' keyword" },
Property_0_is_private_and_only_accessible_within_class_1: { code: 2341, category: DiagnosticCategory.Error, key: "Property '{0}' is private and only accessible within class '{1}'." },
An_index_expression_argument_must_be_of_type_string_number_or_any: { code: 2342, category: DiagnosticCategory.Error, key: "An index expression argument must be of type 'string', 'number', or 'any'." },
Type_0_does_not_satisfy_the_constraint_1_Colon: { code: 2343, category: DiagnosticCategory.Error, key: "Type '{0}' does not satisfy the constraint '{1}':" },
Type_0_does_not_satisfy_the_constraint_1: { code: 2344, category: DiagnosticCategory.Error, key: "Type '{0}' does not satisfy the constraint '{1}'." },
Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: { code: 2345, category: DiagnosticCategory.Error, key: "Argument of type '{0}' is not assignable to parameter of type '{1}'." },
Supplied_parameters_do_not_match_any_signature_of_call_target: { code: 2346, category: DiagnosticCategory.Error, key: "Supplied parameters do not match any signature of call target." },
@ -175,7 +173,6 @@ module ts {
Only_a_void_function_can_be_called_with_the_new_keyword: { code: 2350, category: DiagnosticCategory.Error, key: "Only a void function can be called with the 'new' keyword." },
Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature: { code: 2351, category: DiagnosticCategory.Error, key: "Cannot use 'new' with an expression whose type lacks a call or construct signature." },
Neither_type_0_nor_type_1_is_assignable_to_the_other: { code: 2352, category: DiagnosticCategory.Error, key: "Neither type '{0}' nor type '{1}' is assignable to the other." },
Neither_type_0_nor_type_1_is_assignable_to_the_other_Colon: { code: 2353, category: DiagnosticCategory.Error, key: "Neither type '{0}' nor type '{1}' is assignable to the other:" },
No_best_common_type_exists_among_return_expressions: { code: 2354, category: DiagnosticCategory.Error, key: "No best common type exists among return expressions." },
A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2355, category: DiagnosticCategory.Error, key: "A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement." },
An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: { code: 2356, category: DiagnosticCategory.Error, key: "An arithmetic operand must be of type 'any', 'number' or an enum type." },
@ -236,12 +233,9 @@ module ts {
Numeric_index_type_0_is_not_assignable_to_string_index_type_1: { code: 2413, category: DiagnosticCategory.Error, key: "Numeric index type '{0}' is not assignable to string index type '{1}'." },
Class_name_cannot_be_0: { code: 2414, category: DiagnosticCategory.Error, key: "Class name cannot be '{0}'" },
Class_0_incorrectly_extends_base_class_1: { code: 2415, category: DiagnosticCategory.Error, key: "Class '{0}' incorrectly extends base class '{1}'." },
Class_0_incorrectly_extends_base_class_1_Colon: { code: 2416, category: DiagnosticCategory.Error, key: "Class '{0}' incorrectly extends base class '{1}':" },
Class_static_side_0_incorrectly_extends_base_class_static_side_1: { code: 2417, category: DiagnosticCategory.Error, key: "Class static side '{0}' incorrectly extends base class static side '{1}'." },
Class_static_side_0_incorrectly_extends_base_class_static_side_1_Colon: { code: 2418, category: DiagnosticCategory.Error, key: "Class static side '{0}' incorrectly extends base class static side '{1}':" },
Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0: { code: 2419, category: DiagnosticCategory.Error, key: "Type name '{0}' in extends clause does not reference constructor function for '{0}'." },
Class_0_incorrectly_implements_interface_1: { code: 2420, category: DiagnosticCategory.Error, key: "Class '{0}' incorrectly implements interface '{1}'." },
Class_0_incorrectly_implements_interface_1_Colon: { code: 2421, category: DiagnosticCategory.Error, key: "Class '{0}' incorrectly implements interface '{1}':" },
A_class_may_only_implement_another_class_or_interface: { code: 2422, category: DiagnosticCategory.Error, key: "A class may only implement another class or interface." },
Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: { code: 2423, category: DiagnosticCategory.Error, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor." },
Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: { code: 2424, category: DiagnosticCategory.Error, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property." },
@ -249,7 +243,6 @@ module ts {
Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2426, category: DiagnosticCategory.Error, key: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function." },
Interface_name_cannot_be_0: { code: 2427, category: DiagnosticCategory.Error, key: "Interface name cannot be '{0}'" },
All_declarations_of_an_interface_must_have_identical_type_parameters: { code: 2428, category: DiagnosticCategory.Error, key: "All declarations of an interface must have identical type parameters." },
Interface_0_incorrectly_extends_interface_1_Colon: { code: 2429, category: DiagnosticCategory.Error, key: "Interface '{0}' incorrectly extends interface '{1}':" },
Interface_0_incorrectly_extends_interface_1: { code: 2430, category: DiagnosticCategory.Error, key: "Interface '{0}' incorrectly extends interface '{1}'." },
Enum_name_cannot_be_0: { code: 2431, category: DiagnosticCategory.Error, key: "Enum name cannot be '{0}'" },
In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element: { code: 2432, category: DiagnosticCategory.Error, key: "In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element." },
@ -273,6 +266,8 @@ module ts {
Left_hand_side_of_assignment_expression_cannot_be_a_constant: { code: 2450, category: DiagnosticCategory.Error, key: "Left-hand side of assignment expression cannot be a constant.", isEarly: true },
Cannot_redeclare_block_scoped_variable_0: { code: 2451, category: DiagnosticCategory.Error, key: "Cannot redeclare block-scoped variable '{0}'.", isEarly: true },
An_enum_member_cannot_have_a_numeric_name: { code: 2452, category: DiagnosticCategory.Error, key: "An enum member cannot have a numeric name." },
The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly: { code: 2453, category: DiagnosticCategory.Error, key: "The type argument for type parameter '{0}' cannot be inferred from the usage. Consider specifying the type arguments explicitly." },
Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0: { code: 2455, category: DiagnosticCategory.Error, key: "Type argument candidate '{1}' is not a valid type argument because it is not a supertype of candidate '{0}'." },
Import_declaration_0_is_using_private_name_1: { code: 4000, category: DiagnosticCategory.Error, key: "Import declaration '{0}' is using private name '{1}'." },
Type_parameter_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4001, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported class has or is using name '{1}' from private module '{2}'." },
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported class has or is using private name '{1}'." },

View File

@ -560,7 +560,7 @@
"category": "Error",
"code": 2319
},
"Interface '{0}' cannot simultaneously extend types '{1}' and '{2}':": {
"Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'.": {
"category": "Error",
"code": 2320
},
@ -568,7 +568,7 @@
"category": "Error",
"code": 2321
},
"Type '{0}' is not assignable to type '{1}':": {
"Type '{0}' is not assignable to type '{1}'.": {
"category": "Error",
"code": 2322
},
@ -584,7 +584,7 @@
"category": "Error",
"code": 2325
},
"Types of property '{0}' are incompatible:": {
"Types of property '{0}' are incompatible.": {
"category": "Error",
"code": 2326
},
@ -592,7 +592,7 @@
"category": "Error",
"code": 2327
},
"Types of parameters '{0}' and '{1}' are incompatible:": {
"Types of parameters '{0}' and '{1}' are incompatible.": {
"category": "Error",
"code": 2328
},
@ -600,7 +600,7 @@
"category": "Error",
"code": 2329
},
"Index signatures are incompatible:": {
"Index signatures are incompatible.": {
"category": "Error",
"code": 2330
},
@ -652,10 +652,6 @@
"category": "Error",
"code": 2342
},
"Type '{0}' does not satisfy the constraint '{1}':": {
"category": "Error",
"code": 2343
},
"Type '{0}' does not satisfy the constraint '{1}'.": {
"category": "Error",
"code": 2344
@ -692,10 +688,6 @@
"category": "Error",
"code": 2352
},
"Neither type '{0}' nor type '{1}' is assignable to the other:": {
"category": "Error",
"code": 2353
},
"No best common type exists among return expressions.": {
"category": "Error",
"code": 2354
@ -936,18 +928,10 @@
"category": "Error",
"code": 2415
},
"Class '{0}' incorrectly extends base class '{1}':": {
"category": "Error",
"code": 2416
},
"Class static side '{0}' incorrectly extends base class static side '{1}'.": {
"category": "Error",
"code": 2417
},
"Class static side '{0}' incorrectly extends base class static side '{1}':": {
"category": "Error",
"code": 2418
},
"Type name '{0}' in extends clause does not reference constructor function for '{0}'.": {
"category": "Error",
"code": 2419
@ -956,10 +940,6 @@
"category": "Error",
"code": 2420
},
"Class '{0}' incorrectly implements interface '{1}':": {
"category": "Error",
"code": 2421
},
"A class may only implement another class or interface.": {
"category": "Error",
"code": 2422
@ -988,10 +968,6 @@
"category": "Error",
"code": 2428
},
"Interface '{0}' incorrectly extends interface '{1}':": {
"category": "Error",
"code": 2429
},
"Interface '{0}' incorrectly extends interface '{1}'.": {
"category": "Error",
"code": 2430
@ -1088,6 +1064,14 @@
"category": "Error",
"code": 2452
},
"The type argument for type parameter '{0}' cannot be inferred from the usage. Consider specifying the type arguments explicitly.": {
"category": "Error",
"code": 2453
},
"Type argument candidate '{1}' is not a valid type argument because it is not a supertype of candidate '{0}'.": {
"category": "Error",
"code": 2455
},
"Import declaration '{0}' is using private name '{1}'.": {
"category": "Error",

View File

@ -794,7 +794,7 @@ module ts {
}
export enum SymbolFlags {
FunctionScopedVariable = 0x00000001, // Variable (var) or parameter
FunctionScopedVariable = 0x00000001, // Variable (var) or parameter
Property = 0x00000002, // Property or enum member
EnumMember = 0x00000004, // Enum member
Function = 0x00000008, // Function
@ -1063,6 +1063,8 @@ module ts {
inferenceCount: number; // Incremented for every inference made (whether new or not)
inferences: Type[][]; // Inferences made for each type parameter
inferredTypes: Type[]; // Inferred type for each type parameter
failedTypeParameterIndex?: number; // Index of type parameter for which inference failed
// It is optional because in contextual signature instantiation, nothing fails
}
export interface DiagnosticMessage {

View File

@ -38,6 +38,7 @@ module ts {
getFullWidth(): number;
getLeadingTriviaWidth(sourceFile?: SourceFile): number;
getFullText(sourceFile?: SourceFile): string;
getText(sourceFile?: SourceFile): string;
getFirstToken(sourceFile?: SourceFile): Node;
getLastToken(sourceFile?: SourceFile): Node;
}
@ -130,6 +131,10 @@ module ts {
return (sourceFile || this.getSourceFile()).text.substring(this.pos, this.end);
}
public getText(sourceFile?: SourceFile): string {
return (sourceFile || this.getSourceFile()).text.substring(this.getStart(), this.getEnd());
}
private addSyntheticNodes(nodes: Node[], pos: number, end: number): number {
scanner.setTextPos(pos);
while (pos < end) {
@ -1287,7 +1292,6 @@ module ts {
position: number; // position in the file where the completion was requested
entries: CompletionEntry[]; // entries for this completion
symbols: Map<Symbol>; // symbols by entry name map
location: Node; // the node where the completion was requested
typeChecker: TypeChecker; // the typeChecker used to generate this completion
}
@ -1957,21 +1961,21 @@ module ts {
}
function isRightSideOfPropertyAccess(node: Node) {
return node.parent.kind === SyntaxKind.PropertyAccess && (<PropertyAccess>node.parent).right === node;
return node && node.parent && node.parent.kind === SyntaxKind.PropertyAccess && (<PropertyAccess>node.parent).right === node;
}
function isCallExpressionTarget(node: Node): boolean {
if (isRightSideOfPropertyAccess(node)) {
node = node.parent;
}
return node.parent.kind === SyntaxKind.CallExpression && (<CallExpression>node.parent).func === node;
return node && node.parent && node.parent.kind === SyntaxKind.CallExpression && (<CallExpression>node.parent).func === node;
}
function isNewExpressionTarget(node: Node): boolean {
if (isRightSideOfPropertyAccess(node)) {
node = node.parent;
}
return node.parent.kind === SyntaxKind.NewExpression && (<CallExpression>node.parent).func === node;
return node && node.parent && node.parent.kind === SyntaxKind.NewExpression && (<CallExpression>node.parent).func === node;
}
function isNameOfModuleDeclaration(node: Node) {
@ -2014,6 +2018,37 @@ module ts {
(node.parent.kind === SyntaxKind.ImportDeclaration && (<ImportDeclaration>node.parent).externalModuleName === node));
}
/** Returns true if the position is within a comment */
function isInsideComment(sourceFile: SourceFile, token: Node, position: number): boolean {
// The position has to be: 1. in the leading trivia (before token.getStart()), and 2. within a comment
return position <= token.getStart(sourceFile) &&
(isInsideCommentRange(getTrailingCommentRanges(sourceFile.text, token.getFullStart())) ||
isInsideCommentRange(getLeadingCommentRanges(sourceFile.text, token.getFullStart())));
function isInsideCommentRange(comments: CommentRange[]): boolean {
return forEach(comments, comment => {
// either we are 1. completely inside the comment, or 2. at the end of the comment
if (comment.pos < position && position < comment.end) {
return true;
}
else if (position === comment.end) {
var text = sourceFile.text;
var width = comment.end - comment.pos;
// is single line comment or just /*
if (width <= 2 || text.charCodeAt(comment.pos + 1) === CharacterCodes.slash) {
return true;
}
else {
// is unterminated multi-line comment
return !(text.charCodeAt(comment.end - 1) === CharacterCodes.slash &&
text.charCodeAt(comment.end - 2) === CharacterCodes.asterisk);
}
}
return false;
});
}
}
enum SemanticMeaning {
None = 0x0,
Value = 0x1,
@ -2317,6 +2352,135 @@ module ts {
}
function getCompletionsAtPosition(filename: string, position: number, isMemberCompletion: boolean) {
synchronizeHostData();
filename = TypeScript.switchToForwardSlashes(filename);
var sourceFile = getSourceFile(filename);
var currentToken = getTokenAtPosition(sourceFile, position);
// Completion not allowed inside comments, bail out if this is the case
if (isInsideComment(sourceFile, currentToken, position)) {
host.log("Returning an empty list because completion was inside a comment.");
return undefined;
}
// The decision to provide completion depends on the previous token, so find it
// Note: previousToken can be undefined if we are the beginning of the file
var previousToken = findPrecedingToken(position, sourceFile);
// The caret is at the end of an identifier; this is a partial identifier that we want to complete: e.g. a.toS|
// Skip this partial identifier to the previous token
if (previousToken && position <= previousToken.end && previousToken.kind === SyntaxKind.Identifier) {
previousToken = findPrecedingToken(previousToken.pos, sourceFile);
}
// Check if this is a valid completion location
if (previousToken && isCompletionListBlocker(previousToken)) {
host.log("Returning an empty list because completion was requested in an invalid position.");
return undefined;
}
// Find the node where completion is requested on, in the case of a completion after a dot, it is the member access expression
// other wise, it is a request for all visible symbols in the scope, and the node is the current location
var node: Node;
var isRightOfDot: boolean;
if (previousToken && previousToken.kind === SyntaxKind.DotToken &&
(previousToken.parent.kind === SyntaxKind.PropertyAccess || previousToken.parent.kind === SyntaxKind.QualifiedName)) {
node = (<PropertyAccess>previousToken.parent).left;
isRightOfDot = true;
}
else {
node = currentToken;
isRightOfDot = false;
}
// Clear the current activeCompletionSession for this session
activeCompletionSession = {
filename: filename,
position: position,
entries: [],
symbols: {},
typeChecker: typeInfoResolver
};
// Populate the completion list
if (isRightOfDot) {
// Right of dot member completion list
var symbols: Symbol[] = [];
isMemberCompletion = true;
if (node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.QualifiedName || node.kind === SyntaxKind.PropertyAccess) {
var symbol = typeInfoResolver.getSymbolInfo(node);
// This is an alias, follow what it aliases
if (symbol && symbol.flags & SymbolFlags.Import) {
symbol = typeInfoResolver.getAliasedSymbol(symbol);
}
if (symbol && symbol.flags & SymbolFlags.HasExports) {
// Extract module or enum members
forEachValue(symbol.exports, symbol => {
if (typeInfoResolver.isValidPropertyAccess(<PropertyAccess>(node.parent), symbol.name)) {
symbols.push(symbol);
}
});
}
}
var type = typeInfoResolver.getTypeOfNode(node);
if (type) {
// Filter private properties
forEach(type.getApparentProperties(), symbol => {
if (typeInfoResolver.isValidPropertyAccess(<PropertyAccess>(node.parent), symbol.name)) {
symbols.push(symbol);
}
});
}
getCompletionEntriesFromSymbols(symbols, activeCompletionSession);
}
else {
var containingObjectLiteral = getContainingObjectLiteralApplicableForCompletion(previousToken);
if (containingObjectLiteral) {
// Object literal expression, look up possible property names from contextual type
isMemberCompletion = true;
var contextualType = typeInfoResolver.getContextualType(containingObjectLiteral);
if (!contextualType) {
return undefined;
}
var contextualTypeMembers = typeInfoResolver.getPropertiesOfType(contextualType);
if (contextualTypeMembers && contextualTypeMembers.length > 0) {
// Add filtered items to the completion list
var filteredMembers = filterContextualMembersList(contextualTypeMembers, containingObjectLiteral.properties);
getCompletionEntriesFromSymbols(filteredMembers, activeCompletionSession);
}
}
else {
// Get scope members
isMemberCompletion = false;
/// TODO filter meaning based on the current context
var symbolMeanings = SymbolFlags.Type | SymbolFlags.Value | SymbolFlags.Namespace | SymbolFlags.Import;
var symbols = typeInfoResolver.getSymbolsInScope(node, symbolMeanings);
getCompletionEntriesFromSymbols(symbols, activeCompletionSession);
}
}
// Add keywords if this is not a member completion list
if (!isMemberCompletion) {
Array.prototype.push.apply(activeCompletionSession.entries, keywordCompletions);
}
return {
isMemberCompletion: isMemberCompletion,
entries: activeCompletionSession.entries
};
function getCompletionEntriesFromSymbols(symbols: Symbol[], session: CompletionSession): void {
forEach(symbols, symbol => {
var entry = createCompletionEntry(symbol, session.typeChecker);
@ -2327,40 +2491,47 @@ module ts {
});
}
function isCompletionListBlocker(sourceUnit: TypeScript.SourceUnitSyntax, position: number): boolean {
// We shouldn't be getting a position that is outside the file because
// isEntirelyInsideComment can't handle when the position is out of bounds,
// callers should be fixed, however we should be resilient to bad inputs
// so we return true (this position is a blocker for getting completions)
if (position < 0 || position > TypeScript.fullWidth(sourceUnit)) {
return true;
}
// This method uses Fidelity completely. Some information can be reached using the AST, but not everything.
return TypeScript.Syntax.isEntirelyInsideComment(sourceUnit, position) ||
TypeScript.Syntax.isEntirelyInStringOrRegularExpressionLiteral(sourceUnit, position) ||
isIdentifierDefinitionLocation(sourceUnit, position) ||
isRightOfIllegalDot(sourceUnit, position);
function isCompletionListBlocker(previousToken: Node): boolean {
return isInStringOrRegularExpressionLiteral(previousToken) ||
isIdentifierDefinitionLocation(previousToken) ||
isRightOfIllegalDot(previousToken);
}
function getContainingObjectLiteralApplicableForCompletion(sourceUnit: TypeScript.SourceUnitSyntax, position: number): TypeScript.ISyntaxElement {
function isInStringOrRegularExpressionLiteral(previousToken: Node): boolean {
if (previousToken.kind === SyntaxKind.StringLiteral) {
// The position has to be either: 1. entirely within the token text, or
// 2. at the end position, and the string literal is not terminated
var start = previousToken.getStart();
var end = previousToken.getEnd();
if (start < position && position < end) {
return true;
}
else if (position === end) {
var width = end - start;
var text = previousToken.getSourceFile().text;
return width <= 1 ||
text.charCodeAt(start) !== text.charCodeAt(end - 1) ||
text.charCodeAt(end - 2) === CharacterCodes.backslash;
}
}
else if (previousToken.kind === SyntaxKind.RegularExpressionLiteral) {
return previousToken.getStart() < position && position < previousToken.getEnd();
}
return false;
}
function getContainingObjectLiteralApplicableForCompletion(previousToken: Node): ObjectLiteral {
// The locations in an object literal expression that are applicable for completion are property name definition locations.
var previousToken = getNonIdentifierCompleteTokenOnLeft(sourceUnit, position);
if (previousToken) {
var parent = previousToken.parent;
switch (previousToken.kind()) {
case TypeScript.SyntaxKind.OpenBraceToken: // var x = { |
case TypeScript.SyntaxKind.CommaToken: // var x = { a: 0, |
if (parent && parent.kind() === TypeScript.SyntaxKind.SeparatedList) {
parent = parent.parent;
switch (previousToken.kind) {
case SyntaxKind.OpenBraceToken: // var x = { |
case SyntaxKind.CommaToken: // var x = { a: 0, |
if (parent && parent.kind === SyntaxKind.ObjectLiteral) {
return <ObjectLiteral>parent;
}
if (parent && parent.kind() === TypeScript.SyntaxKind.ObjectLiteralExpression) {
return parent;
}
break;
}
}
@ -2368,47 +2539,71 @@ module ts {
return undefined;
}
function isIdentifierDefinitionLocation(sourceUnit: TypeScript.SourceUnitSyntax, position: number): boolean {
var positionedToken = getNonIdentifierCompleteTokenOnLeft(sourceUnit, position);
function isFunction(kind: SyntaxKind): boolean {
switch (kind) {
case SyntaxKind.FunctionExpression:
case SyntaxKind.ArrowFunction:
case SyntaxKind.FunctionDeclaration:
case SyntaxKind.Method:
case SyntaxKind.Constructor:
case SyntaxKind.GetAccessor:
case SyntaxKind.SetAccessor:
case SyntaxKind.CallSignature:
case SyntaxKind.ConstructSignature:
case SyntaxKind.IndexSignature:
return true;
}
return false;
}
if (positionedToken) {
var containingNodeKind = TypeScript.Syntax.containingNode(positionedToken) && TypeScript.Syntax.containingNode(positionedToken).kind();
switch (positionedToken.kind()) {
case TypeScript.SyntaxKind.CommaToken:
return containingNodeKind === TypeScript.SyntaxKind.ParameterList ||
containingNodeKind === TypeScript.SyntaxKind.VariableDeclaration ||
containingNodeKind === TypeScript.SyntaxKind.EnumDeclaration; // enum { foo, |
function isIdentifierDefinitionLocation(previousToken: Node): boolean {
if (previousToken) {
var containingNodeKind = previousToken.parent.kind;
switch (previousToken.kind) {
case SyntaxKind.CommaToken:
return containingNodeKind === SyntaxKind.VariableDeclaration ||
containingNodeKind === SyntaxKind.VariableStatement ||
containingNodeKind === SyntaxKind.EnumDeclaration || // enum a { foo, |
isFunction(containingNodeKind);
case TypeScript.SyntaxKind.OpenParenToken:
return containingNodeKind === TypeScript.SyntaxKind.ParameterList ||
containingNodeKind === TypeScript.SyntaxKind.CatchClause;
case SyntaxKind.OpenParenToken:
return containingNodeKind === SyntaxKind.CatchBlock ||
isFunction(containingNodeKind);
case TypeScript.SyntaxKind.OpenBraceToken:
return containingNodeKind === TypeScript.SyntaxKind.EnumDeclaration; // enum { |
case SyntaxKind.OpenBraceToken:
return containingNodeKind === SyntaxKind.EnumDeclaration || // enum a { |
containingNodeKind === SyntaxKind.InterfaceDeclaration; // interface a { |
case TypeScript.SyntaxKind.PublicKeyword:
case TypeScript.SyntaxKind.PrivateKeyword:
case TypeScript.SyntaxKind.StaticKeyword:
case TypeScript.SyntaxKind.DotDotDotToken:
return containingNodeKind === TypeScript.SyntaxKind.Parameter;
case SyntaxKind.SemicolonToken:
return containingNodeKind === SyntaxKind.Property &&
previousToken.parent.parent.kind === SyntaxKind.InterfaceDeclaration; // interface a { f; |
case TypeScript.SyntaxKind.ClassKeyword:
case TypeScript.SyntaxKind.ModuleKeyword:
case TypeScript.SyntaxKind.EnumKeyword:
case TypeScript.SyntaxKind.InterfaceKeyword:
case TypeScript.SyntaxKind.FunctionKeyword:
case TypeScript.SyntaxKind.VarKeyword:
case TypeScript.SyntaxKind.GetKeyword:
case TypeScript.SyntaxKind.SetKeyword:
case SyntaxKind.PublicKeyword:
case SyntaxKind.PrivateKeyword:
case SyntaxKind.StaticKeyword:
case SyntaxKind.DotDotDotToken:
return containingNodeKind === SyntaxKind.Parameter;
case SyntaxKind.ClassKeyword:
case SyntaxKind.ModuleKeyword:
case SyntaxKind.EnumKeyword:
case SyntaxKind.InterfaceKeyword:
case SyntaxKind.FunctionKeyword:
case SyntaxKind.VarKeyword:
case SyntaxKind.GetKeyword:
case SyntaxKind.SetKeyword:
return true;
}
// Previous token may have been a keyword that was converted to an identifier.
switch (positionedToken.text()) {
switch (previousToken.getText()) {
case "class":
case "interface":
case "enum":
case "module":
case "function":
case "var":
// TODO: add let and const
return true;
}
}
@ -2416,44 +2611,15 @@ module ts {
return false;
}
function getNonIdentifierCompleteTokenOnLeft(sourceUnit: TypeScript.SourceUnitSyntax, position: number): TypeScript.ISyntaxToken {
var positionedToken = TypeScript.Syntax.findCompleteTokenOnLeft(sourceUnit, position, /*includeSkippedTokens*/true);
if (positionedToken && position === TypeScript.end(positionedToken) && positionedToken.kind() == TypeScript.SyntaxKind.EndOfFileToken) {
// EndOfFile token is not interesting, get the one before it
positionedToken = TypeScript. previousToken(positionedToken, /*includeSkippedTokens*/true);
}
if (positionedToken && position === TypeScript.end(positionedToken) && positionedToken.kind() === TypeScript.SyntaxKind.IdentifierName) {
// The caret is at the end of an identifier, the decision to provide completion depends on the previous token
positionedToken = TypeScript.previousToken(positionedToken, /*includeSkippedTokens*/true);
}
return positionedToken;
}
function isRightOfIllegalDot(sourceUnit: TypeScript.SourceUnitSyntax, position: number): boolean {
var positionedToken = getNonIdentifierCompleteTokenOnLeft(sourceUnit, position);
if (positionedToken) {
switch (positionedToken.kind()) {
case TypeScript.SyntaxKind.DotToken:
var leftOfDotPositionedToken = TypeScript.previousToken(positionedToken, /*includeSkippedTokens*/true);
return leftOfDotPositionedToken && leftOfDotPositionedToken.kind() === TypeScript.SyntaxKind.NumericLiteral;
case TypeScript.SyntaxKind.NumericLiteral:
var text = positionedToken.text();
return text.charAt(text.length - 1) === ".";
}
function isRightOfIllegalDot(previousToken: Node): boolean {
if (previousToken && previousToken.kind === SyntaxKind.NumericLiteral) {
var text = previousToken.getFullText();
return text.charAt(text.length - 1) === ".";
}
return false;
}
function isPunctuation(kind: SyntaxKind) {
return (SyntaxKind.FirstPunctuation <= kind && kind <= SyntaxKind.LastPunctuation);
}
function filterContextualMembersList(contextualMemberSymbols: Symbol[], existingMembers: Declaration[]): Symbol[] {
if (!existingMembers || existingMembers.length === 0) {
return contextualMemberSymbols;
@ -2483,162 +2649,6 @@ module ts {
return filteredMembers;
}
synchronizeHostData();
filename = TypeScript.switchToForwardSlashes(filename);
var sourceFile = getSourceFile(filename);
var sourceUnit = sourceFile.getSourceUnit();
if (isCompletionListBlocker(sourceFile.getSyntaxTree().sourceUnit(), position)) {
host.log("Returning an empty list because completion was blocked.");
return null;
}
var node = TypeScript.ASTHelpers.getAstAtPosition(sourceUnit, position, /*useTrailingTriviaAsLimChar*/ true, /*forceInclusive*/ true);
if (node && node.kind() === TypeScript.SyntaxKind.IdentifierName &&
TypeScript.start(node) === TypeScript.end(node)) {
// Ignore missing name nodes
node = node.parent;
}
var isRightOfDot = false;
if (node &&
node.kind() === TypeScript.SyntaxKind.MemberAccessExpression &&
TypeScript.end((<TypeScript.MemberAccessExpressionSyntax>node).expression) < position) {
isRightOfDot = true;
node = (<TypeScript.MemberAccessExpressionSyntax>node).expression;
}
else if (node &&
node.kind() === TypeScript.SyntaxKind.QualifiedName &&
TypeScript.end((<TypeScript.QualifiedNameSyntax>node).left) < position) {
isRightOfDot = true;
node = (<TypeScript.QualifiedNameSyntax>node).left;
}
else if (node && node.parent &&
node.kind() === TypeScript.SyntaxKind.IdentifierName &&
node.parent.kind() === TypeScript.SyntaxKind.MemberAccessExpression &&
(<TypeScript.MemberAccessExpressionSyntax>node.parent).name === node) {
isRightOfDot = true;
node = (<TypeScript.MemberAccessExpressionSyntax>node.parent).expression;
}
else if (node && node.parent &&
node.kind() === TypeScript.SyntaxKind.IdentifierName &&
node.parent.kind() === TypeScript.SyntaxKind.QualifiedName &&
(<TypeScript.QualifiedNameSyntax>node.parent).right === node) {
isRightOfDot = true;
node = (<TypeScript.QualifiedNameSyntax>node.parent).left;
}
// TODO: this is a hack for now, we need a proper walking mechanism to verify that we have the correct node
var precedingToken = findTokenOnLeftOfPosition(sourceFile, TypeScript.end(node));
var mappedNode: Node;
if (!precedingToken) {
mappedNode = sourceFile;
}
else if (isPunctuation(precedingToken.kind)) {
mappedNode = precedingToken.parent;
}
else {
mappedNode = precedingToken;
}
Debug.assert(mappedNode !== undefined, "Could not map a Fidelity node to an AST node");
// Get the completions
activeCompletionSession = {
filename: filename,
position: position,
entries: [],
symbols: {},
location: mappedNode,
typeChecker: typeInfoResolver
};
// Right of dot member completion list
if (isRightOfDot) {
var symbols: Symbol[] = [];
isMemberCompletion = true;
if (mappedNode.kind === SyntaxKind.Identifier || mappedNode.kind === SyntaxKind.QualifiedName || mappedNode.kind === SyntaxKind.PropertyAccess) {
var symbol = typeInfoResolver.getSymbolInfo(mappedNode);
// This is an alias, follow what it aliases
if (symbol && symbol.flags & SymbolFlags.Import) {
symbol = typeInfoResolver.getAliasedSymbol(symbol);
}
if (symbol && symbol.flags & SymbolFlags.HasExports) {
// Extract module or enum members
forEachValue(symbol.exports, symbol => {
if (typeInfoResolver.isValidPropertyAccess(<PropertyAccess>(mappedNode.parent), symbol.name)) {
symbols.push(symbol);
}
});
}
}
var type = typeInfoResolver.getTypeOfNode(mappedNode);
if (type) {
// Filter private properties
forEach(type.getApparentProperties(), symbol => {
if (typeInfoResolver.isValidPropertyAccess(<PropertyAccess>(mappedNode.parent), symbol.name)) {
symbols.push(symbol);
}
});
}
getCompletionEntriesFromSymbols(symbols, activeCompletionSession);
}
else {
var containingObjectLiteral = getContainingObjectLiteralApplicableForCompletion(sourceFile.getSyntaxTree().sourceUnit(), position);
// Object literal expression, look up possible property names from contextual type
if (containingObjectLiteral) {
var objectLiteral = <ObjectLiteral>(mappedNode.kind === SyntaxKind.ObjectLiteral ? mappedNode : getAncestor(mappedNode, SyntaxKind.ObjectLiteral));
Debug.assert(objectLiteral !== undefined);
isMemberCompletion = true;
var contextualType = typeInfoResolver.getContextualType(objectLiteral);
if (!contextualType) {
return undefined;
}
var contextualTypeMembers = typeInfoResolver.getPropertiesOfType(contextualType);
if (contextualTypeMembers && contextualTypeMembers.length > 0) {
// Add filtered items to the completion list
var filteredMembers = filterContextualMembersList(contextualTypeMembers, objectLiteral.properties);
getCompletionEntriesFromSymbols(filteredMembers, activeCompletionSession);
}
}
// Get scope members
else {
isMemberCompletion = false;
/// TODO filter meaning based on the current context
var symbolMeanings = SymbolFlags.Type | SymbolFlags.Value | SymbolFlags.Namespace | SymbolFlags.Import;
var symbols = typeInfoResolver.getSymbolsInScope(mappedNode, symbolMeanings);
getCompletionEntriesFromSymbols(symbols, activeCompletionSession);
}
}
// Add keywords if this is not a member completion list
if (!isMemberCompletion) {
Array.prototype.push.apply(activeCompletionSession.entries, keywordCompletions);
}
return {
isMemberCompletion: isMemberCompletion,
entries: activeCompletionSession.entries
};
}
function getCompletionEntryDetails(filename: string, position: number, entryName: string): CompletionEntryDetails {
@ -2646,6 +2656,8 @@ module ts {
// in the getCompletionsAtPosition earlier
filename = TypeScript.switchToForwardSlashes(filename);
var sourceFile = getSourceFile(filename);
var session = activeCompletionSession;
// Ensure that the current active completion session is still valid for this request
@ -2662,7 +2674,8 @@ module ts {
// which is permissible given that it is backwards compatible; but really we should consider
// passing the meaning for the node so that we don't report that a suggestion for a value is an interface.
// We COULD also just do what 'getSymbolModifiers' does, which is to use the first declaration.
var displayPartsDocumentationsAndSymbolKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, getSourceFile(filename), session.location, session.typeChecker, session.location, SemanticMeaning.All);
var location = getTouchingPropertyName(sourceFile, position);
var displayPartsDocumentationsAndSymbolKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, getSourceFile(filename), location, session.typeChecker, location, SemanticMeaning.All);
return {
name: entryName,
kind: displayPartsDocumentationsAndSymbolKind.symbolKind,
@ -2824,14 +2837,24 @@ module ts {
var type = typeResolver.getTypeOfSymbol(symbol);
if (type) {
if (isCallExpressionTarget(location) || isNewExpressionTarget(location)) {
// try get the call/construct signature from the type if it matches
var callExpression: CallExpression;
if (location.parent.kind === SyntaxKind.PropertyAccess && (<PropertyAccess>location.parent).right === location) {
if (location.parent && location.parent.kind === SyntaxKind.PropertyAccess) {
var right = (<PropertyAccess>location.parent).right;
// Either the location is on the right of a property access, or on the left and the right is missing
if (right === location || (right && right.kind === SyntaxKind.Missing)){
location = location.parent;
}
callExpression = <CallExpression>location.parent;
}
// try get the call/construct signature from the type if it matches
var callExpression: CallExpression;
if (location.kind === SyntaxKind.CallExpression || location.kind === SyntaxKind.NewExpression) {
callExpression = <CallExpression> location;
}
else if (isCallExpressionTarget(location) || isNewExpressionTarget(location)) {
callExpression = <CallExpression>location.parent;
}
if (callExpression) {
var candidateSignatures: Signature[] = [];
signature = typeResolver.getResolvedSignature(callExpression, candidateSignatures);
if (!signature && candidateSignatures.length) {
@ -3836,7 +3859,7 @@ module ts {
if (symbol.getFlags() && (SymbolFlags.Property | SymbolFlags.Method)) {
var privateDeclaration = forEach(symbol.getDeclarations(), d => (d.flags & NodeFlags.Private) ? d : undefined);
if (privateDeclaration) {
return privateDeclaration.parent;
return getAncestor(privateDeclaration, SyntaxKind.ClassDeclaration);
}
}
@ -5136,16 +5159,7 @@ module ts {
// OK, we have found a match in the file. This is only an acceptable match if
// it is contained within a comment.
var token = getTokenAtPosition(sourceFile, matchPosition);
if (token.getStart() <= matchPosition && matchPosition < token.getEnd()) {
// match was within the token itself. Not in the comment. Keep searching
// descriptor.
continue;
}
// Looks to be within the trivia. See if we can find the comment containing it.
if (!getContainingComment(getTrailingCommentRanges(fileContents, token.getFullStart()), matchPosition) &&
!getContainingComment(getLeadingCommentRanges(fileContents, token.getFullStart()), matchPosition)) {
if (!isInsideComment(sourceFile, token, matchPosition)) {
continue;
}

View File

@ -95,11 +95,12 @@ module ts {
var child = current.getChildAt(i);
var start = allowPositionInLeadingTrivia ? child.getFullStart() : child.getStart(sourceFile);
if (start <= position) {
if (position < child.getEnd()) {
var end = child.getEnd();
if (position < end || (position === end && child.kind === SyntaxKind.EndOfFileToken)) {
current = child;
continue outer;
}
else if (includeItemAtEndPosition && child.getEnd() === position) {
else if (includeItemAtEndPosition && end === position) {
var previousToken = findPrecedingToken(position, sourceFile, child);
if (previousToken && includeItemAtEndPosition(previousToken)) {
return previousToken;
@ -180,7 +181,7 @@ module ts {
for (var i = 0, len = children.length; i < len; ++i) {
var child = children[i];
if (nodeHasTokens(child)) {
if (position < child.end) {
if (position <= child.end) {
if (child.getStart(sourceFile) >= position) {
// actual start of the node is past the position - previous token should be at the end of previous child
var candidate = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ i);

View File

@ -1,5 +1,5 @@
tests/cases/compiler/addMoreOverloadsToBaseSignature.ts(5,11): error TS2429: Interface 'Bar' incorrectly extends interface 'Foo':
Types of property 'f' are incompatible:
tests/cases/compiler/addMoreOverloadsToBaseSignature.ts(5,11): error TS2430: Interface 'Bar' incorrectly extends interface 'Foo'.
Types of property 'f' are incompatible.
Type '(key: string) => string' is not assignable to type '() => string'.
@ -10,9 +10,9 @@ tests/cases/compiler/addMoreOverloadsToBaseSignature.ts(5,11): error TS2429: Int
interface Bar extends Foo {
~~~
!!! error TS2429: Interface 'Bar' incorrectly extends interface 'Foo':
!!! error TS2429: Types of property 'f' are incompatible:
!!! error TS2429: Type '(key: string) => string' is not assignable to type '() => string'.
!!! error TS2430: Interface 'Bar' incorrectly extends interface 'Foo'.
!!! error TS2430: Types of property 'f' are incompatible.
!!! error TS2430: Type '(key: string) => string' is not assignable to type '() => string'.
f(key: string): string;
}

View File

@ -1,4 +1,4 @@
tests/cases/compiler/aliasAssignments_1.ts(3,1): error TS2322: Type 'number' is not assignable to type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"':
tests/cases/compiler/aliasAssignments_1.ts(3,1): error TS2323: Type 'number' is not assignable to type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"'.
Property 'someClass' is missing in type 'Number'.
tests/cases/compiler/aliasAssignments_1.ts(5,1): error TS2323: Type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"' is not assignable to type 'number'.
@ -8,8 +8,8 @@ tests/cases/compiler/aliasAssignments_1.ts(5,1): error TS2323: Type 'typeof "tes
var x = moduleA;
x = 1; // Should be error
~
!!! error TS2322: Type 'number' is not assignable to type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"':
!!! error TS2322: Property 'someClass' is missing in type 'Number'.
!!! error TS2323: Type 'number' is not assignable to type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"'.
!!! error TS2323: Property 'someClass' is missing in type 'Number'.
var y = 1;
y = moduleA; // should be error
~

View File

@ -1,5 +1,5 @@
tests/cases/conformance/types/typeRelationships/apparentType/apparentTypeSubtyping.ts(9,7): error TS2416: Class 'Derived<U>' incorrectly extends base class 'Base<string>':
Types of property 'x' are incompatible:
tests/cases/conformance/types/typeRelationships/apparentType/apparentTypeSubtyping.ts(9,7): error TS2415: Class 'Derived<U>' incorrectly extends base class 'Base<string>'.
Types of property 'x' are incompatible.
Type 'String' is not assignable to type 'string'.
@ -14,9 +14,9 @@ tests/cases/conformance/types/typeRelationships/apparentType/apparentTypeSubtypi
// is String (S) a subtype of U extends String (T)? Would only be true if we used the apparent type of U (T)
class Derived<U> extends Base<string> { // error
~~~~~~~
!!! error TS2416: Class 'Derived<U>' incorrectly extends base class 'Base<string>':
!!! error TS2416: Types of property 'x' are incompatible:
!!! error TS2416: Type 'String' is not assignable to type 'string'.
!!! error TS2415: Class 'Derived<U>' incorrectly extends base class 'Base<string>'.
!!! error TS2415: Types of property 'x' are incompatible.
!!! error TS2415: Type 'String' is not assignable to type 'string'.
x: String;
}

View File

@ -1,5 +1,5 @@
tests/cases/conformance/types/typeRelationships/apparentType/apparentTypeSupertype.ts(9,7): error TS2416: Class 'Derived<U>' incorrectly extends base class 'Base':
Types of property 'x' are incompatible:
tests/cases/conformance/types/typeRelationships/apparentType/apparentTypeSupertype.ts(9,7): error TS2415: Class 'Derived<U>' incorrectly extends base class 'Base'.
Types of property 'x' are incompatible.
Type 'U' is not assignable to type 'string'.
@ -14,8 +14,8 @@ tests/cases/conformance/types/typeRelationships/apparentType/apparentTypeSuperty
// is String (S) a subtype of U extends String (T)? Would only be true if we used the apparent type of U (T)
class Derived<U extends String> extends Base { // error
~~~~~~~
!!! error TS2416: Class 'Derived<U>' incorrectly extends base class 'Base':
!!! error TS2416: Types of property 'x' are incompatible:
!!! error TS2416: Type 'U' is not assignable to type 'string'.
!!! error TS2415: Class 'Derived<U>' incorrectly extends base class 'Base'.
!!! error TS2415: Types of property 'x' are incompatible.
!!! error TS2415: Type 'U' is not assignable to type 'string'.
x: U;
}

View File

@ -1,4 +1,4 @@
tests/cases/compiler/argumentsBindsToFunctionScopeArgumentList.ts(3,5): error TS2322: Type 'number' is not assignable to type 'IArguments':
tests/cases/compiler/argumentsBindsToFunctionScopeArgumentList.ts(3,5): error TS2323: Type 'number' is not assignable to type 'IArguments'.
Property 'length' is missing in type 'Number'.
@ -7,6 +7,6 @@ tests/cases/compiler/argumentsBindsToFunctionScopeArgumentList.ts(3,5): error TS
function foo(a) {
arguments = 10; /// This shouldnt be of type number and result in error.
~~~~~~~~~
!!! error TS2322: Type 'number' is not assignable to type 'IArguments':
!!! error TS2322: Property 'length' is missing in type 'Number'.
!!! error TS2323: Type 'number' is not assignable to type 'IArguments'.
!!! error TS2323: Property 'length' is missing in type 'Number'.
}

View File

@ -1,49 +1,49 @@
tests/cases/compiler/arrayAssignmentTest1.ts(46,5): error TS2322: Type 'undefined[]' is not assignable to type 'I1':
tests/cases/compiler/arrayAssignmentTest1.ts(46,5): error TS2323: Type 'undefined[]' is not assignable to type 'I1'.
Property 'IM1' is missing in type 'undefined[]'.
tests/cases/compiler/arrayAssignmentTest1.ts(47,5): error TS2322: Type 'undefined[]' is not assignable to type 'C1':
tests/cases/compiler/arrayAssignmentTest1.ts(47,5): error TS2323: Type 'undefined[]' is not assignable to type 'C1'.
Property 'IM1' is missing in type 'undefined[]'.
tests/cases/compiler/arrayAssignmentTest1.ts(48,5): error TS2322: Type 'undefined[]' is not assignable to type 'C2':
tests/cases/compiler/arrayAssignmentTest1.ts(48,5): error TS2323: Type 'undefined[]' is not assignable to type 'C2'.
Property 'C2M1' is missing in type 'undefined[]'.
tests/cases/compiler/arrayAssignmentTest1.ts(49,5): error TS2322: Type 'undefined[]' is not assignable to type 'C3':
tests/cases/compiler/arrayAssignmentTest1.ts(49,5): error TS2323: Type 'undefined[]' is not assignable to type 'C3'.
Property 'CM3M1' is missing in type 'undefined[]'.
tests/cases/compiler/arrayAssignmentTest1.ts(60,1): error TS2322: Type 'C3[]' is not assignable to type 'I1[]':
Type 'C3' is not assignable to type 'I1':
tests/cases/compiler/arrayAssignmentTest1.ts(60,1): error TS2323: Type 'C3[]' is not assignable to type 'I1[]'.
Type 'C3' is not assignable to type 'I1'.
Property 'IM1' is missing in type 'C3'.
tests/cases/compiler/arrayAssignmentTest1.ts(64,1): error TS2322: Type 'I1[]' is not assignable to type 'C1[]':
Type 'I1' is not assignable to type 'C1':
tests/cases/compiler/arrayAssignmentTest1.ts(64,1): error TS2323: Type 'I1[]' is not assignable to type 'C1[]'.
Type 'I1' is not assignable to type 'C1'.
Property 'C1M1' is missing in type 'I1'.
tests/cases/compiler/arrayAssignmentTest1.ts(65,1): error TS2322: Type 'C3[]' is not assignable to type 'C1[]':
Type 'C3' is not assignable to type 'C1':
tests/cases/compiler/arrayAssignmentTest1.ts(65,1): error TS2323: Type 'C3[]' is not assignable to type 'C1[]'.
Type 'C3' is not assignable to type 'C1'.
Property 'IM1' is missing in type 'C3'.
tests/cases/compiler/arrayAssignmentTest1.ts(68,1): error TS2322: Type 'C1[]' is not assignable to type 'C2[]':
Type 'C1' is not assignable to type 'C2':
tests/cases/compiler/arrayAssignmentTest1.ts(68,1): error TS2323: Type 'C1[]' is not assignable to type 'C2[]'.
Type 'C1' is not assignable to type 'C2'.
Property 'C2M1' is missing in type 'C1'.
tests/cases/compiler/arrayAssignmentTest1.ts(69,1): error TS2322: Type 'I1[]' is not assignable to type 'C2[]':
Type 'I1' is not assignable to type 'C2':
tests/cases/compiler/arrayAssignmentTest1.ts(69,1): error TS2323: Type 'I1[]' is not assignable to type 'C2[]'.
Type 'I1' is not assignable to type 'C2'.
Property 'C2M1' is missing in type 'I1'.
tests/cases/compiler/arrayAssignmentTest1.ts(70,1): error TS2322: Type 'C3[]' is not assignable to type 'C2[]':
Type 'C3' is not assignable to type 'C2':
tests/cases/compiler/arrayAssignmentTest1.ts(70,1): error TS2323: Type 'C3[]' is not assignable to type 'C2[]'.
Type 'C3' is not assignable to type 'C2'.
Property 'C2M1' is missing in type 'C3'.
tests/cases/compiler/arrayAssignmentTest1.ts(75,1): error TS2322: Type 'C2[]' is not assignable to type 'C3[]':
Type 'C2' is not assignable to type 'C3':
tests/cases/compiler/arrayAssignmentTest1.ts(75,1): error TS2323: Type 'C2[]' is not assignable to type 'C3[]'.
Type 'C2' is not assignable to type 'C3'.
Property 'CM3M1' is missing in type 'C2'.
tests/cases/compiler/arrayAssignmentTest1.ts(76,1): error TS2322: Type 'C1[]' is not assignable to type 'C3[]':
Type 'C1' is not assignable to type 'C3':
tests/cases/compiler/arrayAssignmentTest1.ts(76,1): error TS2323: Type 'C1[]' is not assignable to type 'C3[]'.
Type 'C1' is not assignable to type 'C3'.
Property 'CM3M1' is missing in type 'C1'.
tests/cases/compiler/arrayAssignmentTest1.ts(77,1): error TS2322: Type 'I1[]' is not assignable to type 'C3[]':
Type 'I1' is not assignable to type 'C3':
tests/cases/compiler/arrayAssignmentTest1.ts(77,1): error TS2323: Type 'I1[]' is not assignable to type 'C3[]'.
Type 'I1' is not assignable to type 'C3'.
Property 'CM3M1' is missing in type 'I1'.
tests/cases/compiler/arrayAssignmentTest1.ts(79,1): error TS2322: Type '() => C1' is not assignable to type 'any[]':
tests/cases/compiler/arrayAssignmentTest1.ts(79,1): error TS2323: Type '() => C1' is not assignable to type 'any[]'.
Property 'push' is missing in type '() => C1'.
tests/cases/compiler/arrayAssignmentTest1.ts(80,1): error TS2322: Type '{ one: number; }' is not assignable to type 'any[]':
tests/cases/compiler/arrayAssignmentTest1.ts(80,1): error TS2323: Type '{ one: number; }' is not assignable to type 'any[]'.
Property 'length' is missing in type '{ one: number; }'.
tests/cases/compiler/arrayAssignmentTest1.ts(82,1): error TS2322: Type 'C1' is not assignable to type 'any[]':
tests/cases/compiler/arrayAssignmentTest1.ts(82,1): error TS2323: Type 'C1' is not assignable to type 'any[]'.
Property 'length' is missing in type 'C1'.
tests/cases/compiler/arrayAssignmentTest1.ts(83,1): error TS2322: Type 'C2' is not assignable to type 'any[]':
tests/cases/compiler/arrayAssignmentTest1.ts(83,1): error TS2323: Type 'C2' is not assignable to type 'any[]'.
Property 'length' is missing in type 'C2'.
tests/cases/compiler/arrayAssignmentTest1.ts(84,1): error TS2322: Type 'C3' is not assignable to type 'any[]':
tests/cases/compiler/arrayAssignmentTest1.ts(84,1): error TS2323: Type 'C3' is not assignable to type 'any[]'.
Property 'length' is missing in type 'C3'.
tests/cases/compiler/arrayAssignmentTest1.ts(85,1): error TS2322: Type 'I1' is not assignable to type 'any[]':
tests/cases/compiler/arrayAssignmentTest1.ts(85,1): error TS2323: Type 'I1' is not assignable to type 'any[]'.
Property 'length' is missing in type 'I1'.
@ -95,20 +95,20 @@ tests/cases/compiler/arrayAssignmentTest1.ts(85,1): error TS2322: Type 'I1' is n
var i1_error: I1 = []; // should be an error - is
~~~~~~~~
!!! error TS2322: Type 'undefined[]' is not assignable to type 'I1':
!!! error TS2322: Property 'IM1' is missing in type 'undefined[]'.
!!! error TS2323: Type 'undefined[]' is not assignable to type 'I1'.
!!! error TS2323: Property 'IM1' is missing in type 'undefined[]'.
var c1_error: C1 = []; // should be an error - is
~~~~~~~~
!!! error TS2322: Type 'undefined[]' is not assignable to type 'C1':
!!! error TS2322: Property 'IM1' is missing in type 'undefined[]'.
!!! error TS2323: Type 'undefined[]' is not assignable to type 'C1'.
!!! error TS2323: Property 'IM1' is missing in type 'undefined[]'.
var c2_error: C2 = []; // should be an error - is
~~~~~~~~
!!! error TS2322: Type 'undefined[]' is not assignable to type 'C2':
!!! error TS2322: Property 'C2M1' is missing in type 'undefined[]'.
!!! error TS2323: Type 'undefined[]' is not assignable to type 'C2'.
!!! error TS2323: Property 'C2M1' is missing in type 'undefined[]'.
var c3_error: C3 = []; // should be an error - is
~~~~~~~~
!!! error TS2322: Type 'undefined[]' is not assignable to type 'C3':
!!! error TS2322: Property 'CM3M1' is missing in type 'undefined[]'.
!!! error TS2323: Type 'undefined[]' is not assignable to type 'C3'.
!!! error TS2323: Property 'CM3M1' is missing in type 'undefined[]'.
arr_any = arr_i1; // should be ok - is
@ -121,81 +121,81 @@ tests/cases/compiler/arrayAssignmentTest1.ts(85,1): error TS2322: Type 'I1' is n
arr_i1 = arr_c2; // should be ok - subtype relationship - is
arr_i1 = arr_c3; // should be an error - is
~~~~~~
!!! error TS2322: Type 'C3[]' is not assignable to type 'I1[]':
!!! error TS2322: Type 'C3' is not assignable to type 'I1':
!!! error TS2322: Property 'IM1' is missing in type 'C3'.
!!! error TS2323: Type 'C3[]' is not assignable to type 'I1[]'.
!!! error TS2323: Type 'C3' is not assignable to type 'I1'.
!!! error TS2323: Property 'IM1' is missing in type 'C3'.
arr_c1 = arr_c1; // should be ok - subtype relationship - is
arr_c1 = arr_c2; // should be ok - subtype relationship - is
arr_c1 = arr_i1; // should be an error - is
~~~~~~
!!! error TS2322: Type 'I1[]' is not assignable to type 'C1[]':
!!! error TS2322: Type 'I1' is not assignable to type 'C1':
!!! error TS2322: Property 'C1M1' is missing in type 'I1'.
!!! error TS2323: Type 'I1[]' is not assignable to type 'C1[]'.
!!! error TS2323: Type 'I1' is not assignable to type 'C1'.
!!! error TS2323: Property 'C1M1' is missing in type 'I1'.
arr_c1 = arr_c3; // should be an error - is
~~~~~~
!!! error TS2322: Type 'C3[]' is not assignable to type 'C1[]':
!!! error TS2322: Type 'C3' is not assignable to type 'C1':
!!! error TS2322: Property 'IM1' is missing in type 'C3'.
!!! error TS2323: Type 'C3[]' is not assignable to type 'C1[]'.
!!! error TS2323: Type 'C3' is not assignable to type 'C1'.
!!! error TS2323: Property 'IM1' is missing in type 'C3'.
arr_c2 = arr_c2; // should be ok - subtype relationship - is
arr_c2 = arr_c1; // should be an error - subtype relationship - is
~~~~~~
!!! error TS2322: Type 'C1[]' is not assignable to type 'C2[]':
!!! error TS2322: Type 'C1' is not assignable to type 'C2':
!!! error TS2322: Property 'C2M1' is missing in type 'C1'.
!!! error TS2323: Type 'C1[]' is not assignable to type 'C2[]'.
!!! error TS2323: Type 'C1' is not assignable to type 'C2'.
!!! error TS2323: Property 'C2M1' is missing in type 'C1'.
arr_c2 = arr_i1; // should be an error - subtype relationship - is
~~~~~~
!!! error TS2322: Type 'I1[]' is not assignable to type 'C2[]':
!!! error TS2322: Type 'I1' is not assignable to type 'C2':
!!! error TS2322: Property 'C2M1' is missing in type 'I1'.
!!! error TS2323: Type 'I1[]' is not assignable to type 'C2[]'.
!!! error TS2323: Type 'I1' is not assignable to type 'C2'.
!!! error TS2323: Property 'C2M1' is missing in type 'I1'.
arr_c2 = arr_c3; // should be an error - is
~~~~~~
!!! error TS2322: Type 'C3[]' is not assignable to type 'C2[]':
!!! error TS2322: Type 'C3' is not assignable to type 'C2':
!!! error TS2322: Property 'C2M1' is missing in type 'C3'.
!!! error TS2323: Type 'C3[]' is not assignable to type 'C2[]'.
!!! error TS2323: Type 'C3' is not assignable to type 'C2'.
!!! error TS2323: Property 'C2M1' is missing in type 'C3'.
// "clean up bug" occurs at this point
// if you move these three expressions to another file, they raise an error
// something to do with state from the above propagating forward?
arr_c3 = arr_c2_2; // should be an error - is
~~~~~~
!!! error TS2322: Type 'C2[]' is not assignable to type 'C3[]':
!!! error TS2322: Type 'C2' is not assignable to type 'C3':
!!! error TS2322: Property 'CM3M1' is missing in type 'C2'.
!!! error TS2323: Type 'C2[]' is not assignable to type 'C3[]'.
!!! error TS2323: Type 'C2' is not assignable to type 'C3'.
!!! error TS2323: Property 'CM3M1' is missing in type 'C2'.
arr_c3 = arr_c1_2; // should be an error - is
~~~~~~
!!! error TS2322: Type 'C1[]' is not assignable to type 'C3[]':
!!! error TS2322: Type 'C1' is not assignable to type 'C3':
!!! error TS2322: Property 'CM3M1' is missing in type 'C1'.
!!! error TS2323: Type 'C1[]' is not assignable to type 'C3[]'.
!!! error TS2323: Type 'C1' is not assignable to type 'C3'.
!!! error TS2323: Property 'CM3M1' is missing in type 'C1'.
arr_c3 = arr_i1_2; // should be an error - is
~~~~~~
!!! error TS2322: Type 'I1[]' is not assignable to type 'C3[]':
!!! error TS2322: Type 'I1' is not assignable to type 'C3':
!!! error TS2322: Property 'CM3M1' is missing in type 'I1'.
!!! error TS2323: Type 'I1[]' is not assignable to type 'C3[]'.
!!! error TS2323: Type 'I1' is not assignable to type 'C3'.
!!! error TS2323: Property 'CM3M1' is missing in type 'I1'.
arr_any = f1; // should be an error - is
~~~~~~~
!!! error TS2322: Type '() => C1' is not assignable to type 'any[]':
!!! error TS2322: Property 'push' is missing in type '() => C1'.
!!! error TS2323: Type '() => C1' is not assignable to type 'any[]'.
!!! error TS2323: Property 'push' is missing in type '() => C1'.
arr_any = o1; // should be an error - is
~~~~~~~
!!! error TS2322: Type '{ one: number; }' is not assignable to type 'any[]':
!!! error TS2322: Property 'length' is missing in type '{ one: number; }'.
!!! error TS2323: Type '{ one: number; }' is not assignable to type 'any[]'.
!!! error TS2323: Property 'length' is missing in type '{ one: number; }'.
arr_any = a1; // should be ok - is
arr_any = c1; // should be an error - is
~~~~~~~
!!! error TS2322: Type 'C1' is not assignable to type 'any[]':
!!! error TS2322: Property 'length' is missing in type 'C1'.
!!! error TS2323: Type 'C1' is not assignable to type 'any[]'.
!!! error TS2323: Property 'length' is missing in type 'C1'.
arr_any = c2; // should be an error - is
~~~~~~~
!!! error TS2322: Type 'C2' is not assignable to type 'any[]':
!!! error TS2322: Property 'length' is missing in type 'C2'.
!!! error TS2323: Type 'C2' is not assignable to type 'any[]'.
!!! error TS2323: Property 'length' is missing in type 'C2'.
arr_any = c3; // should be an error - is
~~~~~~~
!!! error TS2322: Type 'C3' is not assignable to type 'any[]':
!!! error TS2322: Property 'length' is missing in type 'C3'.
!!! error TS2323: Type 'C3' is not assignable to type 'any[]'.
!!! error TS2323: Property 'length' is missing in type 'C3'.
arr_any = i1; // should be an error - is
~~~~~~~
!!! error TS2322: Type 'I1' is not assignable to type 'any[]':
!!! error TS2322: Property 'length' is missing in type 'I1'.
!!! error TS2323: Type 'I1' is not assignable to type 'any[]'.
!!! error TS2323: Property 'length' is missing in type 'I1'.

View File

@ -1,25 +1,25 @@
tests/cases/compiler/arrayAssignmentTest2.ts(47,1): error TS2322: Type 'C2[]' is not assignable to type 'C3[]':
Type 'C2' is not assignable to type 'C3':
tests/cases/compiler/arrayAssignmentTest2.ts(47,1): error TS2323: Type 'C2[]' is not assignable to type 'C3[]'.
Type 'C2' is not assignable to type 'C3'.
Property 'CM3M1' is missing in type 'C2'.
tests/cases/compiler/arrayAssignmentTest2.ts(48,1): error TS2322: Type 'C1[]' is not assignable to type 'C3[]':
Type 'C1' is not assignable to type 'C3':
tests/cases/compiler/arrayAssignmentTest2.ts(48,1): error TS2323: Type 'C1[]' is not assignable to type 'C3[]'.
Type 'C1' is not assignable to type 'C3'.
Property 'CM3M1' is missing in type 'C1'.
tests/cases/compiler/arrayAssignmentTest2.ts(49,1): error TS2322: Type 'I1[]' is not assignable to type 'C3[]':
Type 'I1' is not assignable to type 'C3':
tests/cases/compiler/arrayAssignmentTest2.ts(49,1): error TS2323: Type 'I1[]' is not assignable to type 'C3[]'.
Type 'I1' is not assignable to type 'C3'.
Property 'CM3M1' is missing in type 'I1'.
tests/cases/compiler/arrayAssignmentTest2.ts(51,1): error TS2322: Type '() => C1' is not assignable to type 'any[]':
tests/cases/compiler/arrayAssignmentTest2.ts(51,1): error TS2323: Type '() => C1' is not assignable to type 'any[]'.
Property 'push' is missing in type '() => C1'.
tests/cases/compiler/arrayAssignmentTest2.ts(52,1): error TS2322: Type '() => any' is not assignable to type 'any[]':
tests/cases/compiler/arrayAssignmentTest2.ts(52,1): error TS2323: Type '() => any' is not assignable to type 'any[]'.
Property 'push' is missing in type '() => any'.
tests/cases/compiler/arrayAssignmentTest2.ts(53,1): error TS2322: Type '{ one: number; }' is not assignable to type 'any[]':
tests/cases/compiler/arrayAssignmentTest2.ts(53,1): error TS2323: Type '{ one: number; }' is not assignable to type 'any[]'.
Property 'length' is missing in type '{ one: number; }'.
tests/cases/compiler/arrayAssignmentTest2.ts(55,1): error TS2322: Type 'C1' is not assignable to type 'any[]':
tests/cases/compiler/arrayAssignmentTest2.ts(55,1): error TS2323: Type 'C1' is not assignable to type 'any[]'.
Property 'length' is missing in type 'C1'.
tests/cases/compiler/arrayAssignmentTest2.ts(56,1): error TS2322: Type 'C2' is not assignable to type 'any[]':
tests/cases/compiler/arrayAssignmentTest2.ts(56,1): error TS2323: Type 'C2' is not assignable to type 'any[]'.
Property 'length' is missing in type 'C2'.
tests/cases/compiler/arrayAssignmentTest2.ts(57,1): error TS2322: Type 'C3' is not assignable to type 'any[]':
tests/cases/compiler/arrayAssignmentTest2.ts(57,1): error TS2323: Type 'C3' is not assignable to type 'any[]'.
Property 'length' is missing in type 'C3'.
tests/cases/compiler/arrayAssignmentTest2.ts(58,1): error TS2322: Type 'I1' is not assignable to type 'any[]':
tests/cases/compiler/arrayAssignmentTest2.ts(58,1): error TS2323: Type 'I1' is not assignable to type 'any[]'.
Property 'length' is missing in type 'I1'.
@ -72,47 +72,47 @@ tests/cases/compiler/arrayAssignmentTest2.ts(58,1): error TS2322: Type 'I1' is n
// "clean up error" occurs at this point
arr_c3 = arr_c2_2; // should be an error - is
~~~~~~
!!! error TS2322: Type 'C2[]' is not assignable to type 'C3[]':
!!! error TS2322: Type 'C2' is not assignable to type 'C3':
!!! error TS2322: Property 'CM3M1' is missing in type 'C2'.
!!! error TS2323: Type 'C2[]' is not assignable to type 'C3[]'.
!!! error TS2323: Type 'C2' is not assignable to type 'C3'.
!!! error TS2323: Property 'CM3M1' is missing in type 'C2'.
arr_c3 = arr_c1_2; // should be an error - is
~~~~~~
!!! error TS2322: Type 'C1[]' is not assignable to type 'C3[]':
!!! error TS2322: Type 'C1' is not assignable to type 'C3':
!!! error TS2322: Property 'CM3M1' is missing in type 'C1'.
!!! error TS2323: Type 'C1[]' is not assignable to type 'C3[]'.
!!! error TS2323: Type 'C1' is not assignable to type 'C3'.
!!! error TS2323: Property 'CM3M1' is missing in type 'C1'.
arr_c3 = arr_i1_2; // should be an error - is
~~~~~~
!!! error TS2322: Type 'I1[]' is not assignable to type 'C3[]':
!!! error TS2322: Type 'I1' is not assignable to type 'C3':
!!! error TS2322: Property 'CM3M1' is missing in type 'I1'.
!!! error TS2323: Type 'I1[]' is not assignable to type 'C3[]'.
!!! error TS2323: Type 'I1' is not assignable to type 'C3'.
!!! error TS2323: Property 'CM3M1' is missing in type 'I1'.
arr_any = f1; // should be an error - is
~~~~~~~
!!! error TS2322: Type '() => C1' is not assignable to type 'any[]':
!!! error TS2322: Property 'push' is missing in type '() => C1'.
!!! error TS2323: Type '() => C1' is not assignable to type 'any[]'.
!!! error TS2323: Property 'push' is missing in type '() => C1'.
arr_any = function () { return null;} // should be an error - is
~~~~~~~
!!! error TS2322: Type '() => any' is not assignable to type 'any[]':
!!! error TS2322: Property 'push' is missing in type '() => any'.
!!! error TS2323: Type '() => any' is not assignable to type 'any[]'.
!!! error TS2323: Property 'push' is missing in type '() => any'.
arr_any = o1; // should be an error - is
~~~~~~~
!!! error TS2322: Type '{ one: number; }' is not assignable to type 'any[]':
!!! error TS2322: Property 'length' is missing in type '{ one: number; }'.
!!! error TS2323: Type '{ one: number; }' is not assignable to type 'any[]'.
!!! error TS2323: Property 'length' is missing in type '{ one: number; }'.
arr_any = a1; // should be ok - is
arr_any = c1; // should be an error - is
~~~~~~~
!!! error TS2322: Type 'C1' is not assignable to type 'any[]':
!!! error TS2322: Property 'length' is missing in type 'C1'.
!!! error TS2323: Type 'C1' is not assignable to type 'any[]'.
!!! error TS2323: Property 'length' is missing in type 'C1'.
arr_any = c2; // should be an error - is
~~~~~~~
!!! error TS2322: Type 'C2' is not assignable to type 'any[]':
!!! error TS2322: Property 'length' is missing in type 'C2'.
!!! error TS2323: Type 'C2' is not assignable to type 'any[]'.
!!! error TS2323: Property 'length' is missing in type 'C2'.
arr_any = c3; // should be an error - is
~~~~~~~
!!! error TS2322: Type 'C3' is not assignable to type 'any[]':
!!! error TS2322: Property 'length' is missing in type 'C3'.
!!! error TS2323: Type 'C3' is not assignable to type 'any[]'.
!!! error TS2323: Property 'length' is missing in type 'C3'.
arr_any = i1; // should be an error - is
~~~~~~~
!!! error TS2322: Type 'I1' is not assignable to type 'any[]':
!!! error TS2322: Property 'length' is missing in type 'I1'.
!!! error TS2323: Type 'I1' is not assignable to type 'any[]'.
!!! error TS2323: Property 'length' is missing in type 'I1'.

View File

@ -1,6 +1,6 @@
tests/cases/compiler/arrayAssignmentTest4.ts(24,1): error TS2322: Type '() => any' is not assignable to type 'any[]':
tests/cases/compiler/arrayAssignmentTest4.ts(24,1): error TS2323: Type '() => any' is not assignable to type 'any[]'.
Property 'push' is missing in type '() => any'.
tests/cases/compiler/arrayAssignmentTest4.ts(25,1): error TS2322: Type 'C3' is not assignable to type 'any[]':
tests/cases/compiler/arrayAssignmentTest4.ts(25,1): error TS2323: Type 'C3' is not assignable to type 'any[]'.
Property 'length' is missing in type 'C3'.
@ -30,10 +30,10 @@ tests/cases/compiler/arrayAssignmentTest4.ts(25,1): error TS2322: Type 'C3' is n
arr_any = function () { return null;} // should be an error - is
~~~~~~~
!!! error TS2322: Type '() => any' is not assignable to type 'any[]':
!!! error TS2322: Property 'push' is missing in type '() => any'.
!!! error TS2323: Type '() => any' is not assignable to type 'any[]'.
!!! error TS2323: Property 'push' is missing in type '() => any'.
arr_any = c3; // should be an error - is
~~~~~~~
!!! error TS2322: Type 'C3' is not assignable to type 'any[]':
!!! error TS2322: Property 'length' is missing in type 'C3'.
!!! error TS2323: Type 'C3' is not assignable to type 'any[]'.
!!! error TS2323: Property 'length' is missing in type 'C3'.

View File

@ -1,5 +1,5 @@
tests/cases/compiler/arrayAssignmentTest5.ts(23,17): error TS2322: Type 'IToken[]' is not assignable to type 'IStateToken[]':
Type 'IToken' is not assignable to type 'IStateToken':
tests/cases/compiler/arrayAssignmentTest5.ts(23,17): error TS2323: Type 'IToken[]' is not assignable to type 'IStateToken[]'.
Type 'IToken' is not assignable to type 'IStateToken'.
Property 'state' is missing in type 'IToken'.
@ -28,9 +28,9 @@ tests/cases/compiler/arrayAssignmentTest5.ts(23,17): error TS2322: Type 'IToken[
var lineTokens:ILineTokens= this.tokenize(line, state, true);
var tokens:IStateToken[]= lineTokens.tokens;
~~~~~~
!!! error TS2322: Type 'IToken[]' is not assignable to type 'IStateToken[]':
!!! error TS2322: Type 'IToken' is not assignable to type 'IStateToken':
!!! error TS2322: Property 'state' is missing in type 'IToken'.
!!! error TS2323: Type 'IToken[]' is not assignable to type 'IStateToken[]'.
!!! error TS2323: Type 'IToken' is not assignable to type 'IStateToken'.
!!! error TS2323: Property 'state' is missing in type 'IToken'.
if (tokens.length === 0) {
return this.onEnter(line, tokens, offset); // <== this should produce an error since onEnter can not be called with (string, IStateToken[], offset)
}

View File

@ -1,5 +1,5 @@
tests/cases/compiler/arrayCast.ts(3,1): error TS2353: Neither type '{ foo: string; }[]' nor type '{ id: number; }[]' is assignable to the other:
Type '{ foo: string; }' is not assignable to type '{ id: number; }':
tests/cases/compiler/arrayCast.ts(3,1): error TS2352: Neither type '{ foo: string; }[]' nor type '{ id: number; }[]' is assignable to the other.
Type '{ foo: string; }' is not assignable to type '{ id: number; }'.
Property 'id' is missing in type '{ foo: string; }'.
@ -8,9 +8,9 @@ tests/cases/compiler/arrayCast.ts(3,1): error TS2353: Neither type '{ foo: strin
// has type { foo: string }[], which is not assignable to { id: number }[].
<{ id: number; }[]>[{ foo: "s" }];
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2353: Neither type '{ foo: string; }[]' nor type '{ id: number; }[]' is assignable to the other:
!!! error TS2353: Type '{ foo: string; }' is not assignable to type '{ id: number; }':
!!! error TS2353: Property 'id' is missing in type '{ foo: string; }'.
!!! error TS2352: Neither type '{ foo: string; }[]' nor type '{ id: number; }[]' is assignable to the other.
!!! error TS2352: Type '{ foo: string; }' is not assignable to type '{ id: number; }'.
!!! error TS2352: Property 'id' is missing in type '{ foo: string; }'.
// Should succeed, as the {} element causes the type of the array to be {}[]
<{ id: number; }[]>[{ foo: "s" }, {}];

View File

@ -1,9 +1,9 @@
tests/cases/compiler/arraySigChecking.ts(11,17): error TS1023: An index signature parameter type must be 'string' or 'number'.
tests/cases/compiler/arraySigChecking.ts(18,5): error TS2322: Type 'void[]' is not assignable to type 'string[]':
tests/cases/compiler/arraySigChecking.ts(18,5): error TS2323: Type 'void[]' is not assignable to type 'string[]'.
Type 'void' is not assignable to type 'string'.
tests/cases/compiler/arraySigChecking.ts(22,1): error TS2322: Type 'number[][]' is not assignable to type 'number[][][]':
Type 'number[]' is not assignable to type 'number[][]':
Type 'number' is not assignable to type 'number[]':
tests/cases/compiler/arraySigChecking.ts(22,1): error TS2323: Type 'number[][]' is not assignable to type 'number[][][]'.
Type 'number[]' is not assignable to type 'number[][]'.
Type 'number' is not assignable to type 'number[]'.
Property 'length' is missing in type 'Number'.
@ -29,17 +29,17 @@ tests/cases/compiler/arraySigChecking.ts(22,1): error TS2322: Type 'number[][]'
var myVar: myInt;
var strArray: string[] = [myVar.voidFn()];
~~~~~~~~
!!! error TS2322: Type 'void[]' is not assignable to type 'string[]':
!!! error TS2322: Type 'void' is not assignable to type 'string'.
!!! error TS2323: Type 'void[]' is not assignable to type 'string[]'.
!!! error TS2323: Type 'void' is not assignable to type 'string'.
var myArray: number[][][];
myArray = [[1, 2]];
~~~~~~~
!!! error TS2322: Type 'number[][]' is not assignable to type 'number[][][]':
!!! error TS2322: Type 'number[]' is not assignable to type 'number[][]':
!!! error TS2322: Type 'number' is not assignable to type 'number[]':
!!! error TS2322: Property 'length' is missing in type 'Number'.
!!! error TS2323: Type 'number[][]' is not assignable to type 'number[][][]'.
!!! error TS2323: Type 'number[]' is not assignable to type 'number[][]'.
!!! error TS2323: Type 'number' is not assignable to type 'number[]'.
!!! error TS2323: Property 'length' is missing in type 'Number'.
function isEmpty(l: { length: number }) {
return l.length === 0;

View File

@ -2,7 +2,7 @@ tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(
tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(6,30): error TS1109: Expression expected.
tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(7,22): error TS1005: '=' expected.
tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(7,32): error TS1109: Expression expected.
tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(6,5): error TS2322: Type 'number' is not assignable to type '{ (arrayLength?: number): any[]; <T>(arrayLength: number): T[]; <T>(...items: T[]): T[]; new (arrayLength?: number): any[]; new <T>(arrayLength: number): T[]; new <T>(...items: T[]): T[]; isArray(arg: any): boolean; prototype: any[]; }':
tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(6,5): error TS2323: Type 'number' is not assignable to type '{ (arrayLength?: number): any[]; <T>(arrayLength: number): T[]; <T>(...items: T[]): T[]; new (arrayLength?: number): any[]; new <T>(arrayLength: number): T[]; new <T>(...items: T[]): T[]; isArray(arg: any): boolean; prototype: any[]; }'.
Property 'isArray' is missing in type 'Number'.
tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(7,5): error TS2323: Type 'number' is not assignable to type '{ (arrayLength?: number): any[]; <T>(arrayLength: number): T[]; <T>(...items: T[]): T[]; new (arrayLength?: number): any[]; new <T>(arrayLength: number): T[]; new <T>(...items: T[]): T[]; isArray(arg: any): boolean; prototype: any[]; }'.
@ -19,8 +19,8 @@ tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(
~
!!! error TS1109: Expression expected.
~~~
!!! error TS2322: Type 'number' is not assignable to type '{ (arrayLength?: number): any[]; <T>(arrayLength: number): T[]; <T>(...items: T[]): T[]; new (arrayLength?: number): any[]; new <T>(arrayLength: number): T[]; new <T>(...items: T[]): T[]; isArray(arg: any): boolean; prototype: any[]; }':
!!! error TS2322: Property 'isArray' is missing in type 'Number'.
!!! error TS2323: Type 'number' is not assignable to type '{ (arrayLength?: number): any[]; <T>(arrayLength: number): T[]; <T>(...items: T[]): T[]; new (arrayLength?: number): any[]; new <T>(arrayLength: number): T[]; new <T>(...items: T[]): T[]; isArray(arg: any): boolean; prototype: any[]; }'.
!!! error TS2323: Property 'isArray' is missing in type 'Number'.
var xs4: typeof Array<typeof x>;
~
!!! error TS1005: '=' expected.

View File

@ -1,6 +1,6 @@
tests/cases/compiler/assignmentCompat1.ts(4,1): error TS2322: Type '{ [x: string]: any; }' is not assignable to type '{ one: number; }':
tests/cases/compiler/assignmentCompat1.ts(4,1): error TS2323: Type '{ [x: string]: any; }' is not assignable to type '{ one: number; }'.
Property 'one' is missing in type '{ [x: string]: any; }'.
tests/cases/compiler/assignmentCompat1.ts(5,1): error TS2322: Type '{ one: number; }' is not assignable to type '{ [x: string]: any; }':
tests/cases/compiler/assignmentCompat1.ts(5,1): error TS2323: Type '{ one: number; }' is not assignable to type '{ [x: string]: any; }'.
Index signature is missing in type '{ one: number; }'.
@ -10,9 +10,9 @@ tests/cases/compiler/assignmentCompat1.ts(5,1): error TS2322: Type '{ one: numbe
x = y;
~
!!! error TS2322: Type '{ [x: string]: any; }' is not assignable to type '{ one: number; }':
!!! error TS2322: Property 'one' is missing in type '{ [x: string]: any; }'.
!!! error TS2323: Type '{ [x: string]: any; }' is not assignable to type '{ one: number; }'.
!!! error TS2323: Property 'one' is missing in type '{ [x: string]: any; }'.
y = x;
~
!!! error TS2322: Type '{ one: number; }' is not assignable to type '{ [x: string]: any; }':
!!! error TS2322: Index signature is missing in type '{ one: number; }'.
!!! error TS2323: Type '{ one: number; }' is not assignable to type '{ [x: string]: any; }'.
!!! error TS2323: Index signature is missing in type '{ one: number; }'.

View File

@ -1,9 +1,9 @@
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatBetweenTupleAndArray.ts(17,1): error TS2322: Type '[number, string]' is not assignable to type 'number[]':
Types of property 'pop' are incompatible:
Type '() => string | number' is not assignable to type '() => number':
Type 'string | number' is not assignable to type 'number':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatBetweenTupleAndArray.ts(17,1): error TS2323: Type '[number, string]' is not assignable to type 'number[]'.
Types of property 'pop' are incompatible.
Type '() => string | number' is not assignable to type '() => number'.
Type 'string | number' is not assignable to type 'number'.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatBetweenTupleAndArray.ts(18,1): error TS2322: Type '{}[]' is not assignable to type '[{}]':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatBetweenTupleAndArray.ts(18,1): error TS2323: Type '{}[]' is not assignable to type '[{}]'.
Property '0' is missing in type '{}[]'.
@ -26,13 +26,13 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
// error
numArray = numStrTuple;
~~~~~~~~
!!! error TS2322: Type '[number, string]' is not assignable to type 'number[]':
!!! error TS2322: Types of property 'pop' are incompatible:
!!! error TS2322: Type '() => string | number' is not assignable to type '() => number':
!!! error TS2322: Type 'string | number' is not assignable to type 'number':
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2323: Type '[number, string]' is not assignable to type 'number[]'.
!!! error TS2323: Types of property 'pop' are incompatible.
!!! error TS2323: Type '() => string | number' is not assignable to type '() => number'.
!!! error TS2323: Type 'string | number' is not assignable to type 'number'.
!!! error TS2323: Type 'string' is not assignable to type 'number'.
emptyObjTuple = emptyObjArray;
~~~~~~~~~~~~~
!!! error TS2322: Type '{}[]' is not assignable to type '[{}]':
!!! error TS2322: Property '0' is missing in type '{}[]'.
!!! error TS2323: Type '{}[]' is not assignable to type '[{}]'.
!!! error TS2323: Property '0' is missing in type '{}[]'.

View File

@ -1,25 +1,25 @@
tests/cases/compiler/assignmentCompatBug2.ts(1,5): error TS2322: Type '{ a: number; }' is not assignable to type '{ b: number; }':
tests/cases/compiler/assignmentCompatBug2.ts(1,5): error TS2323: Type '{ a: number; }' is not assignable to type '{ b: number; }'.
Property 'b' is missing in type '{ a: number; }'.
tests/cases/compiler/assignmentCompatBug2.ts(3,1): error TS2322: Type '{ a: number; }' is not assignable to type '{ b: number; }':
tests/cases/compiler/assignmentCompatBug2.ts(3,1): error TS2323: Type '{ a: number; }' is not assignable to type '{ b: number; }'.
Property 'b' is missing in type '{ a: number; }'.
tests/cases/compiler/assignmentCompatBug2.ts(15,1): error TS2322: Type '{ f: (n: number) => number; g: (s: string) => number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }':
tests/cases/compiler/assignmentCompatBug2.ts(15,1): error TS2323: Type '{ f: (n: number) => number; g: (s: string) => number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'.
Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; }'.
tests/cases/compiler/assignmentCompatBug2.ts(20,1): error TS2322: Type '{ f: (n: number) => number; m: number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }':
tests/cases/compiler/assignmentCompatBug2.ts(20,1): error TS2323: Type '{ f: (n: number) => number; m: number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'.
Property 'g' is missing in type '{ f: (n: number) => number; m: number; }'.
tests/cases/compiler/assignmentCompatBug2.ts(33,1): error TS2322: Type '{ f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }':
tests/cases/compiler/assignmentCompatBug2.ts(33,1): error TS2323: Type '{ f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'.
Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; }'.
==== tests/cases/compiler/assignmentCompatBug2.ts (5 errors) ====
var b2: { b: number;} = { a: 0 }; // error
~~
!!! error TS2322: Type '{ a: number; }' is not assignable to type '{ b: number; }':
!!! error TS2322: Property 'b' is missing in type '{ a: number; }'.
!!! error TS2323: Type '{ a: number; }' is not assignable to type '{ b: number; }'.
!!! error TS2323: Property 'b' is missing in type '{ a: number; }'.
b2 = { a: 0 }; // error
~~
!!! error TS2322: Type '{ a: number; }' is not assignable to type '{ b: number; }':
!!! error TS2322: Property 'b' is missing in type '{ a: number; }'.
!!! error TS2323: Type '{ a: number; }' is not assignable to type '{ b: number; }'.
!!! error TS2323: Property 'b' is missing in type '{ a: number; }'.
b2 = {b: 0, a: 0 };
@ -33,16 +33,16 @@ tests/cases/compiler/assignmentCompatBug2.ts(33,1): error TS2322: Type '{ f: (n:
b3 = {
~~
!!! error TS2322: Type '{ f: (n: number) => number; g: (s: string) => number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }':
!!! error TS2322: Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; }'.
!!! error TS2323: Type '{ f: (n: number) => number; g: (s: string) => number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'.
!!! error TS2323: Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; }'.
f: (n) => { return 0; },
g: (s) => { return 0; },
}; // error
b3 = {
~~
!!! error TS2322: Type '{ f: (n: number) => number; m: number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }':
!!! error TS2322: Property 'g' is missing in type '{ f: (n: number) => number; m: number; }'.
!!! error TS2323: Type '{ f: (n: number) => number; m: number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'.
!!! error TS2323: Property 'g' is missing in type '{ f: (n: number) => number; m: number; }'.
f: (n) => { return 0; },
m: 0,
}; // error
@ -57,8 +57,8 @@ tests/cases/compiler/assignmentCompatBug2.ts(33,1): error TS2322: Type '{ f: (n:
b3 = {
~~
!!! error TS2322: Type '{ f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }':
!!! error TS2322: Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; }'.
!!! error TS2323: Type '{ f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'.
!!! error TS2323: Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; }'.
f: (n) => { return 0; },
g: (s) => { return 0; },
n: 0,

View File

@ -1,6 +1,6 @@
tests/cases/compiler/assignmentCompatFunctionsWithOptionalArgs.ts(1,10): error TS2391: Function implementation is missing or not immediately following the declaration.
tests/cases/compiler/assignmentCompatFunctionsWithOptionalArgs.ts(4,5): error TS2345: Argument of type '{ id: number; name: boolean; }' is not assignable to parameter of type '{ id: number; name?: string; }'.
Types of property 'name' are incompatible:
Types of property 'name' are incompatible.
Type 'boolean' is not assignable to type 'string'.
tests/cases/compiler/assignmentCompatFunctionsWithOptionalArgs.ts(5,5): error TS2345: Argument of type '{ name: string; }' is not assignable to parameter of type '{ id: number; name?: string; }'.
Property 'id' is missing in type '{ name: string; }'.
@ -15,7 +15,7 @@ tests/cases/compiler/assignmentCompatFunctionsWithOptionalArgs.ts(5,5): error TS
foo({ id: 1234, name: false }); // Error, name of wrong type
~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '{ id: number; name: boolean; }' is not assignable to parameter of type '{ id: number; name?: string; }'.
!!! error TS2345: Types of property 'name' are incompatible:
!!! error TS2345: Types of property 'name' are incompatible.
!!! error TS2345: Type 'boolean' is not assignable to type 'string'.
foo({ name: "hello" }); // Error, id required but missing
~~~~~~~~~~~~~~~~~

View File

@ -1,26 +1,26 @@
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(35,1): error TS2322: Type 'S2' is not assignable to type 'T':
Types of parameters 'x' and 'x' are incompatible:
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(35,1): error TS2323: Type 'S2' is not assignable to type 'T'.
Types of parameters 'x' and 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(36,1): error TS2322: Type '(x: string) => void' is not assignable to type 'T':
Types of parameters 'x' and 'x' are incompatible:
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(36,1): error TS2323: Type '(x: string) => void' is not assignable to type 'T'.
Types of parameters 'x' and 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(37,1): error TS2322: Type '(x: string) => number' is not assignable to type 'T':
Types of parameters 'x' and 'x' are incompatible:
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(37,1): error TS2323: Type '(x: string) => number' is not assignable to type 'T'.
Types of parameters 'x' and 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(38,1): error TS2322: Type '(x: string) => string' is not assignable to type 'T':
Types of parameters 'x' and 'x' are incompatible:
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(38,1): error TS2323: Type '(x: string) => string' is not assignable to type 'T'.
Types of parameters 'x' and 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(39,1): error TS2322: Type 'S2' is not assignable to type '(x: number) => void':
Types of parameters 'x' and 'x' are incompatible:
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(39,1): error TS2323: Type 'S2' is not assignable to type '(x: number) => void'.
Types of parameters 'x' and 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(40,1): error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void':
Types of parameters 'x' and 'x' are incompatible:
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(40,1): error TS2323: Type '(x: string) => void' is not assignable to type '(x: number) => void'.
Types of parameters 'x' and 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(41,1): error TS2322: Type '(x: string) => number' is not assignable to type '(x: number) => void':
Types of parameters 'x' and 'x' are incompatible:
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(41,1): error TS2323: Type '(x: string) => number' is not assignable to type '(x: number) => void'.
Types of parameters 'x' and 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(42,1): error TS2322: Type '(x: string) => string' is not assignable to type '(x: number) => void':
Types of parameters 'x' and 'x' are incompatible:
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(42,1): error TS2323: Type '(x: string) => string' is not assignable to type '(x: number) => void'.
Types of parameters 'x' and 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
@ -61,42 +61,42 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
// these are errors
t = s2;
~
!!! error TS2322: Type 'S2' is not assignable to type 'T':
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible:
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2323: Type 'S2' is not assignable to type 'T'.
!!! error TS2323: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2323: Type 'string' is not assignable to type 'number'.
t = a3;
~
!!! error TS2322: Type '(x: string) => void' is not assignable to type 'T':
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible:
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2323: Type '(x: string) => void' is not assignable to type 'T'.
!!! error TS2323: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2323: Type 'string' is not assignable to type 'number'.
t = (x: string) => 1;
~
!!! error TS2322: Type '(x: string) => number' is not assignable to type 'T':
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible:
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2323: Type '(x: string) => number' is not assignable to type 'T'.
!!! error TS2323: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2323: Type 'string' is not assignable to type 'number'.
t = function (x: string) { return ''; }
~
!!! error TS2322: Type '(x: string) => string' is not assignable to type 'T':
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible:
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2323: Type '(x: string) => string' is not assignable to type 'T'.
!!! error TS2323: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2323: Type 'string' is not assignable to type 'number'.
a = s2;
~
!!! error TS2322: Type 'S2' is not assignable to type '(x: number) => void':
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible:
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2323: Type 'S2' is not assignable to type '(x: number) => void'.
!!! error TS2323: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2323: Type 'string' is not assignable to type 'number'.
a = a3;
~
!!! error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void':
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible:
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2323: Type '(x: string) => void' is not assignable to type '(x: number) => void'.
!!! error TS2323: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2323: Type 'string' is not assignable to type 'number'.
a = (x: string) => 1;
~
!!! error TS2322: Type '(x: string) => number' is not assignable to type '(x: number) => void':
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible:
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2323: Type '(x: string) => number' is not assignable to type '(x: number) => void'.
!!! error TS2323: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2323: Type 'string' is not assignable to type 'number'.
a = function (x: string) { return ''; }
~
!!! error TS2322: Type '(x: string) => string' is not assignable to type '(x: number) => void':
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible:
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2323: Type '(x: string) => string' is not assignable to type '(x: number) => void'.
!!! error TS2323: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2323: Type 'string' is not assignable to type 'number'.

View File

@ -1,38 +1,38 @@
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(31,1): error TS2322: Type '() => number' is not assignable to type 'T':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(31,1): error TS2323: Type '() => number' is not assignable to type 'T'.
Property 'f' is missing in type '() => number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(32,1): error TS2322: Type '(x: number) => string' is not assignable to type 'T':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(32,1): error TS2323: Type '(x: number) => string' is not assignable to type 'T'.
Property 'f' is missing in type '(x: number) => string'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(33,1): error TS2322: Type '() => number' is not assignable to type '{ f(x: number): void; }':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(33,1): error TS2323: Type '() => number' is not assignable to type '{ f(x: number): void; }'.
Property 'f' is missing in type '() => number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(34,1): error TS2322: Type '(x: number) => string' is not assignable to type '{ f(x: number): void; }':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(34,1): error TS2323: Type '(x: number) => string' is not assignable to type '{ f(x: number): void; }'.
Property 'f' is missing in type '(x: number) => string'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(42,1): error TS2322: Type 'S2' is not assignable to type 'T':
Types of property 'f' are incompatible:
Type '(x: string) => void' is not assignable to type '(x: number) => void':
Types of parameters 'x' and 'x' are incompatible:
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(42,1): error TS2323: Type 'S2' is not assignable to type 'T'.
Types of property 'f' are incompatible.
Type '(x: string) => void' is not assignable to type '(x: number) => void'.
Types of parameters 'x' and 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(43,1): error TS2322: Type '{ f(x: string): void; }' is not assignable to type 'T':
Types of property 'f' are incompatible:
Type '(x: string) => void' is not assignable to type '(x: number) => void':
Types of parameters 'x' and 'x' are incompatible:
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(43,1): error TS2323: Type '{ f(x: string): void; }' is not assignable to type 'T'.
Types of property 'f' are incompatible.
Type '(x: string) => void' is not assignable to type '(x: number) => void'.
Types of parameters 'x' and 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(44,1): error TS2322: Type '(x: string) => number' is not assignable to type 'T':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(44,1): error TS2323: Type '(x: string) => number' is not assignable to type 'T'.
Property 'f' is missing in type '(x: string) => number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(45,1): error TS2322: Type '(x: string) => string' is not assignable to type 'T':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(45,1): error TS2323: Type '(x: string) => string' is not assignable to type 'T'.
Property 'f' is missing in type '(x: string) => string'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(46,1): error TS2322: Type 'S2' is not assignable to type '{ f(x: number): void; }':
Types of property 'f' are incompatible:
Type '(x: string) => void' is not assignable to type '(x: number) => void':
Types of parameters 'x' and 'x' are incompatible:
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(46,1): error TS2323: Type 'S2' is not assignable to type '{ f(x: number): void; }'.
Types of property 'f' are incompatible.
Type '(x: string) => void' is not assignable to type '(x: number) => void'.
Types of parameters 'x' and 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(47,1): error TS2322: Type '{ f(x: string): void; }' is not assignable to type '{ f(x: number): void; }':
Types of property 'f' are incompatible:
Type '(x: string) => void' is not assignable to type '(x: number) => void':
Types of parameters 'x' and 'x' are incompatible:
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(47,1): error TS2323: Type '{ f(x: string): void; }' is not assignable to type '{ f(x: number): void; }'.
Types of property 'f' are incompatible.
Type '(x: string) => void' is not assignable to type '(x: number) => void'.
Types of parameters 'x' and 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(48,1): error TS2322: Type '(x: string) => number' is not assignable to type '{ f(x: number): void; }':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(48,1): error TS2323: Type '(x: string) => number' is not assignable to type '{ f(x: number): void; }'.
Property 'f' is missing in type '(x: string) => number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(49,1): error TS2322: Type '(x: string) => string' is not assignable to type '{ f(x: number): void; }':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(49,1): error TS2323: Type '(x: string) => string' is not assignable to type '{ f(x: number): void; }'.
Property 'f' is missing in type '(x: string) => string'.
@ -69,20 +69,20 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
// errors
t = () => 1;
~
!!! error TS2322: Type '() => number' is not assignable to type 'T':
!!! error TS2322: Property 'f' is missing in type '() => number'.
!!! error TS2323: Type '() => number' is not assignable to type 'T'.
!!! error TS2323: Property 'f' is missing in type '() => number'.
t = function (x: number) { return ''; }
~
!!! error TS2322: Type '(x: number) => string' is not assignable to type 'T':
!!! error TS2322: Property 'f' is missing in type '(x: number) => string'.
!!! error TS2323: Type '(x: number) => string' is not assignable to type 'T'.
!!! error TS2323: Property 'f' is missing in type '(x: number) => string'.
a = () => 1;
~
!!! error TS2322: Type '() => number' is not assignable to type '{ f(x: number): void; }':
!!! error TS2322: Property 'f' is missing in type '() => number'.
!!! error TS2323: Type '() => number' is not assignable to type '{ f(x: number): void; }'.
!!! error TS2323: Property 'f' is missing in type '() => number'.
a = function (x: number) { return ''; }
~
!!! error TS2322: Type '(x: number) => string' is not assignable to type '{ f(x: number): void; }':
!!! error TS2322: Property 'f' is missing in type '(x: number) => string'.
!!! error TS2323: Type '(x: number) => string' is not assignable to type '{ f(x: number): void; }'.
!!! error TS2323: Property 'f' is missing in type '(x: number) => string'.
interface S2 {
f(x: string): void;
@ -92,46 +92,46 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
// these are errors
t = s2;
~
!!! error TS2322: Type 'S2' is not assignable to type 'T':
!!! error TS2322: Types of property 'f' are incompatible:
!!! error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void':
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible:
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2323: Type 'S2' is not assignable to type 'T'.
!!! error TS2323: Types of property 'f' are incompatible.
!!! error TS2323: Type '(x: string) => void' is not assignable to type '(x: number) => void'.
!!! error TS2323: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2323: Type 'string' is not assignable to type 'number'.
t = a3;
~
!!! error TS2322: Type '{ f(x: string): void; }' is not assignable to type 'T':
!!! error TS2322: Types of property 'f' are incompatible:
!!! error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void':
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible:
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2323: Type '{ f(x: string): void; }' is not assignable to type 'T'.
!!! error TS2323: Types of property 'f' are incompatible.
!!! error TS2323: Type '(x: string) => void' is not assignable to type '(x: number) => void'.
!!! error TS2323: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2323: Type 'string' is not assignable to type 'number'.
t = (x: string) => 1;
~
!!! error TS2322: Type '(x: string) => number' is not assignable to type 'T':
!!! error TS2322: Property 'f' is missing in type '(x: string) => number'.
!!! error TS2323: Type '(x: string) => number' is not assignable to type 'T'.
!!! error TS2323: Property 'f' is missing in type '(x: string) => number'.
t = function (x: string) { return ''; }
~
!!! error TS2322: Type '(x: string) => string' is not assignable to type 'T':
!!! error TS2322: Property 'f' is missing in type '(x: string) => string'.
!!! error TS2323: Type '(x: string) => string' is not assignable to type 'T'.
!!! error TS2323: Property 'f' is missing in type '(x: string) => string'.
a = s2;
~
!!! error TS2322: Type 'S2' is not assignable to type '{ f(x: number): void; }':
!!! error TS2322: Types of property 'f' are incompatible:
!!! error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void':
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible:
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2323: Type 'S2' is not assignable to type '{ f(x: number): void; }'.
!!! error TS2323: Types of property 'f' are incompatible.
!!! error TS2323: Type '(x: string) => void' is not assignable to type '(x: number) => void'.
!!! error TS2323: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2323: Type 'string' is not assignable to type 'number'.
a = a3;
~
!!! error TS2322: Type '{ f(x: string): void; }' is not assignable to type '{ f(x: number): void; }':
!!! error TS2322: Types of property 'f' are incompatible:
!!! error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void':
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible:
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2323: Type '{ f(x: string): void; }' is not assignable to type '{ f(x: number): void; }'.
!!! error TS2323: Types of property 'f' are incompatible.
!!! error TS2323: Type '(x: string) => void' is not assignable to type '(x: number) => void'.
!!! error TS2323: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2323: Type 'string' is not assignable to type 'number'.
a = (x: string) => 1;
~
!!! error TS2322: Type '(x: string) => number' is not assignable to type '{ f(x: number): void; }':
!!! error TS2322: Property 'f' is missing in type '(x: string) => number'.
!!! error TS2323: Type '(x: string) => number' is not assignable to type '{ f(x: number): void; }'.
!!! error TS2323: Property 'f' is missing in type '(x: string) => number'.
a = function (x: string) { return ''; }
~
!!! error TS2322: Type '(x: string) => string' is not assignable to type '{ f(x: number): void; }':
!!! error TS2322: Property 'f' is missing in type '(x: string) => string'.
!!! error TS2323: Type '(x: string) => string' is not assignable to type '{ f(x: number): void; }'.
!!! error TS2323: Property 'f' is missing in type '(x: string) => string'.

View File

@ -1,16 +1,16 @@
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures4.ts(52,9): error TS2322: Type '<T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived':
Types of parameters 'y' and 'y' are incompatible:
Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived':
Types of parameters 'arg2' and 'arg2' are incompatible:
Type '{ foo: number; }' is not assignable to type 'Base':
Types of property 'foo' are incompatible:
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures4.ts(52,9): error TS2323: Type '<T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'.
Types of parameters 'y' and 'y' are incompatible.
Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'.
Types of parameters 'arg2' and 'arg2' are incompatible.
Type '{ foo: number; }' is not assignable to type 'Base'.
Types of property 'foo' are incompatible.
Type 'number' is not assignable to type 'string'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures4.ts(53,9): error TS2322: Type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type '<T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U':
Types of parameters 'y' and 'y' are incompatible:
Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any':
Types of parameters 'arg2' and 'arg2' are incompatible:
Type 'Base' is not assignable to type '{ foo: number; }':
Types of property 'foo' are incompatible:
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures4.ts(53,9): error TS2323: Type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type '<T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U'.
Types of parameters 'y' and 'y' are incompatible.
Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any'.
Types of parameters 'arg2' and 'arg2' are incompatible.
Type 'Base' is not assignable to type '{ foo: number; }'.
Types of property 'foo' are incompatible.
Type 'string' is not assignable to type 'number'.
@ -68,22 +68,22 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
var b8: <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U;
a8 = b8; // error, { foo: number } and Base are incompatible
~~
!!! error TS2322: Type '<T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived':
!!! error TS2322: Types of parameters 'y' and 'y' are incompatible:
!!! error TS2322: Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived':
!!! error TS2322: Types of parameters 'arg2' and 'arg2' are incompatible:
!!! error TS2322: Type '{ foo: number; }' is not assignable to type 'Base':
!!! error TS2322: Types of property 'foo' are incompatible:
!!! error TS2322: Type 'number' is not assignable to type 'string'.
!!! error TS2323: Type '<T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'.
!!! error TS2323: Types of parameters 'y' and 'y' are incompatible.
!!! error TS2323: Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'.
!!! error TS2323: Types of parameters 'arg2' and 'arg2' are incompatible.
!!! error TS2323: Type '{ foo: number; }' is not assignable to type 'Base'.
!!! error TS2323: Types of property 'foo' are incompatible.
!!! error TS2323: Type 'number' is not assignable to type 'string'.
b8 = a8; // error, { foo: number } and Base are incompatible
~~
!!! error TS2322: Type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type '<T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U':
!!! error TS2322: Types of parameters 'y' and 'y' are incompatible:
!!! error TS2322: Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any':
!!! error TS2322: Types of parameters 'arg2' and 'arg2' are incompatible:
!!! error TS2322: Type 'Base' is not assignable to type '{ foo: number; }':
!!! error TS2322: Types of property 'foo' are incompatible:
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2323: Type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type '<T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U'.
!!! error TS2323: Types of parameters 'y' and 'y' are incompatible.
!!! error TS2323: Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any'.
!!! error TS2323: Types of parameters 'arg2' and 'arg2' are incompatible.
!!! error TS2323: Type 'Base' is not assignable to type '{ foo: number; }'.
!!! error TS2323: Types of property 'foo' are incompatible.
!!! error TS2323: Type 'string' is not assignable to type 'number'.
var b10: <T extends Derived>(...x: T[]) => T;

View File

@ -1,29 +1,29 @@
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(13,5): error TS2322: Type '(...args: string[]) => number' is not assignable to type '(...args: number[]) => number':
Types of parameters 'args' and 'args' are incompatible:
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(13,5): error TS2323: Type '(...args: string[]) => number' is not assignable to type '(...args: number[]) => number'.
Types of parameters 'args' and 'args' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(17,5): error TS2322: Type '(x?: string) => number' is not assignable to type '(...args: number[]) => number':
Types of parameters 'x' and 'args' are incompatible:
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(17,5): error TS2323: Type '(x?: string) => number' is not assignable to type '(...args: number[]) => number'.
Types of parameters 'x' and 'args' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(26,5): error TS2322: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x: number, ...z: number[]) => number':
Types of parameters 'args' and 'z' are incompatible:
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(26,5): error TS2323: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x: number, ...z: number[]) => number'.
Types of parameters 'args' and 'z' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(35,5): error TS2322: Type '(x: number, y?: number, z?: number) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number':
Types of parameters 'y' and 'y' are incompatible:
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(35,5): error TS2323: Type '(x: number, y?: number, z?: number) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'.
Types of parameters 'y' and 'y' are incompatible.
Type 'number' is not assignable to type 'string'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(36,5): error TS2322: Type '(x: number, ...z: number[]) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number':
Types of parameters 'z' and 'y' are incompatible:
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(36,5): error TS2323: Type '(x: number, ...z: number[]) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'.
Types of parameters 'z' and 'y' are incompatible.
Type 'number' is not assignable to type 'string'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(37,5): error TS2322: Type '(x: string, y?: string, z?: string) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number':
Types of parameters 'x' and 'x' are incompatible:
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(37,5): error TS2323: Type '(x: string, y?: string, z?: string) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'.
Types of parameters 'x' and 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(41,5): error TS2322: Type '(x?: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number':
Types of parameters 'y' and 'y' are incompatible:
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(41,5): error TS2323: Type '(x?: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'.
Types of parameters 'y' and 'y' are incompatible.
Type 'number' is not assignable to type 'string'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(43,5): error TS2322: Type '(x: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number':
Types of parameters 'y' and 'y' are incompatible:
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(43,5): error TS2323: Type '(x: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'.
Types of parameters 'y' and 'y' are incompatible.
Type 'number' is not assignable to type 'string'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(45,5): error TS2322: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number':
Types of parameters 'args' and 'z' are incompatible:
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(45,5): error TS2323: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'.
Types of parameters 'args' and 'z' are incompatible.
Type 'string' is not assignable to type 'number'.
@ -42,17 +42,17 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
a = (...args: number[]) => 1; // ok, same number of required params
a = (...args: string[]) => 1; // error, type mismatch
~
!!! error TS2322: Type '(...args: string[]) => number' is not assignable to type '(...args: number[]) => number':
!!! error TS2322: Types of parameters 'args' and 'args' are incompatible:
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2323: Type '(...args: string[]) => number' is not assignable to type '(...args: number[]) => number'.
!!! error TS2323: Types of parameters 'args' and 'args' are incompatible.
!!! error TS2323: Type 'string' is not assignable to type 'number'.
a = (x?: number) => 1; // ok, same number of required params
a = (x?: number, y?: number, z?: number) => 1; // ok, same number of required params
a = (x: number) => 1; // ok, rest param corresponds to infinite number of params
a = (x?: string) => 1; // error, incompatible type
~
!!! error TS2322: Type '(x?: string) => number' is not assignable to type '(...args: number[]) => number':
!!! error TS2322: Types of parameters 'x' and 'args' are incompatible:
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2323: Type '(x?: string) => number' is not assignable to type '(...args: number[]) => number'.
!!! error TS2323: Types of parameters 'x' and 'args' are incompatible.
!!! error TS2323: Type 'string' is not assignable to type 'number'.
var a2: (x: number, ...z: number[]) => number;
@ -63,9 +63,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
a2 = (x: number, ...args: number[]) => 1; // ok, same number of required params
a2 = (x: number, ...args: string[]) => 1; // should be type mismatch error
~~
!!! error TS2322: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x: number, ...z: number[]) => number':
!!! error TS2322: Types of parameters 'args' and 'z' are incompatible:
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2323: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x: number, ...z: number[]) => number'.
!!! error TS2323: Types of parameters 'args' and 'z' are incompatible.
!!! error TS2323: Type 'string' is not assignable to type 'number'.
a2 = (x: number, y: number) => 1; // ok, rest param corresponds to infinite number of params
a2 = (x: number, y?: number) => 1; // ok, same number of required params
@ -76,36 +76,36 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
a3 = (x: number, y: string) => 1; // ok, all present params match
a3 = (x: number, y?: number, z?: number) => 1; // error
~~
!!! error TS2322: Type '(x: number, y?: number, z?: number) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number':
!!! error TS2322: Types of parameters 'y' and 'y' are incompatible:
!!! error TS2322: Type 'number' is not assignable to type 'string'.
!!! error TS2323: Type '(x: number, y?: number, z?: number) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'.
!!! error TS2323: Types of parameters 'y' and 'y' are incompatible.
!!! error TS2323: Type 'number' is not assignable to type 'string'.
a3 = (x: number, ...z: number[]) => 1; // error
~~
!!! error TS2322: Type '(x: number, ...z: number[]) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number':
!!! error TS2322: Types of parameters 'z' and 'y' are incompatible:
!!! error TS2322: Type 'number' is not assignable to type 'string'.
!!! error TS2323: Type '(x: number, ...z: number[]) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'.
!!! error TS2323: Types of parameters 'z' and 'y' are incompatible.
!!! error TS2323: Type 'number' is not assignable to type 'string'.
a3 = (x: string, y?: string, z?: string) => 1; // error
~~
!!! error TS2322: Type '(x: string, y?: string, z?: string) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number':
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible:
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2323: Type '(x: string, y?: string, z?: string) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'.
!!! error TS2323: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2323: Type 'string' is not assignable to type 'number'.
var a4: (x?: number, y?: string, ...z: number[]) => number;
a4 = () => 1; // ok, fewer required params
a4 = (x?: number, y?: number) => 1; // error, type mismatch
~~
!!! error TS2322: Type '(x?: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number':
!!! error TS2322: Types of parameters 'y' and 'y' are incompatible:
!!! error TS2322: Type 'number' is not assignable to type 'string'.
!!! error TS2323: Type '(x?: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'.
!!! error TS2323: Types of parameters 'y' and 'y' are incompatible.
!!! error TS2323: Type 'number' is not assignable to type 'string'.
a4 = (x: number) => 1; // ok, all present params match
a4 = (x: number, y?: number) => 1; // error, second param has type mismatch
~~
!!! error TS2322: Type '(x: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number':
!!! error TS2322: Types of parameters 'y' and 'y' are incompatible:
!!! error TS2322: Type 'number' is not assignable to type 'string'.
!!! error TS2323: Type '(x: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'.
!!! error TS2323: Types of parameters 'y' and 'y' are incompatible.
!!! error TS2323: Type 'number' is not assignable to type 'string'.
a4 = (x?: number, y?: string) => 1; // ok, same number of required params with matching types
a4 = (x: number, ...args: string[]) => 1; // error, rest params have type mismatch
~~
!!! error TS2322: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number':
!!! error TS2322: Types of parameters 'args' and 'z' are incompatible:
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2323: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'.
!!! error TS2323: Types of parameters 'args' and 'z' are incompatible.
!!! error TS2323: Type 'string' is not assignable to type 'number'.

View File

@ -1,30 +1,30 @@
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(23,1): error TS2322: Type '() => number' is not assignable to type 'T':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(23,1): error TS2323: Type '() => number' is not assignable to type 'T'.
Property 'f' is missing in type '() => number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(24,1): error TS2322: Type '(x: number) => string' is not assignable to type 'T':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(24,1): error TS2323: Type '(x: number) => string' is not assignable to type 'T'.
Property 'f' is missing in type '(x: number) => string'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(25,1): error TS2322: Type '() => number' is not assignable to type '{ f: new (x: number) => void; }':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(25,1): error TS2323: Type '() => number' is not assignable to type '{ f: new (x: number) => void; }'.
Property 'f' is missing in type '() => number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(26,1): error TS2322: Type '(x: number) => string' is not assignable to type '{ f: new (x: number) => void; }':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(26,1): error TS2323: Type '(x: number) => string' is not assignable to type '{ f: new (x: number) => void; }'.
Property 'f' is missing in type '(x: number) => string'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(34,1): error TS2322: Type 'S2' is not assignable to type 'T':
Types of property 'f' are incompatible:
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(34,1): error TS2323: Type 'S2' is not assignable to type 'T'.
Types of property 'f' are incompatible.
Type '(x: string) => void' is not assignable to type 'new (x: number) => void'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(35,1): error TS2322: Type '{ f(x: string): void; }' is not assignable to type 'T':
Types of property 'f' are incompatible:
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(35,1): error TS2323: Type '{ f(x: string): void; }' is not assignable to type 'T'.
Types of property 'f' are incompatible.
Type '(x: string) => void' is not assignable to type 'new (x: number) => void'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(36,1): error TS2322: Type '(x: string) => number' is not assignable to type 'T':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(36,1): error TS2323: Type '(x: string) => number' is not assignable to type 'T'.
Property 'f' is missing in type '(x: string) => number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(37,1): error TS2322: Type '(x: string) => string' is not assignable to type 'T':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(37,1): error TS2323: Type '(x: string) => string' is not assignable to type 'T'.
Property 'f' is missing in type '(x: string) => string'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(38,1): error TS2322: Type 'S2' is not assignable to type '{ f: new (x: number) => void; }':
Types of property 'f' are incompatible:
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(38,1): error TS2323: Type 'S2' is not assignable to type '{ f: new (x: number) => void; }'.
Types of property 'f' are incompatible.
Type '(x: string) => void' is not assignable to type 'new (x: number) => void'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(39,1): error TS2322: Type '{ f(x: string): void; }' is not assignable to type '{ f: new (x: number) => void; }':
Types of property 'f' are incompatible:
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(39,1): error TS2323: Type '{ f(x: string): void; }' is not assignable to type '{ f: new (x: number) => void; }'.
Types of property 'f' are incompatible.
Type '(x: string) => void' is not assignable to type 'new (x: number) => void'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(40,1): error TS2322: Type '(x: string) => number' is not assignable to type '{ f: new (x: number) => void; }':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(40,1): error TS2323: Type '(x: string) => number' is not assignable to type '{ f: new (x: number) => void; }'.
Property 'f' is missing in type '(x: string) => number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(41,1): error TS2322: Type '(x: string) => string' is not assignable to type '{ f: new (x: number) => void; }':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(41,1): error TS2323: Type '(x: string) => string' is not assignable to type '{ f: new (x: number) => void; }'.
Property 'f' is missing in type '(x: string) => string'.
@ -53,20 +53,20 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
// errors
t = () => 1;
~
!!! error TS2322: Type '() => number' is not assignable to type 'T':
!!! error TS2322: Property 'f' is missing in type '() => number'.
!!! error TS2323: Type '() => number' is not assignable to type 'T'.
!!! error TS2323: Property 'f' is missing in type '() => number'.
t = function (x: number) { return ''; }
~
!!! error TS2322: Type '(x: number) => string' is not assignable to type 'T':
!!! error TS2322: Property 'f' is missing in type '(x: number) => string'.
!!! error TS2323: Type '(x: number) => string' is not assignable to type 'T'.
!!! error TS2323: Property 'f' is missing in type '(x: number) => string'.
a = () => 1;
~
!!! error TS2322: Type '() => number' is not assignable to type '{ f: new (x: number) => void; }':
!!! error TS2322: Property 'f' is missing in type '() => number'.
!!! error TS2323: Type '() => number' is not assignable to type '{ f: new (x: number) => void; }'.
!!! error TS2323: Property 'f' is missing in type '() => number'.
a = function (x: number) { return ''; }
~
!!! error TS2322: Type '(x: number) => string' is not assignable to type '{ f: new (x: number) => void; }':
!!! error TS2322: Property 'f' is missing in type '(x: number) => string'.
!!! error TS2323: Type '(x: number) => string' is not assignable to type '{ f: new (x: number) => void; }'.
!!! error TS2323: Property 'f' is missing in type '(x: number) => string'.
interface S2 {
f(x: string): void;
@ -76,38 +76,38 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
// these are errors
t = s2;
~
!!! error TS2322: Type 'S2' is not assignable to type 'T':
!!! error TS2322: Types of property 'f' are incompatible:
!!! error TS2322: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'.
!!! error TS2323: Type 'S2' is not assignable to type 'T'.
!!! error TS2323: Types of property 'f' are incompatible.
!!! error TS2323: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'.
t = a3;
~
!!! error TS2322: Type '{ f(x: string): void; }' is not assignable to type 'T':
!!! error TS2322: Types of property 'f' are incompatible:
!!! error TS2322: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'.
!!! error TS2323: Type '{ f(x: string): void; }' is not assignable to type 'T'.
!!! error TS2323: Types of property 'f' are incompatible.
!!! error TS2323: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'.
t = (x: string) => 1;
~
!!! error TS2322: Type '(x: string) => number' is not assignable to type 'T':
!!! error TS2322: Property 'f' is missing in type '(x: string) => number'.
!!! error TS2323: Type '(x: string) => number' is not assignable to type 'T'.
!!! error TS2323: Property 'f' is missing in type '(x: string) => number'.
t = function (x: string) { return ''; }
~
!!! error TS2322: Type '(x: string) => string' is not assignable to type 'T':
!!! error TS2322: Property 'f' is missing in type '(x: string) => string'.
!!! error TS2323: Type '(x: string) => string' is not assignable to type 'T'.
!!! error TS2323: Property 'f' is missing in type '(x: string) => string'.
a = s2;
~
!!! error TS2322: Type 'S2' is not assignable to type '{ f: new (x: number) => void; }':
!!! error TS2322: Types of property 'f' are incompatible:
!!! error TS2322: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'.
!!! error TS2323: Type 'S2' is not assignable to type '{ f: new (x: number) => void; }'.
!!! error TS2323: Types of property 'f' are incompatible.
!!! error TS2323: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'.
a = a3;
~
!!! error TS2322: Type '{ f(x: string): void; }' is not assignable to type '{ f: new (x: number) => void; }':
!!! error TS2322: Types of property 'f' are incompatible:
!!! error TS2322: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'.
!!! error TS2323: Type '{ f(x: string): void; }' is not assignable to type '{ f: new (x: number) => void; }'.
!!! error TS2323: Types of property 'f' are incompatible.
!!! error TS2323: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'.
a = (x: string) => 1;
~
!!! error TS2322: Type '(x: string) => number' is not assignable to type '{ f: new (x: number) => void; }':
!!! error TS2322: Property 'f' is missing in type '(x: string) => number'.
!!! error TS2323: Type '(x: string) => number' is not assignable to type '{ f: new (x: number) => void; }'.
!!! error TS2323: Property 'f' is missing in type '(x: string) => number'.
a = function (x: string) { return ''; }
~
!!! error TS2322: Type '(x: string) => string' is not assignable to type '{ f: new (x: number) => void; }':
!!! error TS2322: Property 'f' is missing in type '(x: string) => string'.
!!! error TS2323: Type '(x: string) => string' is not assignable to type '{ f: new (x: number) => void; }'.
!!! error TS2323: Property 'f' is missing in type '(x: string) => string'.

View File

@ -1,28 +1,28 @@
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(52,9): error TS2322: Type 'new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived':
Types of parameters 'y' and 'y' are incompatible:
Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived':
Types of parameters 'arg2' and 'arg2' are incompatible:
Type '{ foo: number; }' is not assignable to type 'Base':
Types of property 'foo' are incompatible:
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(52,9): error TS2323: Type 'new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'.
Types of parameters 'y' and 'y' are incompatible.
Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'.
Types of parameters 'arg2' and 'arg2' are incompatible.
Type '{ foo: number; }' is not assignable to type 'Base'.
Types of property 'foo' are incompatible.
Type 'number' is not assignable to type 'string'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(53,9): error TS2322: Type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type 'new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U':
Types of parameters 'y' and 'y' are incompatible:
Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any':
Types of parameters 'arg2' and 'arg2' are incompatible:
Type 'Base' is not assignable to type '{ foo: number; }':
Types of property 'foo' are incompatible:
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(53,9): error TS2323: Type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type 'new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U'.
Types of parameters 'y' and 'y' are incompatible.
Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any'.
Types of parameters 'arg2' and 'arg2' are incompatible.
Type 'Base' is not assignable to type '{ foo: number; }'.
Types of property 'foo' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(77,9): error TS2322: Type 'new <T>(x: (a: T) => T) => T[]' is not assignable to type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }':
Types of parameters 'x' and 'x' are incompatible:
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(77,9): error TS2323: Type 'new <T>(x: (a: T) => T) => T[]' is not assignable to type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }'.
Types of parameters 'x' and 'x' are incompatible.
Type '(a: any) => any' is not assignable to type '{ new (a: number): number; new (a?: number): number; }'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(78,9): error TS2322: Type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }' is not assignable to type 'new <T>(x: (a: T) => T) => T[]':
Types of parameters 'x' and 'x' are incompatible:
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(78,9): error TS2323: Type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }' is not assignable to type 'new <T>(x: (a: T) => T) => T[]'.
Types of parameters 'x' and 'x' are incompatible.
Type '{ new (a: number): number; new (a?: number): number; }' is not assignable to type '(a: any) => any'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(81,9): error TS2322: Type 'new <T>(x: (a: T) => T) => any[]' is not assignable to type '{ new (x: { new <T extends Derived>(a: T): T; new <T extends Base>(a: T): T; }): any[]; new (x: { new <T extends Derived2>(a: T): T; new <T extends Base>(a: T): T; }): any[]; }':
Types of parameters 'x' and 'x' are incompatible:
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(81,9): error TS2323: Type 'new <T>(x: (a: T) => T) => any[]' is not assignable to type '{ new (x: { new <T extends Derived>(a: T): T; new <T extends Base>(a: T): T; }): any[]; new (x: { new <T extends Derived2>(a: T): T; new <T extends Base>(a: T): T; }): any[]; }'.
Types of parameters 'x' and 'x' are incompatible.
Type '(a: any) => any' is not assignable to type '{ new <T extends Derived>(a: T): T; new <T extends Base>(a: T): T; }'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(82,9): error TS2322: Type '{ new (x: { new <T extends Derived>(a: T): T; new <T extends Base>(a: T): T; }): any[]; new (x: { new <T extends Derived2>(a: T): T; new <T extends Base>(a: T): T; }): any[]; }' is not assignable to type 'new <T>(x: (a: T) => T) => any[]':
Types of parameters 'x' and 'x' are incompatible:
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(82,9): error TS2323: Type '{ new (x: { new <T extends Derived>(a: T): T; new <T extends Base>(a: T): T; }): any[]; new (x: { new <T extends Derived2>(a: T): T; new <T extends Base>(a: T): T; }): any[]; }' is not assignable to type 'new <T>(x: (a: T) => T) => any[]'.
Types of parameters 'x' and 'x' are incompatible.
Type '{ new <T extends Derived>(a: T): T; new <T extends Base>(a: T): T; }' is not assignable to type '(a: any) => any'.
@ -80,22 +80,22 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
var b8: new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U;
a8 = b8; // error, type mismatch
~~
!!! error TS2322: Type 'new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived':
!!! error TS2322: Types of parameters 'y' and 'y' are incompatible:
!!! error TS2322: Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived':
!!! error TS2322: Types of parameters 'arg2' and 'arg2' are incompatible:
!!! error TS2322: Type '{ foo: number; }' is not assignable to type 'Base':
!!! error TS2322: Types of property 'foo' are incompatible:
!!! error TS2322: Type 'number' is not assignable to type 'string'.
!!! error TS2323: Type 'new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'.
!!! error TS2323: Types of parameters 'y' and 'y' are incompatible.
!!! error TS2323: Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'.
!!! error TS2323: Types of parameters 'arg2' and 'arg2' are incompatible.
!!! error TS2323: Type '{ foo: number; }' is not assignable to type 'Base'.
!!! error TS2323: Types of property 'foo' are incompatible.
!!! error TS2323: Type 'number' is not assignable to type 'string'.
b8 = a8; // error
~~
!!! error TS2322: Type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type 'new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U':
!!! error TS2322: Types of parameters 'y' and 'y' are incompatible:
!!! error TS2322: Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any':
!!! error TS2322: Types of parameters 'arg2' and 'arg2' are incompatible:
!!! error TS2322: Type 'Base' is not assignable to type '{ foo: number; }':
!!! error TS2322: Types of property 'foo' are incompatible:
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2323: Type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type 'new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U'.
!!! error TS2323: Types of parameters 'y' and 'y' are incompatible.
!!! error TS2323: Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any'.
!!! error TS2323: Types of parameters 'arg2' and 'arg2' are incompatible.
!!! error TS2323: Type 'Base' is not assignable to type '{ foo: number; }'.
!!! error TS2323: Types of property 'foo' are incompatible.
!!! error TS2323: Type 'string' is not assignable to type 'number'.
var b10: new <T extends Derived>(...x: T[]) => T;
@ -121,26 +121,26 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
var b16: new <T>(x: (a: T) => T) => T[];
a16 = b16; // error
~~~
!!! error TS2322: Type 'new <T>(x: (a: T) => T) => T[]' is not assignable to type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }':
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible:
!!! error TS2322: Type '(a: any) => any' is not assignable to type '{ new (a: number): number; new (a?: number): number; }'.
!!! error TS2323: Type 'new <T>(x: (a: T) => T) => T[]' is not assignable to type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }'.
!!! error TS2323: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2323: Type '(a: any) => any' is not assignable to type '{ new (a: number): number; new (a?: number): number; }'.
b16 = a16; // error
~~~
!!! error TS2322: Type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }' is not assignable to type 'new <T>(x: (a: T) => T) => T[]':
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible:
!!! error TS2322: Type '{ new (a: number): number; new (a?: number): number; }' is not assignable to type '(a: any) => any'.
!!! error TS2323: Type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }' is not assignable to type 'new <T>(x: (a: T) => T) => T[]'.
!!! error TS2323: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2323: Type '{ new (a: number): number; new (a?: number): number; }' is not assignable to type '(a: any) => any'.
var b17: new <T>(x: (a: T) => T) => any[];
a17 = b17; // error
~~~
!!! error TS2322: Type 'new <T>(x: (a: T) => T) => any[]' is not assignable to type '{ new (x: { new <T extends Derived>(a: T): T; new <T extends Base>(a: T): T; }): any[]; new (x: { new <T extends Derived2>(a: T): T; new <T extends Base>(a: T): T; }): any[]; }':
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible:
!!! error TS2322: Type '(a: any) => any' is not assignable to type '{ new <T extends Derived>(a: T): T; new <T extends Base>(a: T): T; }'.
!!! error TS2323: Type 'new <T>(x: (a: T) => T) => any[]' is not assignable to type '{ new (x: { new <T extends Derived>(a: T): T; new <T extends Base>(a: T): T; }): any[]; new (x: { new <T extends Derived2>(a: T): T; new <T extends Base>(a: T): T; }): any[]; }'.
!!! error TS2323: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2323: Type '(a: any) => any' is not assignable to type '{ new <T extends Derived>(a: T): T; new <T extends Base>(a: T): T; }'.
b17 = a17; // error
~~~
!!! error TS2322: Type '{ new (x: { new <T extends Derived>(a: T): T; new <T extends Base>(a: T): T; }): any[]; new (x: { new <T extends Derived2>(a: T): T; new <T extends Base>(a: T): T; }): any[]; }' is not assignable to type 'new <T>(x: (a: T) => T) => any[]':
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible:
!!! error TS2322: Type '{ new <T extends Derived>(a: T): T; new <T extends Base>(a: T): T; }' is not assignable to type '(a: any) => any'.
!!! error TS2323: Type '{ new (x: { new <T extends Derived>(a: T): T; new <T extends Base>(a: T): T; }): any[]; new (x: { new <T extends Derived2>(a: T): T; new <T extends Base>(a: T): T; }): any[]; }' is not assignable to type 'new <T>(x: (a: T) => T) => any[]'.
!!! error TS2323: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2323: Type '{ new <T extends Derived>(a: T): T; new <T extends Base>(a: T): T; }' is not assignable to type '(a: any) => any'.
}
module WithGenericSignaturesInBaseType {

View File

@ -1,24 +1,24 @@
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(14,1): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived; }':
Index signatures are incompatible:
Type 'Base' is not assignable to type 'Derived':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(14,1): error TS2323: Type 'A' is not assignable to type '{ [x: number]: Derived; }'.
Index signatures are incompatible.
Type 'Base' is not assignable to type 'Derived'.
Property 'bar' is missing in type 'Base'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(18,1): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }':
Index signatures are incompatible:
Type 'Base' is not assignable to type 'Derived2':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(18,1): error TS2323: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'.
Index signatures are incompatible.
Type 'Base' is not assignable to type 'Derived2'.
Property 'baz' is missing in type 'Base'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(32,9): error TS2322: Type '{ [x: number]: Derived; }' is not assignable to type 'A<T>':
Index signatures are incompatible:
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(32,9): error TS2323: Type '{ [x: number]: Derived; }' is not assignable to type 'A<T>'.
Index signatures are incompatible.
Type 'Derived' is not assignable to type 'T'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(33,9): error TS2322: Type 'A<T>' is not assignable to type '{ [x: number]: Derived; }':
Index signatures are incompatible:
Type 'T' is not assignable to type 'Derived':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(33,9): error TS2323: Type 'A<T>' is not assignable to type '{ [x: number]: Derived; }'.
Index signatures are incompatible.
Type 'T' is not assignable to type 'Derived'.
Property 'bar' is missing in type 'Base'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(36,9): error TS2322: Type '{ [x: number]: Derived2; }' is not assignable to type 'A<T>':
Index signatures are incompatible:
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(36,9): error TS2323: Type '{ [x: number]: Derived2; }' is not assignable to type 'A<T>'.
Index signatures are incompatible.
Type 'Derived2' is not assignable to type 'T'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(37,9): error TS2322: Type 'A<T>' is not assignable to type '{ [x: number]: Derived2; }':
Index signatures are incompatible:
Type 'T' is not assignable to type 'Derived2':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(37,9): error TS2323: Type 'A<T>' is not assignable to type '{ [x: number]: Derived2; }'.
Index signatures are incompatible.
Type 'T' is not assignable to type 'Derived2'.
Property 'baz' is missing in type 'Base'.
@ -38,19 +38,19 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
a = b;
b = a; // error
~
!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived; }':
!!! error TS2322: Index signatures are incompatible:
!!! error TS2322: Type 'Base' is not assignable to type 'Derived':
!!! error TS2322: Property 'bar' is missing in type 'Base'.
!!! error TS2323: Type 'A' is not assignable to type '{ [x: number]: Derived; }'.
!!! error TS2323: Index signatures are incompatible.
!!! error TS2323: Type 'Base' is not assignable to type 'Derived'.
!!! error TS2323: Property 'bar' is missing in type 'Base'.
var b2: { [x: number]: Derived2; }
a = b2;
b2 = a; // error
~~
!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }':
!!! error TS2322: Index signatures are incompatible:
!!! error TS2322: Type 'Base' is not assignable to type 'Derived2':
!!! error TS2322: Property 'baz' is missing in type 'Base'.
!!! error TS2323: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'.
!!! error TS2323: Index signatures are incompatible.
!!! error TS2323: Type 'Base' is not assignable to type 'Derived2'.
!!! error TS2323: Property 'baz' is missing in type 'Base'.
module Generics {
class A<T extends Base> {
@ -66,28 +66,28 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
var b: { [x: number]: Derived; }
a = b; // error
~
!!! error TS2322: Type '{ [x: number]: Derived; }' is not assignable to type 'A<T>':
!!! error TS2322: Index signatures are incompatible:
!!! error TS2322: Type 'Derived' is not assignable to type 'T'.
!!! error TS2323: Type '{ [x: number]: Derived; }' is not assignable to type 'A<T>'.
!!! error TS2323: Index signatures are incompatible.
!!! error TS2323: Type 'Derived' is not assignable to type 'T'.
b = a; // error
~
!!! error TS2322: Type 'A<T>' is not assignable to type '{ [x: number]: Derived; }':
!!! error TS2322: Index signatures are incompatible:
!!! error TS2322: Type 'T' is not assignable to type 'Derived':
!!! error TS2322: Property 'bar' is missing in type 'Base'.
!!! error TS2323: Type 'A<T>' is not assignable to type '{ [x: number]: Derived; }'.
!!! error TS2323: Index signatures are incompatible.
!!! error TS2323: Type 'T' is not assignable to type 'Derived'.
!!! error TS2323: Property 'bar' is missing in type 'Base'.
var b2: { [x: number]: Derived2; }
a = b2; // error
~
!!! error TS2322: Type '{ [x: number]: Derived2; }' is not assignable to type 'A<T>':
!!! error TS2322: Index signatures are incompatible:
!!! error TS2322: Type 'Derived2' is not assignable to type 'T'.
!!! error TS2323: Type '{ [x: number]: Derived2; }' is not assignable to type 'A<T>'.
!!! error TS2323: Index signatures are incompatible.
!!! error TS2323: Type 'Derived2' is not assignable to type 'T'.
b2 = a; // error
~~
!!! error TS2322: Type 'A<T>' is not assignable to type '{ [x: number]: Derived2; }':
!!! error TS2322: Index signatures are incompatible:
!!! error TS2322: Type 'T' is not assignable to type 'Derived2':
!!! error TS2322: Property 'baz' is missing in type 'Base'.
!!! error TS2323: Type 'A<T>' is not assignable to type '{ [x: number]: Derived2; }'.
!!! error TS2323: Index signatures are incompatible.
!!! error TS2323: Type 'T' is not assignable to type 'Derived2'.
!!! error TS2323: Property 'baz' is missing in type 'Base'.
var b3: { [x: number]: T; }
a = b3; // ok

View File

@ -1,24 +1,24 @@
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(14,1): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived; }':
Index signatures are incompatible:
Type 'Base' is not assignable to type 'Derived':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(14,1): error TS2323: Type 'A' is not assignable to type '{ [x: number]: Derived; }'.
Index signatures are incompatible.
Type 'Base' is not assignable to type 'Derived'.
Property 'bar' is missing in type 'Base'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(18,1): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }':
Index signatures are incompatible:
Type 'Base' is not assignable to type 'Derived2':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(18,1): error TS2323: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'.
Index signatures are incompatible.
Type 'Base' is not assignable to type 'Derived2'.
Property 'baz' is missing in type 'Base'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(32,9): error TS2322: Type '{ [x: number]: Derived; }' is not assignable to type 'A<T>':
Index signatures are incompatible:
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(32,9): error TS2323: Type '{ [x: number]: Derived; }' is not assignable to type 'A<T>'.
Index signatures are incompatible.
Type 'Derived' is not assignable to type 'T'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(33,9): error TS2322: Type 'A<T>' is not assignable to type '{ [x: number]: Derived; }':
Index signatures are incompatible:
Type 'T' is not assignable to type 'Derived':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(33,9): error TS2323: Type 'A<T>' is not assignable to type '{ [x: number]: Derived; }'.
Index signatures are incompatible.
Type 'T' is not assignable to type 'Derived'.
Property 'bar' is missing in type 'Base'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(36,9): error TS2322: Type '{ [x: number]: Derived2; }' is not assignable to type 'A<T>':
Index signatures are incompatible:
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(36,9): error TS2323: Type '{ [x: number]: Derived2; }' is not assignable to type 'A<T>'.
Index signatures are incompatible.
Type 'Derived2' is not assignable to type 'T'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(37,9): error TS2322: Type 'A<T>' is not assignable to type '{ [x: number]: Derived2; }':
Index signatures are incompatible:
Type 'T' is not assignable to type 'Derived2':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(37,9): error TS2323: Type 'A<T>' is not assignable to type '{ [x: number]: Derived2; }'.
Index signatures are incompatible.
Type 'T' is not assignable to type 'Derived2'.
Property 'baz' is missing in type 'Base'.
@ -38,19 +38,19 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
a = b;
b = a; // error
~
!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived; }':
!!! error TS2322: Index signatures are incompatible:
!!! error TS2322: Type 'Base' is not assignable to type 'Derived':
!!! error TS2322: Property 'bar' is missing in type 'Base'.
!!! error TS2323: Type 'A' is not assignable to type '{ [x: number]: Derived; }'.
!!! error TS2323: Index signatures are incompatible.
!!! error TS2323: Type 'Base' is not assignable to type 'Derived'.
!!! error TS2323: Property 'bar' is missing in type 'Base'.
var b2: { [x: number]: Derived2; }
a = b2;
b2 = a; // error
~~
!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }':
!!! error TS2322: Index signatures are incompatible:
!!! error TS2322: Type 'Base' is not assignable to type 'Derived2':
!!! error TS2322: Property 'baz' is missing in type 'Base'.
!!! error TS2323: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'.
!!! error TS2323: Index signatures are incompatible.
!!! error TS2323: Type 'Base' is not assignable to type 'Derived2'.
!!! error TS2323: Property 'baz' is missing in type 'Base'.
module Generics {
interface A<T extends Base> {
@ -66,28 +66,28 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
var b: { [x: number]: Derived; }
a = b; // error
~
!!! error TS2322: Type '{ [x: number]: Derived; }' is not assignable to type 'A<T>':
!!! error TS2322: Index signatures are incompatible:
!!! error TS2322: Type 'Derived' is not assignable to type 'T'.
!!! error TS2323: Type '{ [x: number]: Derived; }' is not assignable to type 'A<T>'.
!!! error TS2323: Index signatures are incompatible.
!!! error TS2323: Type 'Derived' is not assignable to type 'T'.
b = a; // error
~
!!! error TS2322: Type 'A<T>' is not assignable to type '{ [x: number]: Derived; }':
!!! error TS2322: Index signatures are incompatible:
!!! error TS2322: Type 'T' is not assignable to type 'Derived':
!!! error TS2322: Property 'bar' is missing in type 'Base'.
!!! error TS2323: Type 'A<T>' is not assignable to type '{ [x: number]: Derived; }'.
!!! error TS2323: Index signatures are incompatible.
!!! error TS2323: Type 'T' is not assignable to type 'Derived'.
!!! error TS2323: Property 'bar' is missing in type 'Base'.
var b2: { [x: number]: Derived2; }
a = b2; // error
~
!!! error TS2322: Type '{ [x: number]: Derived2; }' is not assignable to type 'A<T>':
!!! error TS2322: Index signatures are incompatible:
!!! error TS2322: Type 'Derived2' is not assignable to type 'T'.
!!! error TS2323: Type '{ [x: number]: Derived2; }' is not assignable to type 'A<T>'.
!!! error TS2323: Index signatures are incompatible.
!!! error TS2323: Type 'Derived2' is not assignable to type 'T'.
b2 = a; // error
~~
!!! error TS2322: Type 'A<T>' is not assignable to type '{ [x: number]: Derived2; }':
!!! error TS2322: Index signatures are incompatible:
!!! error TS2322: Type 'T' is not assignable to type 'Derived2':
!!! error TS2322: Property 'baz' is missing in type 'Base'.
!!! error TS2323: Type 'A<T>' is not assignable to type '{ [x: number]: Derived2; }'.
!!! error TS2323: Index signatures are incompatible.
!!! error TS2323: Type 'T' is not assignable to type 'Derived2'.
!!! error TS2323: Property 'baz' is missing in type 'Base'.
var b3: { [x: number]: T; }
a = b3; // ok

View File

@ -1,13 +1,13 @@
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer3.ts(14,1): error TS2322: Type '{ [x: number]: Base; }' is not assignable to type 'A':
Index signatures are incompatible:
Type 'Base' is not assignable to type 'Derived':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer3.ts(14,1): error TS2323: Type '{ [x: number]: Base; }' is not assignable to type 'A'.
Index signatures are incompatible.
Type 'Base' is not assignable to type 'Derived'.
Property 'bar' is missing in type 'Base'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer3.ts(23,1): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }':
Index signatures are incompatible:
Type 'Derived' is not assignable to type 'Derived2':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer3.ts(23,1): error TS2323: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'.
Index signatures are incompatible.
Type 'Derived' is not assignable to type 'Derived2'.
Property 'baz' is missing in type 'Derived'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer3.ts(33,9): error TS2322: Type '{ [x: number]: Derived; }' is not assignable to type 'A<T>':
Index signatures are incompatible:
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer3.ts(33,9): error TS2323: Type '{ [x: number]: Derived; }' is not assignable to type 'A<T>'.
Index signatures are incompatible.
Type 'Derived' is not assignable to type 'T'.
@ -27,10 +27,10 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
a = b; // error
~
!!! error TS2322: Type '{ [x: number]: Base; }' is not assignable to type 'A':
!!! error TS2322: Index signatures are incompatible:
!!! error TS2322: Type 'Base' is not assignable to type 'Derived':
!!! error TS2322: Property 'bar' is missing in type 'Base'.
!!! error TS2323: Type '{ [x: number]: Base; }' is not assignable to type 'A'.
!!! error TS2323: Index signatures are incompatible.
!!! error TS2323: Type 'Base' is not assignable to type 'Derived'.
!!! error TS2323: Property 'bar' is missing in type 'Base'.
b = a; // ok
class B2 extends A {
@ -41,10 +41,10 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
a = b2; // ok
b2 = a; // error
~~
!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }':
!!! error TS2322: Index signatures are incompatible:
!!! error TS2322: Type 'Derived' is not assignable to type 'Derived2':
!!! error TS2322: Property 'baz' is missing in type 'Derived'.
!!! error TS2323: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'.
!!! error TS2323: Index signatures are incompatible.
!!! error TS2323: Type 'Derived' is not assignable to type 'Derived2'.
!!! error TS2323: Property 'baz' is missing in type 'Derived'.
module Generics {
class A<T extends Derived> {
@ -56,9 +56,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
var b: { [x: number]: Derived; };
a = b; // error
~
!!! error TS2322: Type '{ [x: number]: Derived; }' is not assignable to type 'A<T>':
!!! error TS2322: Index signatures are incompatible:
!!! error TS2322: Type 'Derived' is not assignable to type 'T'.
!!! error TS2323: Type '{ [x: number]: Derived; }' is not assignable to type 'A<T>'.
!!! error TS2323: Index signatures are incompatible.
!!! error TS2323: Type 'Derived' is not assignable to type 'T'.
b = a; // ok
var b2: { [x: number]: T; };

View File

@ -1,70 +1,70 @@
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(24,5): error TS2322: Type 'T' is not assignable to type 'S':
Types of property 'foo' are incompatible:
Type 'Derived2' is not assignable to type 'Derived':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(24,5): error TS2323: Type 'T' is not assignable to type 'S'.
Types of property 'foo' are incompatible.
Type 'Derived2' is not assignable to type 'Derived'.
Property 'bar' is missing in type 'Derived2'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(25,5): error TS2322: Type 'S' is not assignable to type 'T':
Types of property 'foo' are incompatible:
Type 'Derived' is not assignable to type 'Derived2':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(25,5): error TS2323: Type 'S' is not assignable to type 'T'.
Types of property 'foo' are incompatible.
Type 'Derived' is not assignable to type 'Derived2'.
Property 'baz' is missing in type 'Derived'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(29,5): error TS2322: Type 'T2' is not assignable to type 'S2':
Types of property 'foo' are incompatible:
Type 'Derived2' is not assignable to type 'Derived':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(29,5): error TS2323: Type 'T2' is not assignable to type 'S2'.
Types of property 'foo' are incompatible.
Type 'Derived2' is not assignable to type 'Derived'.
Property 'bar' is missing in type 'Derived2'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(30,5): error TS2322: Type 'S2' is not assignable to type 'T2':
Types of property 'foo' are incompatible:
Type 'Derived' is not assignable to type 'Derived2':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(30,5): error TS2323: Type 'S2' is not assignable to type 'T2'.
Types of property 'foo' are incompatible.
Type 'Derived' is not assignable to type 'Derived2'.
Property 'baz' is missing in type 'Derived'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(31,5): error TS2322: Type 'T' is not assignable to type 'S2':
Types of property 'foo' are incompatible:
Type 'Derived2' is not assignable to type 'Derived':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(31,5): error TS2323: Type 'T' is not assignable to type 'S2'.
Types of property 'foo' are incompatible.
Type 'Derived2' is not assignable to type 'Derived'.
Property 'bar' is missing in type 'Derived2'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(32,5): error TS2322: Type '{ foo: Derived2; }' is not assignable to type 'S2':
Types of property 'foo' are incompatible:
Type 'Derived2' is not assignable to type 'Derived':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(32,5): error TS2323: Type '{ foo: Derived2; }' is not assignable to type 'S2'.
Types of property 'foo' are incompatible.
Type 'Derived2' is not assignable to type 'Derived'.
Property 'bar' is missing in type 'Derived2'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(35,5): error TS2322: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }':
Types of property 'foo' are incompatible:
Type 'Derived2' is not assignable to type 'Derived':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(35,5): error TS2323: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }'.
Types of property 'foo' are incompatible.
Type 'Derived2' is not assignable to type 'Derived'.
Property 'bar' is missing in type 'Derived2'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(36,5): error TS2322: Type '{ foo: Derived; }' is not assignable to type '{ foo: Derived2; }':
Types of property 'foo' are incompatible:
Type 'Derived' is not assignable to type 'Derived2':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(36,5): error TS2323: Type '{ foo: Derived; }' is not assignable to type '{ foo: Derived2; }'.
Types of property 'foo' are incompatible.
Type 'Derived' is not assignable to type 'Derived2'.
Property 'baz' is missing in type 'Derived'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(41,5): error TS2322: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }':
Types of property 'foo' are incompatible:
Type 'Derived2' is not assignable to type 'Derived':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(41,5): error TS2323: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }'.
Types of property 'foo' are incompatible.
Type 'Derived2' is not assignable to type 'Derived'.
Property 'bar' is missing in type 'Derived2'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(42,5): error TS2322: Type '{ foo: Derived; }' is not assignable to type '{ foo: Derived2; }':
Types of property 'foo' are incompatible:
Type 'Derived' is not assignable to type 'Derived2':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(42,5): error TS2323: Type '{ foo: Derived; }' is not assignable to type '{ foo: Derived2; }'.
Types of property 'foo' are incompatible.
Type 'Derived' is not assignable to type 'Derived2'.
Property 'baz' is missing in type 'Derived'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(43,5): error TS2322: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }':
Types of property 'foo' are incompatible:
Type 'Derived2' is not assignable to type 'Derived':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(43,5): error TS2323: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }'.
Types of property 'foo' are incompatible.
Type 'Derived2' is not assignable to type 'Derived'.
Property 'bar' is missing in type 'Derived2'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(44,5): error TS2322: Type 'T2' is not assignable to type '{ foo: Derived; }':
Types of property 'foo' are incompatible:
Type 'Derived2' is not assignable to type 'Derived':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(44,5): error TS2323: Type 'T2' is not assignable to type '{ foo: Derived; }'.
Types of property 'foo' are incompatible.
Type 'Derived2' is not assignable to type 'Derived'.
Property 'bar' is missing in type 'Derived2'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(45,5): error TS2322: Type 'T' is not assignable to type '{ foo: Derived; }':
Types of property 'foo' are incompatible:
Type 'Derived2' is not assignable to type 'Derived':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(45,5): error TS2323: Type 'T' is not assignable to type '{ foo: Derived; }'.
Types of property 'foo' are incompatible.
Type 'Derived2' is not assignable to type 'Derived'.
Property 'bar' is missing in type 'Derived2'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(70,5): error TS2322: Type 'S' is not assignable to type 'T':
Types of property 'foo' are incompatible:
Type 'Base' is not assignable to type 'Derived2':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(70,5): error TS2323: Type 'S' is not assignable to type 'T'.
Types of property 'foo' are incompatible.
Type 'Base' is not assignable to type 'Derived2'.
Property 'baz' is missing in type 'Base'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(75,5): error TS2322: Type 'S2' is not assignable to type 'T2':
Types of property 'foo' are incompatible:
Type 'Base' is not assignable to type 'Derived2':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(75,5): error TS2323: Type 'S2' is not assignable to type 'T2'.
Types of property 'foo' are incompatible.
Type 'Base' is not assignable to type 'Derived2'.
Property 'baz' is missing in type 'Base'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(81,5): error TS2322: Type '{ foo: Base; }' is not assignable to type '{ foo: Derived2; }':
Types of property 'foo' are incompatible:
Type 'Base' is not assignable to type 'Derived2':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(81,5): error TS2323: Type '{ foo: Base; }' is not assignable to type '{ foo: Derived2; }'.
Types of property 'foo' are incompatible.
Type 'Base' is not assignable to type 'Derived2'.
Property 'baz' is missing in type 'Base'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(87,5): error TS2322: Type '{ foo: Base; }' is not assignable to type '{ foo: Derived2; }':
Types of property 'foo' are incompatible:
Type 'Base' is not assignable to type 'Derived2':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(87,5): error TS2323: Type '{ foo: Base; }' is not assignable to type '{ foo: Derived2; }'.
Types of property 'foo' are incompatible.
Type 'Base' is not assignable to type 'Derived2'.
Property 'baz' is missing in type 'Base'.
@ -94,91 +94,91 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
s = t; // error
~
!!! error TS2322: Type 'T' is not assignable to type 'S':
!!! error TS2322: Types of property 'foo' are incompatible:
!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived':
!!! error TS2322: Property 'bar' is missing in type 'Derived2'.
!!! error TS2323: Type 'T' is not assignable to type 'S'.
!!! error TS2323: Types of property 'foo' are incompatible.
!!! error TS2323: Type 'Derived2' is not assignable to type 'Derived'.
!!! error TS2323: Property 'bar' is missing in type 'Derived2'.
t = s; // error
~
!!! error TS2322: Type 'S' is not assignable to type 'T':
!!! error TS2322: Types of property 'foo' are incompatible:
!!! error TS2322: Type 'Derived' is not assignable to type 'Derived2':
!!! error TS2322: Property 'baz' is missing in type 'Derived'.
!!! error TS2323: Type 'S' is not assignable to type 'T'.
!!! error TS2323: Types of property 'foo' are incompatible.
!!! error TS2323: Type 'Derived' is not assignable to type 'Derived2'.
!!! error TS2323: Property 'baz' is missing in type 'Derived'.
s = s2; // ok
s = a2; // ok
s2 = t2; // error
~~
!!! error TS2322: Type 'T2' is not assignable to type 'S2':
!!! error TS2322: Types of property 'foo' are incompatible:
!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived':
!!! error TS2322: Property 'bar' is missing in type 'Derived2'.
!!! error TS2323: Type 'T2' is not assignable to type 'S2'.
!!! error TS2323: Types of property 'foo' are incompatible.
!!! error TS2323: Type 'Derived2' is not assignable to type 'Derived'.
!!! error TS2323: Property 'bar' is missing in type 'Derived2'.
t2 = s2; // error
~~
!!! error TS2322: Type 'S2' is not assignable to type 'T2':
!!! error TS2322: Types of property 'foo' are incompatible:
!!! error TS2322: Type 'Derived' is not assignable to type 'Derived2':
!!! error TS2322: Property 'baz' is missing in type 'Derived'.
!!! error TS2323: Type 'S2' is not assignable to type 'T2'.
!!! error TS2323: Types of property 'foo' are incompatible.
!!! error TS2323: Type 'Derived' is not assignable to type 'Derived2'.
!!! error TS2323: Property 'baz' is missing in type 'Derived'.
s2 = t; // error
~~
!!! error TS2322: Type 'T' is not assignable to type 'S2':
!!! error TS2322: Types of property 'foo' are incompatible:
!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived':
!!! error TS2322: Property 'bar' is missing in type 'Derived2'.
!!! error TS2323: Type 'T' is not assignable to type 'S2'.
!!! error TS2323: Types of property 'foo' are incompatible.
!!! error TS2323: Type 'Derived2' is not assignable to type 'Derived'.
!!! error TS2323: Property 'bar' is missing in type 'Derived2'.
s2 = b; // error
~~
!!! error TS2322: Type '{ foo: Derived2; }' is not assignable to type 'S2':
!!! error TS2322: Types of property 'foo' are incompatible:
!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived':
!!! error TS2322: Property 'bar' is missing in type 'Derived2'.
!!! error TS2323: Type '{ foo: Derived2; }' is not assignable to type 'S2'.
!!! error TS2323: Types of property 'foo' are incompatible.
!!! error TS2323: Type 'Derived2' is not assignable to type 'Derived'.
!!! error TS2323: Property 'bar' is missing in type 'Derived2'.
s2 = a2; // ok
a = b; // error
~
!!! error TS2322: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }':
!!! error TS2322: Types of property 'foo' are incompatible:
!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived':
!!! error TS2322: Property 'bar' is missing in type 'Derived2'.
!!! error TS2323: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }'.
!!! error TS2323: Types of property 'foo' are incompatible.
!!! error TS2323: Type 'Derived2' is not assignable to type 'Derived'.
!!! error TS2323: Property 'bar' is missing in type 'Derived2'.
b = a; // error
~
!!! error TS2322: Type '{ foo: Derived; }' is not assignable to type '{ foo: Derived2; }':
!!! error TS2322: Types of property 'foo' are incompatible:
!!! error TS2322: Type 'Derived' is not assignable to type 'Derived2':
!!! error TS2322: Property 'baz' is missing in type 'Derived'.
!!! error TS2323: Type '{ foo: Derived; }' is not assignable to type '{ foo: Derived2; }'.
!!! error TS2323: Types of property 'foo' are incompatible.
!!! error TS2323: Type 'Derived' is not assignable to type 'Derived2'.
!!! error TS2323: Property 'baz' is missing in type 'Derived'.
a = s; // ok
a = s2; // ok
a = a2; // ok
a2 = b2; // error
~~
!!! error TS2322: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }':
!!! error TS2322: Types of property 'foo' are incompatible:
!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived':
!!! error TS2322: Property 'bar' is missing in type 'Derived2'.
!!! error TS2323: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }'.
!!! error TS2323: Types of property 'foo' are incompatible.
!!! error TS2323: Type 'Derived2' is not assignable to type 'Derived'.
!!! error TS2323: Property 'bar' is missing in type 'Derived2'.
b2 = a2; // error
~~
!!! error TS2322: Type '{ foo: Derived; }' is not assignable to type '{ foo: Derived2; }':
!!! error TS2322: Types of property 'foo' are incompatible:
!!! error TS2322: Type 'Derived' is not assignable to type 'Derived2':
!!! error TS2322: Property 'baz' is missing in type 'Derived'.
!!! error TS2323: Type '{ foo: Derived; }' is not assignable to type '{ foo: Derived2; }'.
!!! error TS2323: Types of property 'foo' are incompatible.
!!! error TS2323: Type 'Derived' is not assignable to type 'Derived2'.
!!! error TS2323: Property 'baz' is missing in type 'Derived'.
a2 = b; // error
~~
!!! error TS2322: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }':
!!! error TS2322: Types of property 'foo' are incompatible:
!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived':
!!! error TS2322: Property 'bar' is missing in type 'Derived2'.
!!! error TS2323: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }'.
!!! error TS2323: Types of property 'foo' are incompatible.
!!! error TS2323: Type 'Derived2' is not assignable to type 'Derived'.
!!! error TS2323: Property 'bar' is missing in type 'Derived2'.
a2 = t2; // error
~~
!!! error TS2322: Type 'T2' is not assignable to type '{ foo: Derived; }':
!!! error TS2322: Types of property 'foo' are incompatible:
!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived':
!!! error TS2322: Property 'bar' is missing in type 'Derived2'.
!!! error TS2323: Type 'T2' is not assignable to type '{ foo: Derived; }'.
!!! error TS2323: Types of property 'foo' are incompatible.
!!! error TS2323: Type 'Derived2' is not assignable to type 'Derived'.
!!! error TS2323: Property 'bar' is missing in type 'Derived2'.
a2 = t; // error
~~
!!! error TS2322: Type 'T' is not assignable to type '{ foo: Derived; }':
!!! error TS2322: Types of property 'foo' are incompatible:
!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived':
!!! error TS2322: Property 'bar' is missing in type 'Derived2'.
!!! error TS2323: Type 'T' is not assignable to type '{ foo: Derived; }'.
!!! error TS2323: Types of property 'foo' are incompatible.
!!! error TS2323: Type 'Derived2' is not assignable to type 'Derived'.
!!! error TS2323: Property 'bar' is missing in type 'Derived2'.
}
module WithBase {
@ -205,20 +205,20 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
s = t; // ok
t = s; // error
~
!!! error TS2322: Type 'S' is not assignable to type 'T':
!!! error TS2322: Types of property 'foo' are incompatible:
!!! error TS2322: Type 'Base' is not assignable to type 'Derived2':
!!! error TS2322: Property 'baz' is missing in type 'Base'.
!!! error TS2323: Type 'S' is not assignable to type 'T'.
!!! error TS2323: Types of property 'foo' are incompatible.
!!! error TS2323: Type 'Base' is not assignable to type 'Derived2'.
!!! error TS2323: Property 'baz' is missing in type 'Base'.
s = s2; // ok
s = a2; // ok
s2 = t2; // ok
t2 = s2; // error
~~
!!! error TS2322: Type 'S2' is not assignable to type 'T2':
!!! error TS2322: Types of property 'foo' are incompatible:
!!! error TS2322: Type 'Base' is not assignable to type 'Derived2':
!!! error TS2322: Property 'baz' is missing in type 'Base'.
!!! error TS2323: Type 'S2' is not assignable to type 'T2'.
!!! error TS2323: Types of property 'foo' are incompatible.
!!! error TS2323: Type 'Base' is not assignable to type 'Derived2'.
!!! error TS2323: Property 'baz' is missing in type 'Base'.
s2 = t; // ok
s2 = b; // ok
s2 = a2; // ok
@ -226,10 +226,10 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
a = b; // ok
b = a; // error
~
!!! error TS2322: Type '{ foo: Base; }' is not assignable to type '{ foo: Derived2; }':
!!! error TS2322: Types of property 'foo' are incompatible:
!!! error TS2322: Type 'Base' is not assignable to type 'Derived2':
!!! error TS2322: Property 'baz' is missing in type 'Base'.
!!! error TS2323: Type '{ foo: Base; }' is not assignable to type '{ foo: Derived2; }'.
!!! error TS2323: Types of property 'foo' are incompatible.
!!! error TS2323: Type 'Base' is not assignable to type 'Derived2'.
!!! error TS2323: Property 'baz' is missing in type 'Base'.
a = s; // ok
a = s2; // ok
a = a2; // ok
@ -237,10 +237,10 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
a2 = b2; // ok
b2 = a2; // error
~~
!!! error TS2322: Type '{ foo: Base; }' is not assignable to type '{ foo: Derived2; }':
!!! error TS2322: Types of property 'foo' are incompatible:
!!! error TS2322: Type 'Base' is not assignable to type 'Derived2':
!!! error TS2322: Property 'baz' is missing in type 'Base'.
!!! error TS2323: Type '{ foo: Base; }' is not assignable to type '{ foo: Derived2; }'.
!!! error TS2323: Types of property 'foo' are incompatible.
!!! error TS2323: Type 'Base' is not assignable to type 'Derived2'.
!!! error TS2323: Property 'baz' is missing in type 'Base'.
a2 = b; // ok
a2 = t2; // ok
a2 = t; // ok

View File

@ -1,6 +1,6 @@
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers5.ts(13,1): error TS2322: Type 'I' is not assignable to type 'C':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers5.ts(13,1): error TS2323: Type 'I' is not assignable to type 'C'.
Property 'foo' is missing in type 'I'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers5.ts(14,1): error TS2322: Type 'C' is not assignable to type 'I':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers5.ts(14,1): error TS2323: Type 'C' is not assignable to type 'I'.
Property 'fooo' is missing in type 'C'.
@ -19,9 +19,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
c = i; // error
~
!!! error TS2322: Type 'I' is not assignable to type 'C':
!!! error TS2322: Property 'foo' is missing in type 'I'.
!!! error TS2323: Type 'I' is not assignable to type 'C'.
!!! error TS2323: Property 'foo' is missing in type 'I'.
i = c; // error
~
!!! error TS2322: Type 'C' is not assignable to type 'I':
!!! error TS2322: Property 'fooo' is missing in type 'C'.
!!! error TS2323: Type 'C' is not assignable to type 'I'.
!!! error TS2323: Property 'fooo' is missing in type 'C'.

View File

@ -1,50 +1,50 @@
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(31,5): error TS2322: Type 'E' is not assignable to type '{ foo: string; }':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(31,5): error TS2323: Type 'E' is not assignable to type '{ foo: string; }'.
Property 'foo' is private in type 'E' but not in type '{ foo: string; }'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(36,5): error TS2322: Type 'E' is not assignable to type 'Base':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(36,5): error TS2323: Type 'E' is not assignable to type 'Base'.
Property 'foo' is private in type 'E' but not in type 'Base'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(41,5): error TS2322: Type 'E' is not assignable to type 'I':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(41,5): error TS2323: Type 'E' is not assignable to type 'I'.
Property 'foo' is private in type 'E' but not in type 'I'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(46,5): error TS2322: Type 'E' is not assignable to type 'D':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(46,5): error TS2323: Type 'E' is not assignable to type 'D'.
Property 'foo' is private in type 'E' but not in type 'D'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(48,5): error TS2322: Type '{ foo: string; }' is not assignable to type 'E':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(48,5): error TS2323: Type '{ foo: string; }' is not assignable to type 'E'.
Property 'foo' is private in type 'E' but not in type '{ foo: string; }'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(49,5): error TS2322: Type 'Base' is not assignable to type 'E':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(49,5): error TS2323: Type 'Base' is not assignable to type 'E'.
Property 'foo' is private in type 'E' but not in type 'Base'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(50,5): error TS2322: Type 'I' is not assignable to type 'E':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(50,5): error TS2323: Type 'I' is not assignable to type 'E'.
Property 'foo' is private in type 'E' but not in type 'I'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(51,5): error TS2322: Type 'D' is not assignable to type 'E':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(51,5): error TS2323: Type 'D' is not assignable to type 'E'.
Property 'foo' is private in type 'E' but not in type 'D'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(81,5): error TS2322: Type 'Base' is not assignable to type '{ foo: string; }':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(81,5): error TS2323: Type 'Base' is not assignable to type '{ foo: string; }'.
Property 'foo' is private in type 'Base' but not in type '{ foo: string; }'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(82,5): error TS2322: Type 'I' is not assignable to type '{ foo: string; }':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(82,5): error TS2323: Type 'I' is not assignable to type '{ foo: string; }'.
Property 'foo' is private in type 'I' but not in type '{ foo: string; }'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(84,5): error TS2322: Type 'E' is not assignable to type '{ foo: string; }':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(84,5): error TS2323: Type 'E' is not assignable to type '{ foo: string; }'.
Property 'foo' is private in type 'E' but not in type '{ foo: string; }'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(86,5): error TS2322: Type '{ foo: string; }' is not assignable to type 'Base':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(86,5): error TS2323: Type '{ foo: string; }' is not assignable to type 'Base'.
Property 'foo' is private in type 'Base' but not in type '{ foo: string; }'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(88,5): error TS2322: Type 'D' is not assignable to type 'Base':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(88,5): error TS2323: Type 'D' is not assignable to type 'Base'.
Property 'foo' is private in type 'Base' but not in type 'D'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(89,5): error TS2322: Type 'E' is not assignable to type 'Base':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(89,5): error TS2323: Type 'E' is not assignable to type 'Base'.
Types have separate declarations of a private property 'foo'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(92,5): error TS2322: Type '{ foo: string; }' is not assignable to type 'I':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(92,5): error TS2323: Type '{ foo: string; }' is not assignable to type 'I'.
Property 'foo' is private in type 'I' but not in type '{ foo: string; }'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(94,5): error TS2322: Type 'D' is not assignable to type 'I':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(94,5): error TS2323: Type 'D' is not assignable to type 'I'.
Property 'foo' is private in type 'I' but not in type 'D'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(95,5): error TS2322: Type 'E' is not assignable to type 'I':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(95,5): error TS2323: Type 'E' is not assignable to type 'I'.
Types have separate declarations of a private property 'foo'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(99,5): error TS2322: Type 'Base' is not assignable to type 'D':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(99,5): error TS2323: Type 'Base' is not assignable to type 'D'.
Property 'foo' is private in type 'Base' but not in type 'D'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(100,5): error TS2322: Type 'I' is not assignable to type 'D':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(100,5): error TS2323: Type 'I' is not assignable to type 'D'.
Property 'foo' is private in type 'I' but not in type 'D'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(101,5): error TS2322: Type 'E' is not assignable to type 'D':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(101,5): error TS2323: Type 'E' is not assignable to type 'D'.
Property 'foo' is private in type 'E' but not in type 'D'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(103,5): error TS2322: Type '{ foo: string; }' is not assignable to type 'E':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(103,5): error TS2323: Type '{ foo: string; }' is not assignable to type 'E'.
Property 'foo' is private in type 'E' but not in type '{ foo: string; }'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(104,5): error TS2322: Type 'Base' is not assignable to type 'E':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(104,5): error TS2323: Type 'Base' is not assignable to type 'E'.
Types have separate declarations of a private property 'foo'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(105,5): error TS2322: Type 'I' is not assignable to type 'E':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(105,5): error TS2323: Type 'I' is not assignable to type 'E'.
Types have separate declarations of a private property 'foo'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(106,5): error TS2322: Type 'D' is not assignable to type 'E':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(106,5): error TS2323: Type 'D' is not assignable to type 'E'.
Property 'foo' is private in type 'E' but not in type 'D'.
@ -81,49 +81,49 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
a = d;
a = e; // error
~
!!! error TS2322: Type 'E' is not assignable to type '{ foo: string; }':
!!! error TS2322: Property 'foo' is private in type 'E' but not in type '{ foo: string; }'.
!!! error TS2323: Type 'E' is not assignable to type '{ foo: string; }'.
!!! error TS2323: Property 'foo' is private in type 'E' but not in type '{ foo: string; }'.
b = a;
b = i;
b = d;
b = e; // error
~
!!! error TS2322: Type 'E' is not assignable to type 'Base':
!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'Base'.
!!! error TS2323: Type 'E' is not assignable to type 'Base'.
!!! error TS2323: Property 'foo' is private in type 'E' but not in type 'Base'.
i = a;
i = b;
i = d;
i = e; // error
~
!!! error TS2322: Type 'E' is not assignable to type 'I':
!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'I'.
!!! error TS2323: Type 'E' is not assignable to type 'I'.
!!! error TS2323: Property 'foo' is private in type 'E' but not in type 'I'.
d = a;
d = b;
d = i;
d = e; // error
~
!!! error TS2322: Type 'E' is not assignable to type 'D':
!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'D'.
!!! error TS2323: Type 'E' is not assignable to type 'D'.
!!! error TS2323: Property 'foo' is private in type 'E' but not in type 'D'.
e = a; // errror
~
!!! error TS2322: Type '{ foo: string; }' is not assignable to type 'E':
!!! error TS2322: Property 'foo' is private in type 'E' but not in type '{ foo: string; }'.
!!! error TS2323: Type '{ foo: string; }' is not assignable to type 'E'.
!!! error TS2323: Property 'foo' is private in type 'E' but not in type '{ foo: string; }'.
e = b; // errror
~
!!! error TS2322: Type 'Base' is not assignable to type 'E':
!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'Base'.
!!! error TS2323: Type 'Base' is not assignable to type 'E'.
!!! error TS2323: Property 'foo' is private in type 'E' but not in type 'Base'.
e = i; // errror
~
!!! error TS2322: Type 'I' is not assignable to type 'E':
!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'I'.
!!! error TS2323: Type 'I' is not assignable to type 'E'.
!!! error TS2323: Property 'foo' is private in type 'E' but not in type 'I'.
e = d; // errror
~
!!! error TS2322: Type 'D' is not assignable to type 'E':
!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'D'.
!!! error TS2323: Type 'D' is not assignable to type 'E'.
!!! error TS2323: Property 'foo' is private in type 'E' but not in type 'D'.
e = e;
}
@ -155,78 +155,78 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
a = b; // error
~
!!! error TS2322: Type 'Base' is not assignable to type '{ foo: string; }':
!!! error TS2322: Property 'foo' is private in type 'Base' but not in type '{ foo: string; }'.
!!! error TS2323: Type 'Base' is not assignable to type '{ foo: string; }'.
!!! error TS2323: Property 'foo' is private in type 'Base' but not in type '{ foo: string; }'.
a = i; // error
~
!!! error TS2322: Type 'I' is not assignable to type '{ foo: string; }':
!!! error TS2322: Property 'foo' is private in type 'I' but not in type '{ foo: string; }'.
!!! error TS2323: Type 'I' is not assignable to type '{ foo: string; }'.
!!! error TS2323: Property 'foo' is private in type 'I' but not in type '{ foo: string; }'.
a = d;
a = e; // error
~
!!! error TS2322: Type 'E' is not assignable to type '{ foo: string; }':
!!! error TS2322: Property 'foo' is private in type 'E' but not in type '{ foo: string; }'.
!!! error TS2323: Type 'E' is not assignable to type '{ foo: string; }'.
!!! error TS2323: Property 'foo' is private in type 'E' but not in type '{ foo: string; }'.
b = a; // error
~
!!! error TS2322: Type '{ foo: string; }' is not assignable to type 'Base':
!!! error TS2322: Property 'foo' is private in type 'Base' but not in type '{ foo: string; }'.
!!! error TS2323: Type '{ foo: string; }' is not assignable to type 'Base'.
!!! error TS2323: Property 'foo' is private in type 'Base' but not in type '{ foo: string; }'.
b = i;
b = d; // error
~
!!! error TS2322: Type 'D' is not assignable to type 'Base':
!!! error TS2322: Property 'foo' is private in type 'Base' but not in type 'D'.
!!! error TS2323: Type 'D' is not assignable to type 'Base'.
!!! error TS2323: Property 'foo' is private in type 'Base' but not in type 'D'.
b = e; // error
~
!!! error TS2322: Type 'E' is not assignable to type 'Base':
!!! error TS2322: Types have separate declarations of a private property 'foo'.
!!! error TS2323: Type 'E' is not assignable to type 'Base'.
!!! error TS2323: Types have separate declarations of a private property 'foo'.
b = b;
i = a; // error
~
!!! error TS2322: Type '{ foo: string; }' is not assignable to type 'I':
!!! error TS2322: Property 'foo' is private in type 'I' but not in type '{ foo: string; }'.
!!! error TS2323: Type '{ foo: string; }' is not assignable to type 'I'.
!!! error TS2323: Property 'foo' is private in type 'I' but not in type '{ foo: string; }'.
i = b;
i = d; // error
~
!!! error TS2322: Type 'D' is not assignable to type 'I':
!!! error TS2322: Property 'foo' is private in type 'I' but not in type 'D'.
!!! error TS2323: Type 'D' is not assignable to type 'I'.
!!! error TS2323: Property 'foo' is private in type 'I' but not in type 'D'.
i = e; // error
~
!!! error TS2322: Type 'E' is not assignable to type 'I':
!!! error TS2322: Types have separate declarations of a private property 'foo'.
!!! error TS2323: Type 'E' is not assignable to type 'I'.
!!! error TS2323: Types have separate declarations of a private property 'foo'.
i = i;
d = a;
d = b; // error
~
!!! error TS2322: Type 'Base' is not assignable to type 'D':
!!! error TS2322: Property 'foo' is private in type 'Base' but not in type 'D'.
!!! error TS2323: Type 'Base' is not assignable to type 'D'.
!!! error TS2323: Property 'foo' is private in type 'Base' but not in type 'D'.
d = i; // error
~
!!! error TS2322: Type 'I' is not assignable to type 'D':
!!! error TS2322: Property 'foo' is private in type 'I' but not in type 'D'.
!!! error TS2323: Type 'I' is not assignable to type 'D'.
!!! error TS2323: Property 'foo' is private in type 'I' but not in type 'D'.
d = e; // error
~
!!! error TS2322: Type 'E' is not assignable to type 'D':
!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'D'.
!!! error TS2323: Type 'E' is not assignable to type 'D'.
!!! error TS2323: Property 'foo' is private in type 'E' but not in type 'D'.
e = a; // errror
~
!!! error TS2322: Type '{ foo: string; }' is not assignable to type 'E':
!!! error TS2322: Property 'foo' is private in type 'E' but not in type '{ foo: string; }'.
!!! error TS2323: Type '{ foo: string; }' is not assignable to type 'E'.
!!! error TS2323: Property 'foo' is private in type 'E' but not in type '{ foo: string; }'.
e = b; // errror
~
!!! error TS2322: Type 'Base' is not assignable to type 'E':
!!! error TS2322: Types have separate declarations of a private property 'foo'.
!!! error TS2323: Type 'Base' is not assignable to type 'E'.
!!! error TS2323: Types have separate declarations of a private property 'foo'.
e = i; // errror
~
!!! error TS2322: Type 'I' is not assignable to type 'E':
!!! error TS2322: Types have separate declarations of a private property 'foo'.
!!! error TS2323: Type 'I' is not assignable to type 'E'.
!!! error TS2323: Types have separate declarations of a private property 'foo'.
e = d; // errror
~
!!! error TS2322: Type 'D' is not assignable to type 'E':
!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'D'.
!!! error TS2323: Type 'D' is not assignable to type 'E'.
!!! error TS2323: Property 'foo' is private in type 'E' but not in type 'D'.
e = e;
}

View File

@ -1,14 +1,14 @@
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(73,5): error TS2322: Type 'D' is not assignable to type 'C':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(73,5): error TS2323: Type 'D' is not assignable to type 'C'.
Property 'opt' is optional in type 'D' but required in type 'C'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(74,5): error TS2322: Type 'E' is not assignable to type 'C':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(74,5): error TS2323: Type 'E' is not assignable to type 'C'.
Property 'opt' is optional in type 'E' but required in type 'C'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(78,5): error TS2322: Type 'D' is not assignable to type '{ opt: Base; }':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(78,5): error TS2323: Type 'D' is not assignable to type '{ opt: Base; }'.
Property 'opt' is optional in type 'D' but required in type '{ opt: Base; }'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(79,5): error TS2322: Type 'E' is not assignable to type '{ opt: Base; }':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(79,5): error TS2323: Type 'E' is not assignable to type '{ opt: Base; }'.
Property 'opt' is optional in type 'E' but required in type '{ opt: Base; }'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(83,5): error TS2322: Type 'D' is not assignable to type '{ opt: Base; }':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(83,5): error TS2323: Type 'D' is not assignable to type '{ opt: Base; }'.
Property 'opt' is optional in type 'D' but required in type '{ opt: Base; }'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(84,5): error TS2322: Type 'E' is not assignable to type '{ opt: Base; }':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(84,5): error TS2323: Type 'E' is not assignable to type '{ opt: Base; }'.
Property 'opt' is optional in type 'E' but required in type '{ opt: Base; }'.
@ -87,34 +87,34 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
c = d; // error
~
!!! error TS2322: Type 'D' is not assignable to type 'C':
!!! error TS2322: Property 'opt' is optional in type 'D' but required in type 'C'.
!!! error TS2323: Type 'D' is not assignable to type 'C'.
!!! error TS2323: Property 'opt' is optional in type 'D' but required in type 'C'.
c = e; // error
~
!!! error TS2322: Type 'E' is not assignable to type 'C':
!!! error TS2322: Property 'opt' is optional in type 'E' but required in type 'C'.
!!! error TS2323: Type 'E' is not assignable to type 'C'.
!!! error TS2323: Property 'opt' is optional in type 'E' but required in type 'C'.
c = f; // ok
c = a; // ok
a = d; // error
~
!!! error TS2322: Type 'D' is not assignable to type '{ opt: Base; }':
!!! error TS2322: Property 'opt' is optional in type 'D' but required in type '{ opt: Base; }'.
!!! error TS2323: Type 'D' is not assignable to type '{ opt: Base; }'.
!!! error TS2323: Property 'opt' is optional in type 'D' but required in type '{ opt: Base; }'.
a = e; // error
~
!!! error TS2322: Type 'E' is not assignable to type '{ opt: Base; }':
!!! error TS2322: Property 'opt' is optional in type 'E' but required in type '{ opt: Base; }'.
!!! error TS2323: Type 'E' is not assignable to type '{ opt: Base; }'.
!!! error TS2323: Property 'opt' is optional in type 'E' but required in type '{ opt: Base; }'.
a = f; // ok
a = c; // ok
b = d; // error
~
!!! error TS2322: Type 'D' is not assignable to type '{ opt: Base; }':
!!! error TS2322: Property 'opt' is optional in type 'D' but required in type '{ opt: Base; }'.
!!! error TS2323: Type 'D' is not assignable to type '{ opt: Base; }'.
!!! error TS2323: Property 'opt' is optional in type 'D' but required in type '{ opt: Base; }'.
b = e; // error
~
!!! error TS2322: Type 'E' is not assignable to type '{ opt: Base; }':
!!! error TS2322: Property 'opt' is optional in type 'E' but required in type '{ opt: Base; }'.
!!! error TS2323: Type 'E' is not assignable to type '{ opt: Base; }'.
!!! error TS2323: Property 'opt' is optional in type 'E' but required in type '{ opt: Base; }'.
b = f; // ok
b = a; // ok
b = c; // ok

View File

@ -1,20 +1,20 @@
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(74,5): error TS2322: Type 'D' is not assignable to type 'C':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(74,5): error TS2323: Type 'D' is not assignable to type 'C'.
Property 'opt' is missing in type 'D'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(75,5): error TS2322: Type 'E' is not assignable to type 'C':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(75,5): error TS2323: Type 'E' is not assignable to type 'C'.
Property 'opt' is missing in type 'E'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(76,5): error TS2322: Type 'F' is not assignable to type 'C':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(76,5): error TS2323: Type 'F' is not assignable to type 'C'.
Property 'opt' is missing in type 'F'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(79,5): error TS2322: Type 'D' is not assignable to type '{ opt: Base; }':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(79,5): error TS2323: Type 'D' is not assignable to type '{ opt: Base; }'.
Property 'opt' is missing in type 'D'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(80,5): error TS2322: Type 'E' is not assignable to type '{ opt: Base; }':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(80,5): error TS2323: Type 'E' is not assignable to type '{ opt: Base; }'.
Property 'opt' is missing in type 'E'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(81,5): error TS2322: Type 'F' is not assignable to type '{ opt: Base; }':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(81,5): error TS2323: Type 'F' is not assignable to type '{ opt: Base; }'.
Property 'opt' is missing in type 'F'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(84,5): error TS2322: Type 'D' is not assignable to type '{ opt: Base; }':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(84,5): error TS2323: Type 'D' is not assignable to type '{ opt: Base; }'.
Property 'opt' is missing in type 'D'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(85,5): error TS2322: Type 'E' is not assignable to type '{ opt: Base; }':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(85,5): error TS2323: Type 'E' is not assignable to type '{ opt: Base; }'.
Property 'opt' is missing in type 'E'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(86,5): error TS2322: Type 'F' is not assignable to type '{ opt: Base; }':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(86,5): error TS2323: Type 'F' is not assignable to type '{ opt: Base; }'.
Property 'opt' is missing in type 'F'.
@ -94,44 +94,44 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
c = d; // error
~
!!! error TS2322: Type 'D' is not assignable to type 'C':
!!! error TS2322: Property 'opt' is missing in type 'D'.
!!! error TS2323: Type 'D' is not assignable to type 'C'.
!!! error TS2323: Property 'opt' is missing in type 'D'.
c = e; // error
~
!!! error TS2322: Type 'E' is not assignable to type 'C':
!!! error TS2322: Property 'opt' is missing in type 'E'.
!!! error TS2323: Type 'E' is not assignable to type 'C'.
!!! error TS2323: Property 'opt' is missing in type 'E'.
c = f; // error
~
!!! error TS2322: Type 'F' is not assignable to type 'C':
!!! error TS2322: Property 'opt' is missing in type 'F'.
!!! error TS2323: Type 'F' is not assignable to type 'C'.
!!! error TS2323: Property 'opt' is missing in type 'F'.
c = a; // ok
a = d; // error
~
!!! error TS2322: Type 'D' is not assignable to type '{ opt: Base; }':
!!! error TS2322: Property 'opt' is missing in type 'D'.
!!! error TS2323: Type 'D' is not assignable to type '{ opt: Base; }'.
!!! error TS2323: Property 'opt' is missing in type 'D'.
a = e; // error
~
!!! error TS2322: Type 'E' is not assignable to type '{ opt: Base; }':
!!! error TS2322: Property 'opt' is missing in type 'E'.
!!! error TS2323: Type 'E' is not assignable to type '{ opt: Base; }'.
!!! error TS2323: Property 'opt' is missing in type 'E'.
a = f; // error
~
!!! error TS2322: Type 'F' is not assignable to type '{ opt: Base; }':
!!! error TS2322: Property 'opt' is missing in type 'F'.
!!! error TS2323: Type 'F' is not assignable to type '{ opt: Base; }'.
!!! error TS2323: Property 'opt' is missing in type 'F'.
a = c; // ok
b = d; // error
~
!!! error TS2322: Type 'D' is not assignable to type '{ opt: Base; }':
!!! error TS2322: Property 'opt' is missing in type 'D'.
!!! error TS2323: Type 'D' is not assignable to type '{ opt: Base; }'.
!!! error TS2323: Property 'opt' is missing in type 'D'.
b = e; // error
~
!!! error TS2322: Type 'E' is not assignable to type '{ opt: Base; }':
!!! error TS2322: Property 'opt' is missing in type 'E'.
!!! error TS2323: Type 'E' is not assignable to type '{ opt: Base; }'.
!!! error TS2323: Property 'opt' is missing in type 'E'.
b = f; // error
~
!!! error TS2322: Type 'F' is not assignable to type '{ opt: Base; }':
!!! error TS2322: Property 'opt' is missing in type 'F'.
!!! error TS2323: Type 'F' is not assignable to type '{ opt: Base; }'.
!!! error TS2323: Property 'opt' is missing in type 'F'.
b = a; // ok
b = c; // ok
}

View File

@ -1,60 +1,60 @@
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(21,5): error TS2322: Type 'T' is not assignable to type 'S':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(21,5): error TS2323: Type 'T' is not assignable to type 'S'.
Property ''1'' is missing in type 'T'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(22,5): error TS2322: Type 'S' is not assignable to type 'T':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(22,5): error TS2323: Type 'S' is not assignable to type 'T'.
Property ''1.'' is missing in type 'S'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(24,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(24,5): error TS2323: Type '{ '1.0': string; }' is not assignable to type 'S'.
Property ''1'' is missing in type '{ '1.0': string; }'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(26,5): error TS2322: Type 'T2' is not assignable to type 'S2':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(26,5): error TS2323: Type 'T2' is not assignable to type 'S2'.
Property ''1'' is missing in type 'T2'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(27,5): error TS2322: Type 'S2' is not assignable to type 'T2':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(27,5): error TS2323: Type 'S2' is not assignable to type 'T2'.
Property ''1.0'' is missing in type 'S2'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(28,5): error TS2322: Type 'T' is not assignable to type 'S2':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(28,5): error TS2323: Type 'T' is not assignable to type 'S2'.
Property ''1'' is missing in type 'T'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(29,5): error TS2322: Type '{ '1.0': string; baz?: string; }' is not assignable to type 'S2':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(29,5): error TS2323: Type '{ '1.0': string; baz?: string; }' is not assignable to type 'S2'.
Property ''1'' is missing in type '{ '1.0': string; baz?: string; }'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(30,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S2':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(30,5): error TS2323: Type '{ '1.0': string; }' is not assignable to type 'S2'.
Property ''1'' is missing in type '{ '1.0': string; }'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(32,5): error TS2322: Type '{ '1.0': string; baz?: string; }' is not assignable to type '{ '1.': string; bar?: string; }':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(32,5): error TS2323: Type '{ '1.0': string; baz?: string; }' is not assignable to type '{ '1.': string; bar?: string; }'.
Property ''1.'' is missing in type '{ '1.0': string; baz?: string; }'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(33,5): error TS2322: Type '{ '1.': string; bar?: string; }' is not assignable to type '{ '1.0': string; baz?: string; }':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(33,5): error TS2323: Type '{ '1.': string; bar?: string; }' is not assignable to type '{ '1.0': string; baz?: string; }'.
Property ''1.0'' is missing in type '{ '1.': string; bar?: string; }'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(34,5): error TS2322: Type 'S' is not assignable to type '{ '1.': string; bar?: string; }':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(34,5): error TS2323: Type 'S' is not assignable to type '{ '1.': string; bar?: string; }'.
Property ''1.'' is missing in type 'S'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(35,5): error TS2322: Type 'S2' is not assignable to type '{ '1.': string; bar?: string; }':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(35,5): error TS2323: Type 'S2' is not assignable to type '{ '1.': string; bar?: string; }'.
Property ''1.'' is missing in type 'S2'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(36,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ '1.': string; bar?: string; }':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(36,5): error TS2323: Type '{ '1.0': string; }' is not assignable to type '{ '1.': string; bar?: string; }'.
Property ''1.'' is missing in type '{ '1.0': string; }'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(38,5): error TS2322: Type '{ '1': string; }' is not assignable to type '{ '1.0': string; }':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(38,5): error TS2323: Type '{ '1': string; }' is not assignable to type '{ '1.0': string; }'.
Property ''1.0'' is missing in type '{ '1': string; }'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(39,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ '1': string; }':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(39,5): error TS2323: Type '{ '1.0': string; }' is not assignable to type '{ '1': string; }'.
Property ''1'' is missing in type '{ '1.0': string; }'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(42,5): error TS2322: Type 'T' is not assignable to type '{ '1.0': string; }':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(42,5): error TS2323: Type 'T' is not assignable to type '{ '1.0': string; }'.
Property ''1.0'' is missing in type 'T'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(65,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(65,5): error TS2323: Type '{ '1.0': string; }' is not assignable to type 'S'.
Property ''1'' is missing in type '{ '1.0': string; }'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(71,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S2':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(71,5): error TS2323: Type '{ '1.0': string; }' is not assignable to type 'S2'.
Property ''1'' is missing in type '{ '1.0': string; }'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(73,5): error TS2322: Type '{ 1.0: string; baz?: string; }' is not assignable to type '{ '1.': string; bar?: string; }':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(73,5): error TS2323: Type '{ 1.0: string; baz?: string; }' is not assignable to type '{ '1.': string; bar?: string; }'.
Property ''1.'' is missing in type '{ 1.0: string; baz?: string; }'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(74,5): error TS2322: Type '{ '1.': string; bar?: string; }' is not assignable to type '{ 1.0: string; baz?: string; }':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(74,5): error TS2323: Type '{ '1.': string; bar?: string; }' is not assignable to type '{ 1.0: string; baz?: string; }'.
Property '1.0' is missing in type '{ '1.': string; bar?: string; }'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(75,5): error TS2322: Type 'S' is not assignable to type '{ '1.': string; bar?: string; }':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(75,5): error TS2323: Type 'S' is not assignable to type '{ '1.': string; bar?: string; }'.
Property ''1.'' is missing in type 'S'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(76,5): error TS2322: Type 'S2' is not assignable to type '{ '1.': string; bar?: string; }':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(76,5): error TS2323: Type 'S2' is not assignable to type '{ '1.': string; bar?: string; }'.
Property ''1.'' is missing in type 'S2'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(77,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ '1.': string; bar?: string; }':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(77,5): error TS2323: Type '{ '1.0': string; }' is not assignable to type '{ '1.': string; bar?: string; }'.
Property ''1.'' is missing in type '{ '1.0': string; }'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(78,5): error TS2322: Type '{ 1.: string; }' is not assignable to type '{ '1.': string; bar?: string; }':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(78,5): error TS2323: Type '{ 1.: string; }' is not assignable to type '{ '1.': string; bar?: string; }'.
Property ''1.'' is missing in type '{ 1.: string; }'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(80,5): error TS2322: Type '{ 1.: string; }' is not assignable to type '{ '1.0': string; }':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(80,5): error TS2323: Type '{ 1.: string; }' is not assignable to type '{ '1.0': string; }'.
Property ''1.0'' is missing in type '{ 1.: string; }'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(81,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ 1.: string; }':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(81,5): error TS2323: Type '{ '1.0': string; }' is not assignable to type '{ 1.: string; }'.
Property '1.' is missing in type '{ '1.0': string; }'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(82,5): error TS2322: Type '{ 1.0: string; baz?: string; }' is not assignable to type '{ '1.0': string; }':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(82,5): error TS2323: Type '{ 1.0: string; baz?: string; }' is not assignable to type '{ '1.0': string; }'.
Property ''1.0'' is missing in type '{ 1.0: string; baz?: string; }'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(83,5): error TS2322: Type 'T2' is not assignable to type '{ '1.0': string; }':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(83,5): error TS2323: Type 'T2' is not assignable to type '{ '1.0': string; }'.
Property ''1.0'' is missing in type 'T2'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(84,5): error TS2322: Type 'T' is not assignable to type '{ '1.0': string; }':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(84,5): error TS2323: Type 'T' is not assignable to type '{ '1.0': string; }'.
Property ''1.0'' is missing in type 'T'.
@ -81,74 +81,74 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
s = t;
~
!!! error TS2322: Type 'T' is not assignable to type 'S':
!!! error TS2322: Property ''1'' is missing in type 'T'.
!!! error TS2323: Type 'T' is not assignable to type 'S'.
!!! error TS2323: Property ''1'' is missing in type 'T'.
t = s;
~
!!! error TS2322: Type 'S' is not assignable to type 'T':
!!! error TS2322: Property ''1.'' is missing in type 'S'.
!!! error TS2323: Type 'S' is not assignable to type 'T'.
!!! error TS2323: Property ''1.'' is missing in type 'S'.
s = s2; // ok
s = a2;
~
!!! error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S':
!!! error TS2322: Property ''1'' is missing in type '{ '1.0': string; }'.
!!! error TS2323: Type '{ '1.0': string; }' is not assignable to type 'S'.
!!! error TS2323: Property ''1'' is missing in type '{ '1.0': string; }'.
s2 = t2;
~~
!!! error TS2322: Type 'T2' is not assignable to type 'S2':
!!! error TS2322: Property ''1'' is missing in type 'T2'.
!!! error TS2323: Type 'T2' is not assignable to type 'S2'.
!!! error TS2323: Property ''1'' is missing in type 'T2'.
t2 = s2;
~~
!!! error TS2322: Type 'S2' is not assignable to type 'T2':
!!! error TS2322: Property ''1.0'' is missing in type 'S2'.
!!! error TS2323: Type 'S2' is not assignable to type 'T2'.
!!! error TS2323: Property ''1.0'' is missing in type 'S2'.
s2 = t;
~~
!!! error TS2322: Type 'T' is not assignable to type 'S2':
!!! error TS2322: Property ''1'' is missing in type 'T'.
!!! error TS2323: Type 'T' is not assignable to type 'S2'.
!!! error TS2323: Property ''1'' is missing in type 'T'.
s2 = b;
~~
!!! error TS2322: Type '{ '1.0': string; baz?: string; }' is not assignable to type 'S2':
!!! error TS2322: Property ''1'' is missing in type '{ '1.0': string; baz?: string; }'.
!!! error TS2323: Type '{ '1.0': string; baz?: string; }' is not assignable to type 'S2'.
!!! error TS2323: Property ''1'' is missing in type '{ '1.0': string; baz?: string; }'.
s2 = a2;
~~
!!! error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S2':
!!! error TS2322: Property ''1'' is missing in type '{ '1.0': string; }'.
!!! error TS2323: Type '{ '1.0': string; }' is not assignable to type 'S2'.
!!! error TS2323: Property ''1'' is missing in type '{ '1.0': string; }'.
a = b;
~
!!! error TS2322: Type '{ '1.0': string; baz?: string; }' is not assignable to type '{ '1.': string; bar?: string; }':
!!! error TS2322: Property ''1.'' is missing in type '{ '1.0': string; baz?: string; }'.
!!! error TS2323: Type '{ '1.0': string; baz?: string; }' is not assignable to type '{ '1.': string; bar?: string; }'.
!!! error TS2323: Property ''1.'' is missing in type '{ '1.0': string; baz?: string; }'.
b = a;
~
!!! error TS2322: Type '{ '1.': string; bar?: string; }' is not assignable to type '{ '1.0': string; baz?: string; }':
!!! error TS2322: Property ''1.0'' is missing in type '{ '1.': string; bar?: string; }'.
!!! error TS2323: Type '{ '1.': string; bar?: string; }' is not assignable to type '{ '1.0': string; baz?: string; }'.
!!! error TS2323: Property ''1.0'' is missing in type '{ '1.': string; bar?: string; }'.
a = s;
~
!!! error TS2322: Type 'S' is not assignable to type '{ '1.': string; bar?: string; }':
!!! error TS2322: Property ''1.'' is missing in type 'S'.
!!! error TS2323: Type 'S' is not assignable to type '{ '1.': string; bar?: string; }'.
!!! error TS2323: Property ''1.'' is missing in type 'S'.
a = s2;
~
!!! error TS2322: Type 'S2' is not assignable to type '{ '1.': string; bar?: string; }':
!!! error TS2322: Property ''1.'' is missing in type 'S2'.
!!! error TS2323: Type 'S2' is not assignable to type '{ '1.': string; bar?: string; }'.
!!! error TS2323: Property ''1.'' is missing in type 'S2'.
a = a2;
~
!!! error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ '1.': string; bar?: string; }':
!!! error TS2322: Property ''1.'' is missing in type '{ '1.0': string; }'.
!!! error TS2323: Type '{ '1.0': string; }' is not assignable to type '{ '1.': string; bar?: string; }'.
!!! error TS2323: Property ''1.'' is missing in type '{ '1.0': string; }'.
a2 = b2;
~~
!!! error TS2322: Type '{ '1': string; }' is not assignable to type '{ '1.0': string; }':
!!! error TS2322: Property ''1.0'' is missing in type '{ '1': string; }'.
!!! error TS2323: Type '{ '1': string; }' is not assignable to type '{ '1.0': string; }'.
!!! error TS2323: Property ''1.0'' is missing in type '{ '1': string; }'.
b2 = a2;
~~
!!! error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ '1': string; }':
!!! error TS2322: Property ''1'' is missing in type '{ '1.0': string; }'.
!!! error TS2323: Type '{ '1.0': string; }' is not assignable to type '{ '1': string; }'.
!!! error TS2323: Property ''1'' is missing in type '{ '1.0': string; }'.
a2 = b; // ok
a2 = t2; // ok
a2 = t;
~~
!!! error TS2322: Type 'T' is not assignable to type '{ '1.0': string; }':
!!! error TS2322: Property ''1.0'' is missing in type 'T'.
!!! error TS2323: Type 'T' is not assignable to type '{ '1.0': string; }'.
!!! error TS2323: Property ''1.0'' is missing in type 'T'.
}
module NumbersAndStrings {
@ -173,8 +173,8 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
s = s2; // ok
s = a2; // error
~
!!! error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S':
!!! error TS2322: Property ''1'' is missing in type '{ '1.0': string; }'.
!!! error TS2323: Type '{ '1.0': string; }' is not assignable to type 'S'.
!!! error TS2323: Property ''1'' is missing in type '{ '1.0': string; }'.
s2 = t2; // ok
t2 = s2; // ok
@ -182,52 +182,52 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
s2 = b; // ok
s2 = a2; // error
~~
!!! error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S2':
!!! error TS2322: Property ''1'' is missing in type '{ '1.0': string; }'.
!!! error TS2323: Type '{ '1.0': string; }' is not assignable to type 'S2'.
!!! error TS2323: Property ''1'' is missing in type '{ '1.0': string; }'.
a = b; // error
~
!!! error TS2322: Type '{ 1.0: string; baz?: string; }' is not assignable to type '{ '1.': string; bar?: string; }':
!!! error TS2322: Property ''1.'' is missing in type '{ 1.0: string; baz?: string; }'.
!!! error TS2323: Type '{ 1.0: string; baz?: string; }' is not assignable to type '{ '1.': string; bar?: string; }'.
!!! error TS2323: Property ''1.'' is missing in type '{ 1.0: string; baz?: string; }'.
b = a; // error
~
!!! error TS2322: Type '{ '1.': string; bar?: string; }' is not assignable to type '{ 1.0: string; baz?: string; }':
!!! error TS2322: Property '1.0' is missing in type '{ '1.': string; bar?: string; }'.
!!! error TS2323: Type '{ '1.': string; bar?: string; }' is not assignable to type '{ 1.0: string; baz?: string; }'.
!!! error TS2323: Property '1.0' is missing in type '{ '1.': string; bar?: string; }'.
a = s; // error
~
!!! error TS2322: Type 'S' is not assignable to type '{ '1.': string; bar?: string; }':
!!! error TS2322: Property ''1.'' is missing in type 'S'.
!!! error TS2323: Type 'S' is not assignable to type '{ '1.': string; bar?: string; }'.
!!! error TS2323: Property ''1.'' is missing in type 'S'.
a = s2; // error
~
!!! error TS2322: Type 'S2' is not assignable to type '{ '1.': string; bar?: string; }':
!!! error TS2322: Property ''1.'' is missing in type 'S2'.
!!! error TS2323: Type 'S2' is not assignable to type '{ '1.': string; bar?: string; }'.
!!! error TS2323: Property ''1.'' is missing in type 'S2'.
a = a2; // error
~
!!! error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ '1.': string; bar?: string; }':
!!! error TS2322: Property ''1.'' is missing in type '{ '1.0': string; }'.
!!! error TS2323: Type '{ '1.0': string; }' is not assignable to type '{ '1.': string; bar?: string; }'.
!!! error TS2323: Property ''1.'' is missing in type '{ '1.0': string; }'.
a = b2; // error
~
!!! error TS2322: Type '{ 1.: string; }' is not assignable to type '{ '1.': string; bar?: string; }':
!!! error TS2322: Property ''1.'' is missing in type '{ 1.: string; }'.
!!! error TS2323: Type '{ 1.: string; }' is not assignable to type '{ '1.': string; bar?: string; }'.
!!! error TS2323: Property ''1.'' is missing in type '{ 1.: string; }'.
a2 = b2; // error
~~
!!! error TS2322: Type '{ 1.: string; }' is not assignable to type '{ '1.0': string; }':
!!! error TS2322: Property ''1.0'' is missing in type '{ 1.: string; }'.
!!! error TS2323: Type '{ 1.: string; }' is not assignable to type '{ '1.0': string; }'.
!!! error TS2323: Property ''1.0'' is missing in type '{ 1.: string; }'.
b2 = a2; // error
~~
!!! error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ 1.: string; }':
!!! error TS2322: Property '1.' is missing in type '{ '1.0': string; }'.
!!! error TS2323: Type '{ '1.0': string; }' is not assignable to type '{ 1.: string; }'.
!!! error TS2323: Property '1.' is missing in type '{ '1.0': string; }'.
a2 = b; // error
~~
!!! error TS2322: Type '{ 1.0: string; baz?: string; }' is not assignable to type '{ '1.0': string; }':
!!! error TS2322: Property ''1.0'' is missing in type '{ 1.0: string; baz?: string; }'.
!!! error TS2323: Type '{ 1.0: string; baz?: string; }' is not assignable to type '{ '1.0': string; }'.
!!! error TS2323: Property ''1.0'' is missing in type '{ 1.0: string; baz?: string; }'.
a2 = t2; // error
~~
!!! error TS2322: Type 'T2' is not assignable to type '{ '1.0': string; }':
!!! error TS2322: Property ''1.0'' is missing in type 'T2'.
!!! error TS2323: Type 'T2' is not assignable to type '{ '1.0': string; }'.
!!! error TS2323: Property ''1.0'' is missing in type 'T2'.
a2 = t; // error
~~
!!! error TS2322: Type 'T' is not assignable to type '{ '1.0': string; }':
!!! error TS2322: Property ''1.0'' is missing in type 'T'.
!!! error TS2323: Type 'T' is not assignable to type '{ '1.0': string; }'.
!!! error TS2323: Property ''1.0'' is missing in type 'T'.
}

View File

@ -1,12 +1,12 @@
tests/cases/compiler/assignmentCompatWithOverloads.ts(17,1): error TS2322: Type '(x: string) => string' is not assignable to type '(s1: string) => number':
tests/cases/compiler/assignmentCompatWithOverloads.ts(17,1): error TS2323: Type '(x: string) => string' is not assignable to type '(s1: string) => number'.
Type 'string' is not assignable to type 'number'.
tests/cases/compiler/assignmentCompatWithOverloads.ts(19,1): error TS2322: Type '(x: number) => number' is not assignable to type '(s1: string) => number':
Types of parameters 'x' and 's1' are incompatible:
tests/cases/compiler/assignmentCompatWithOverloads.ts(19,1): error TS2323: Type '(x: number) => number' is not assignable to type '(s1: string) => number'.
Types of parameters 'x' and 's1' are incompatible.
Type 'number' is not assignable to type 'string'.
tests/cases/compiler/assignmentCompatWithOverloads.ts(21,1): error TS2322: Type '{ (x: string): string; (x: number): number; }' is not assignable to type '(s1: string) => number':
tests/cases/compiler/assignmentCompatWithOverloads.ts(21,1): error TS2323: Type '{ (x: string): string; (x: number): number; }' is not assignable to type '(s1: string) => number'.
Type 'string' is not assignable to type 'number'.
tests/cases/compiler/assignmentCompatWithOverloads.ts(30,1): error TS2322: Type 'typeof C' is not assignable to type 'new (x: number) => void':
Types of parameters 'x' and 'x' are incompatible:
tests/cases/compiler/assignmentCompatWithOverloads.ts(30,1): error TS2323: Type 'typeof C' is not assignable to type 'new (x: number) => void'.
Types of parameters 'x' and 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
@ -29,19 +29,19 @@ tests/cases/compiler/assignmentCompatWithOverloads.ts(30,1): error TS2322: Type
g = f2; // Error
~
!!! error TS2322: Type '(x: string) => string' is not assignable to type '(s1: string) => number':
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2323: Type '(x: string) => string' is not assignable to type '(s1: string) => number'.
!!! error TS2323: Type 'string' is not assignable to type 'number'.
g = f3; // Error
~
!!! error TS2322: Type '(x: number) => number' is not assignable to type '(s1: string) => number':
!!! error TS2322: Types of parameters 'x' and 's1' are incompatible:
!!! error TS2322: Type 'number' is not assignable to type 'string'.
!!! error TS2323: Type '(x: number) => number' is not assignable to type '(s1: string) => number'.
!!! error TS2323: Types of parameters 'x' and 's1' are incompatible.
!!! error TS2323: Type 'number' is not assignable to type 'string'.
g = f4; // Error
~
!!! error TS2322: Type '{ (x: string): string; (x: number): number; }' is not assignable to type '(s1: string) => number':
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2323: Type '{ (x: string): string; (x: number): number; }' is not assignable to type '(s1: string) => number'.
!!! error TS2323: Type 'string' is not assignable to type 'number'.
class C {
constructor(x: string);
@ -52,6 +52,6 @@ tests/cases/compiler/assignmentCompatWithOverloads.ts(30,1): error TS2322: Type
d = C; // Error
~
!!! error TS2322: Type 'typeof C' is not assignable to type 'new (x: number) => void':
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible:
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2323: Type 'typeof C' is not assignable to type 'new (x: number) => void'.
!!! error TS2323: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2323: Type 'string' is not assignable to type 'number'.

View File

@ -1,32 +1,32 @@
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(15,1): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }':
Index signatures are incompatible:
Type 'Base' is not assignable to type 'Derived':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(15,1): error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived; }'.
Index signatures are incompatible.
Type 'Base' is not assignable to type 'Derived'.
Property 'bar' is missing in type 'Base'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(19,1): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }':
Index signatures are incompatible:
Type 'Base' is not assignable to type 'Derived2':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(19,1): error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'.
Index signatures are incompatible.
Type 'Base' is not assignable to type 'Derived2'.
Property 'baz' is missing in type 'Base'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(33,5): error TS2322: Type 'A<Base>' is not assignable to type '{ [x: string]: Derived; }':
Index signatures are incompatible:
Type 'Base' is not assignable to type 'Derived':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(33,5): error TS2323: Type 'A<Base>' is not assignable to type '{ [x: string]: Derived; }'.
Index signatures are incompatible.
Type 'Base' is not assignable to type 'Derived'.
Property 'bar' is missing in type 'Base'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(41,5): error TS2322: Type 'A<Base>' is not assignable to type '{ [x: string]: Derived2; }':
Index signatures are incompatible:
Type 'Base' is not assignable to type 'Derived2':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(41,5): error TS2323: Type 'A<Base>' is not assignable to type '{ [x: string]: Derived2; }'.
Index signatures are incompatible.
Type 'Base' is not assignable to type 'Derived2'.
Property 'baz' is missing in type 'Base'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(46,9): error TS2322: Type '{ [x: string]: Derived; }' is not assignable to type 'A<T>':
Index signatures are incompatible:
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(46,9): error TS2323: Type '{ [x: string]: Derived; }' is not assignable to type 'A<T>'.
Index signatures are incompatible.
Type 'Derived' is not assignable to type 'T'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(47,9): error TS2322: Type 'A<T>' is not assignable to type '{ [x: string]: Derived; }':
Index signatures are incompatible:
Type 'T' is not assignable to type 'Derived':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(47,9): error TS2323: Type 'A<T>' is not assignable to type '{ [x: string]: Derived; }'.
Index signatures are incompatible.
Type 'T' is not assignable to type 'Derived'.
Property 'bar' is missing in type 'Base'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(50,9): error TS2322: Type '{ [x: string]: Derived2; }' is not assignable to type 'A<T>':
Index signatures are incompatible:
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(50,9): error TS2323: Type '{ [x: string]: Derived2; }' is not assignable to type 'A<T>'.
Index signatures are incompatible.
Type 'Derived2' is not assignable to type 'T'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(51,9): error TS2322: Type 'A<T>' is not assignable to type '{ [x: string]: Derived2; }':
Index signatures are incompatible:
Type 'T' is not assignable to type 'Derived2':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(51,9): error TS2323: Type 'A<T>' is not assignable to type '{ [x: string]: Derived2; }'.
Index signatures are incompatible.
Type 'T' is not assignable to type 'Derived2'.
Property 'baz' is missing in type 'Base'.
@ -47,19 +47,19 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
a = b; // ok
b = a; // error
~
!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }':
!!! error TS2322: Index signatures are incompatible:
!!! error TS2322: Type 'Base' is not assignable to type 'Derived':
!!! error TS2322: Property 'bar' is missing in type 'Base'.
!!! error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived; }'.
!!! error TS2323: Index signatures are incompatible.
!!! error TS2323: Type 'Base' is not assignable to type 'Derived'.
!!! error TS2323: Property 'bar' is missing in type 'Base'.
var b2: { [x: string]: Derived2; }
a = b2; // ok
b2 = a; // error
~~
!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }':
!!! error TS2322: Index signatures are incompatible:
!!! error TS2322: Type 'Base' is not assignable to type 'Derived2':
!!! error TS2322: Property 'baz' is missing in type 'Base'.
!!! error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'.
!!! error TS2323: Index signatures are incompatible.
!!! error TS2323: Type 'Base' is not assignable to type 'Derived2'.
!!! error TS2323: Property 'baz' is missing in type 'Base'.
module Generics {
class A<T extends Base> {
@ -75,10 +75,10 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
a1 = b1; // ok
b1 = a1; // error
~~
!!! error TS2322: Type 'A<Base>' is not assignable to type '{ [x: string]: Derived; }':
!!! error TS2322: Index signatures are incompatible:
!!! error TS2322: Type 'Base' is not assignable to type 'Derived':
!!! error TS2322: Property 'bar' is missing in type 'Base'.
!!! error TS2323: Type 'A<Base>' is not assignable to type '{ [x: string]: Derived; }'.
!!! error TS2323: Index signatures are incompatible.
!!! error TS2323: Type 'Base' is not assignable to type 'Derived'.
!!! error TS2323: Property 'bar' is missing in type 'Base'.
class B2 extends A<Base> {
[x: string]: Derived2; // ok
@ -88,37 +88,37 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
a1 = b2; // ok
b2 = a1; // error
~~
!!! error TS2322: Type 'A<Base>' is not assignable to type '{ [x: string]: Derived2; }':
!!! error TS2322: Index signatures are incompatible:
!!! error TS2322: Type 'Base' is not assignable to type 'Derived2':
!!! error TS2322: Property 'baz' is missing in type 'Base'.
!!! error TS2323: Type 'A<Base>' is not assignable to type '{ [x: string]: Derived2; }'.
!!! error TS2323: Index signatures are incompatible.
!!! error TS2323: Type 'Base' is not assignable to type 'Derived2'.
!!! error TS2323: Property 'baz' is missing in type 'Base'.
function foo<T extends Base>() {
var b3: { [x: string]: Derived; };
var a3: A<T>;
a3 = b3; // error
~~
!!! error TS2322: Type '{ [x: string]: Derived; }' is not assignable to type 'A<T>':
!!! error TS2322: Index signatures are incompatible:
!!! error TS2322: Type 'Derived' is not assignable to type 'T'.
!!! error TS2323: Type '{ [x: string]: Derived; }' is not assignable to type 'A<T>'.
!!! error TS2323: Index signatures are incompatible.
!!! error TS2323: Type 'Derived' is not assignable to type 'T'.
b3 = a3; // error
~~
!!! error TS2322: Type 'A<T>' is not assignable to type '{ [x: string]: Derived; }':
!!! error TS2322: Index signatures are incompatible:
!!! error TS2322: Type 'T' is not assignable to type 'Derived':
!!! error TS2322: Property 'bar' is missing in type 'Base'.
!!! error TS2323: Type 'A<T>' is not assignable to type '{ [x: string]: Derived; }'.
!!! error TS2323: Index signatures are incompatible.
!!! error TS2323: Type 'T' is not assignable to type 'Derived'.
!!! error TS2323: Property 'bar' is missing in type 'Base'.
var b4: { [x: string]: Derived2; };
a3 = b4; // error
~~
!!! error TS2322: Type '{ [x: string]: Derived2; }' is not assignable to type 'A<T>':
!!! error TS2322: Index signatures are incompatible:
!!! error TS2322: Type 'Derived2' is not assignable to type 'T'.
!!! error TS2323: Type '{ [x: string]: Derived2; }' is not assignable to type 'A<T>'.
!!! error TS2323: Index signatures are incompatible.
!!! error TS2323: Type 'Derived2' is not assignable to type 'T'.
b4 = a3; // error
~~
!!! error TS2322: Type 'A<T>' is not assignable to type '{ [x: string]: Derived2; }':
!!! error TS2322: Index signatures are incompatible:
!!! error TS2322: Type 'T' is not assignable to type 'Derived2':
!!! error TS2322: Property 'baz' is missing in type 'Base'.
!!! error TS2323: Type 'A<T>' is not assignable to type '{ [x: string]: Derived2; }'.
!!! error TS2323: Index signatures are incompatible.
!!! error TS2323: Type 'T' is not assignable to type 'Derived2'.
!!! error TS2323: Property 'baz' is missing in type 'Base'.
}
}

View File

@ -1,32 +1,32 @@
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(15,1): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }':
Index signatures are incompatible:
Type 'Base' is not assignable to type 'Derived':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(15,1): error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived; }'.
Index signatures are incompatible.
Type 'Base' is not assignable to type 'Derived'.
Property 'bar' is missing in type 'Base'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(19,1): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }':
Index signatures are incompatible:
Type 'Base' is not assignable to type 'Derived2':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(19,1): error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'.
Index signatures are incompatible.
Type 'Base' is not assignable to type 'Derived2'.
Property 'baz' is missing in type 'Base'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(33,5): error TS2322: Type 'A<Base>' is not assignable to type '{ [x: string]: Derived; }':
Index signatures are incompatible:
Type 'Base' is not assignable to type 'Derived':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(33,5): error TS2323: Type 'A<Base>' is not assignable to type '{ [x: string]: Derived; }'.
Index signatures are incompatible.
Type 'Base' is not assignable to type 'Derived'.
Property 'bar' is missing in type 'Base'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(41,5): error TS2322: Type 'A<Base>' is not assignable to type '{ [x: string]: Derived2; }':
Index signatures are incompatible:
Type 'Base' is not assignable to type 'Derived2':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(41,5): error TS2323: Type 'A<Base>' is not assignable to type '{ [x: string]: Derived2; }'.
Index signatures are incompatible.
Type 'Base' is not assignable to type 'Derived2'.
Property 'baz' is missing in type 'Base'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(46,9): error TS2322: Type '{ [x: string]: Derived; }' is not assignable to type 'A<T>':
Index signatures are incompatible:
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(46,9): error TS2323: Type '{ [x: string]: Derived; }' is not assignable to type 'A<T>'.
Index signatures are incompatible.
Type 'Derived' is not assignable to type 'T'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(47,9): error TS2322: Type 'A<T>' is not assignable to type '{ [x: string]: Derived; }':
Index signatures are incompatible:
Type 'T' is not assignable to type 'Derived':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(47,9): error TS2323: Type 'A<T>' is not assignable to type '{ [x: string]: Derived; }'.
Index signatures are incompatible.
Type 'T' is not assignable to type 'Derived'.
Property 'bar' is missing in type 'Base'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(50,9): error TS2322: Type '{ [x: string]: Derived2; }' is not assignable to type 'A<T>':
Index signatures are incompatible:
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(50,9): error TS2323: Type '{ [x: string]: Derived2; }' is not assignable to type 'A<T>'.
Index signatures are incompatible.
Type 'Derived2' is not assignable to type 'T'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(51,9): error TS2322: Type 'A<T>' is not assignable to type '{ [x: string]: Derived2; }':
Index signatures are incompatible:
Type 'T' is not assignable to type 'Derived2':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(51,9): error TS2323: Type 'A<T>' is not assignable to type '{ [x: string]: Derived2; }'.
Index signatures are incompatible.
Type 'T' is not assignable to type 'Derived2'.
Property 'baz' is missing in type 'Base'.
@ -47,19 +47,19 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
a = b; // ok
b = a; // error
~
!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }':
!!! error TS2322: Index signatures are incompatible:
!!! error TS2322: Type 'Base' is not assignable to type 'Derived':
!!! error TS2322: Property 'bar' is missing in type 'Base'.
!!! error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived; }'.
!!! error TS2323: Index signatures are incompatible.
!!! error TS2323: Type 'Base' is not assignable to type 'Derived'.
!!! error TS2323: Property 'bar' is missing in type 'Base'.
var b2: { [x: string]: Derived2; }
a = b2; // ok
b2 = a; // error
~~
!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }':
!!! error TS2322: Index signatures are incompatible:
!!! error TS2322: Type 'Base' is not assignable to type 'Derived2':
!!! error TS2322: Property 'baz' is missing in type 'Base'.
!!! error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'.
!!! error TS2323: Index signatures are incompatible.
!!! error TS2323: Type 'Base' is not assignable to type 'Derived2'.
!!! error TS2323: Property 'baz' is missing in type 'Base'.
module Generics {
interface A<T extends Base> {
@ -75,10 +75,10 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
a1 = b1; // ok
b1 = a1; // error
~~
!!! error TS2322: Type 'A<Base>' is not assignable to type '{ [x: string]: Derived; }':
!!! error TS2322: Index signatures are incompatible:
!!! error TS2322: Type 'Base' is not assignable to type 'Derived':
!!! error TS2322: Property 'bar' is missing in type 'Base'.
!!! error TS2323: Type 'A<Base>' is not assignable to type '{ [x: string]: Derived; }'.
!!! error TS2323: Index signatures are incompatible.
!!! error TS2323: Type 'Base' is not assignable to type 'Derived'.
!!! error TS2323: Property 'bar' is missing in type 'Base'.
interface B2 extends A<Base> {
[x: string]: Derived2; // ok
@ -88,37 +88,37 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
a1 = b2; // ok
b2 = a1; // error
~~
!!! error TS2322: Type 'A<Base>' is not assignable to type '{ [x: string]: Derived2; }':
!!! error TS2322: Index signatures are incompatible:
!!! error TS2322: Type 'Base' is not assignable to type 'Derived2':
!!! error TS2322: Property 'baz' is missing in type 'Base'.
!!! error TS2323: Type 'A<Base>' is not assignable to type '{ [x: string]: Derived2; }'.
!!! error TS2323: Index signatures are incompatible.
!!! error TS2323: Type 'Base' is not assignable to type 'Derived2'.
!!! error TS2323: Property 'baz' is missing in type 'Base'.
function foo<T extends Base>() {
var b3: { [x: string]: Derived; };
var a3: A<T>;
a3 = b3; // error
~~
!!! error TS2322: Type '{ [x: string]: Derived; }' is not assignable to type 'A<T>':
!!! error TS2322: Index signatures are incompatible:
!!! error TS2322: Type 'Derived' is not assignable to type 'T'.
!!! error TS2323: Type '{ [x: string]: Derived; }' is not assignable to type 'A<T>'.
!!! error TS2323: Index signatures are incompatible.
!!! error TS2323: Type 'Derived' is not assignable to type 'T'.
b3 = a3; // error
~~
!!! error TS2322: Type 'A<T>' is not assignable to type '{ [x: string]: Derived; }':
!!! error TS2322: Index signatures are incompatible:
!!! error TS2322: Type 'T' is not assignable to type 'Derived':
!!! error TS2322: Property 'bar' is missing in type 'Base'.
!!! error TS2323: Type 'A<T>' is not assignable to type '{ [x: string]: Derived; }'.
!!! error TS2323: Index signatures are incompatible.
!!! error TS2323: Type 'T' is not assignable to type 'Derived'.
!!! error TS2323: Property 'bar' is missing in type 'Base'.
var b4: { [x: string]: Derived2; };
a3 = b4; // error
~~
!!! error TS2322: Type '{ [x: string]: Derived2; }' is not assignable to type 'A<T>':
!!! error TS2322: Index signatures are incompatible:
!!! error TS2322: Type 'Derived2' is not assignable to type 'T'.
!!! error TS2323: Type '{ [x: string]: Derived2; }' is not assignable to type 'A<T>'.
!!! error TS2323: Index signatures are incompatible.
!!! error TS2323: Type 'Derived2' is not assignable to type 'T'.
b4 = a3; // error
~~
!!! error TS2322: Type 'A<T>' is not assignable to type '{ [x: string]: Derived2; }':
!!! error TS2322: Index signatures are incompatible:
!!! error TS2322: Type 'T' is not assignable to type 'Derived2':
!!! error TS2322: Property 'baz' is missing in type 'Base'.
!!! error TS2323: Type 'A<T>' is not assignable to type '{ [x: string]: Derived2; }'.
!!! error TS2323: Index signatures are incompatible.
!!! error TS2323: Type 'T' is not assignable to type 'Derived2'.
!!! error TS2323: Property 'baz' is missing in type 'Base'.
}
}

View File

@ -1,9 +1,9 @@
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer3.ts(7,8): error TS2304: Cannot find name 'A'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer3.ts(20,9): error TS2322: Type '{ [x: string]: string; }' is not assignable to type 'A<T>':
Index signatures are incompatible:
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer3.ts(20,9): error TS2323: Type '{ [x: string]: string; }' is not assignable to type 'A<T>'.
Index signatures are incompatible.
Type 'string' is not assignable to type 'T'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer3.ts(21,9): error TS2322: Type 'A<T>' is not assignable to type '{ [x: string]: string; }':
Index signatures are incompatible:
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer3.ts(21,9): error TS2323: Type 'A<T>' is not assignable to type '{ [x: string]: string; }'.
Index signatures are incompatible.
Type 'T' is not assignable to type 'string'.
@ -31,13 +31,13 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
var b: { [x: string]: string; }
a = b; // error
~
!!! error TS2322: Type '{ [x: string]: string; }' is not assignable to type 'A<T>':
!!! error TS2322: Index signatures are incompatible:
!!! error TS2322: Type 'string' is not assignable to type 'T'.
!!! error TS2323: Type '{ [x: string]: string; }' is not assignable to type 'A<T>'.
!!! error TS2323: Index signatures are incompatible.
!!! error TS2323: Type 'string' is not assignable to type 'T'.
b = a; // error
~
!!! error TS2322: Type 'A<T>' is not assignable to type '{ [x: string]: string; }':
!!! error TS2322: Index signatures are incompatible:
!!! error TS2322: Type 'T' is not assignable to type 'string'.
!!! error TS2323: Type 'A<T>' is not assignable to type '{ [x: string]: string; }'.
!!! error TS2323: Index signatures are incompatible.
!!! error TS2323: Type 'T' is not assignable to type 'string'.
}
}

View File

@ -1,4 +1,4 @@
tests/cases/compiler/assignmentCompatability10.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type 'classWithPublicAndOptional<number, string>':
tests/cases/compiler/assignmentCompatability10.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type 'classWithPublicAndOptional<number, string>'.
Property 'two' is optional in type 'interfaceWithPublicAndOptional<number, string>' but required in type 'classWithPublicAndOptional<number, string>'.
@ -13,5 +13,5 @@ tests/cases/compiler/assignmentCompatability10.ts(9,1): error TS2322: Type 'inte
}
__test2__.__val__x4 = __test1__.__val__obj4
~~~~~~~~~~~~~~~~~~~
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type 'classWithPublicAndOptional<number, string>':
!!! error TS2322: Property 'two' is optional in type 'interfaceWithPublicAndOptional<number, string>' but required in type 'classWithPublicAndOptional<number, string>'.
!!! error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type 'classWithPublicAndOptional<number, string>'.
!!! error TS2323: Property 'two' is optional in type 'interfaceWithPublicAndOptional<number, string>' but required in type 'classWithPublicAndOptional<number, string>'.

View File

@ -1,5 +1,5 @@
tests/cases/compiler/assignmentCompatability11.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ two: number; }':
Types of property 'two' are incompatible:
tests/cases/compiler/assignmentCompatability11.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ two: number; }'.
Types of property 'two' are incompatible.
Type 'string' is not assignable to type 'number'.
@ -14,6 +14,6 @@ tests/cases/compiler/assignmentCompatability11.ts(9,1): error TS2322: Type 'inte
}
__test2__.__val__obj = __test1__.__val__obj4
~~~~~~~~~~~~~~~~~~~~
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ two: number; }':
!!! error TS2322: Types of property 'two' are incompatible:
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ two: number; }'.
!!! error TS2323: Types of property 'two' are incompatible.
!!! error TS2323: Type 'string' is not assignable to type 'number'.

View File

@ -1,5 +1,5 @@
tests/cases/compiler/assignmentCompatability12.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: string; }':
Types of property 'one' are incompatible:
tests/cases/compiler/assignmentCompatability12.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: string; }'.
Types of property 'one' are incompatible.
Type 'number' is not assignable to type 'string'.
@ -14,6 +14,6 @@ tests/cases/compiler/assignmentCompatability12.ts(9,1): error TS2322: Type 'inte
}
__test2__.__val__obj = __test1__.__val__obj4
~~~~~~~~~~~~~~~~~~~~
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: string; }':
!!! error TS2322: Types of property 'one' are incompatible:
!!! error TS2322: Type 'number' is not assignable to type 'string'.
!!! error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: string; }'.
!!! error TS2323: Types of property 'one' are incompatible.
!!! error TS2323: Type 'number' is not assignable to type 'string'.

View File

@ -1,4 +1,4 @@
tests/cases/compiler/assignmentCompatability13.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ two: string; }':
tests/cases/compiler/assignmentCompatability13.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ two: string; }'.
Property 'two' is optional in type 'interfaceWithPublicAndOptional<number, string>' but required in type '{ two: string; }'.
@ -13,5 +13,5 @@ tests/cases/compiler/assignmentCompatability13.ts(9,1): error TS2322: Type 'inte
}
__test2__.__val__obj = __test1__.__val__obj4
~~~~~~~~~~~~~~~~~~~~
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ two: string; }':
!!! error TS2322: Property 'two' is optional in type 'interfaceWithPublicAndOptional<number, string>' but required in type '{ two: string; }'.
!!! error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ two: string; }'.
!!! error TS2323: Property 'two' is optional in type 'interfaceWithPublicAndOptional<number, string>' but required in type '{ two: string; }'.

View File

@ -1,5 +1,5 @@
tests/cases/compiler/assignmentCompatability14.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: boolean; }':
Types of property 'one' are incompatible:
tests/cases/compiler/assignmentCompatability14.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: boolean; }'.
Types of property 'one' are incompatible.
Type 'number' is not assignable to type 'boolean'.
@ -14,6 +14,6 @@ tests/cases/compiler/assignmentCompatability14.ts(9,1): error TS2322: Type 'inte
}
__test2__.__val__obj = __test1__.__val__obj4
~~~~~~~~~~~~~~~~~~~~
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: boolean; }':
!!! error TS2322: Types of property 'one' are incompatible:
!!! error TS2322: Type 'number' is not assignable to type 'boolean'.
!!! error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: boolean; }'.
!!! error TS2323: Types of property 'one' are incompatible.
!!! error TS2323: Type 'number' is not assignable to type 'boolean'.

View File

@ -1,5 +1,5 @@
tests/cases/compiler/assignmentCompatability15.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ two: boolean; }':
Types of property 'two' are incompatible:
tests/cases/compiler/assignmentCompatability15.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ two: boolean; }'.
Types of property 'two' are incompatible.
Type 'string' is not assignable to type 'boolean'.
@ -14,6 +14,6 @@ tests/cases/compiler/assignmentCompatability15.ts(9,1): error TS2322: Type 'inte
}
__test2__.__val__obj = __test1__.__val__obj4
~~~~~~~~~~~~~~~~~~~~
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ two: boolean; }':
!!! error TS2322: Types of property 'two' are incompatible:
!!! error TS2322: Type 'string' is not assignable to type 'boolean'.
!!! error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ two: boolean; }'.
!!! error TS2323: Types of property 'two' are incompatible.
!!! error TS2323: Type 'string' is not assignable to type 'boolean'.

View File

@ -1,6 +1,6 @@
tests/cases/compiler/assignmentCompatability16.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: any[]; }':
Types of property 'one' are incompatible:
Type 'number' is not assignable to type 'any[]':
tests/cases/compiler/assignmentCompatability16.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: any[]; }'.
Types of property 'one' are incompatible.
Type 'number' is not assignable to type 'any[]'.
Property 'length' is missing in type 'Number'.
@ -15,7 +15,7 @@ tests/cases/compiler/assignmentCompatability16.ts(9,1): error TS2322: Type 'inte
}
__test2__.__val__obj = __test1__.__val__obj4
~~~~~~~~~~~~~~~~~~~~
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: any[]; }':
!!! error TS2322: Types of property 'one' are incompatible:
!!! error TS2322: Type 'number' is not assignable to type 'any[]':
!!! error TS2322: Property 'length' is missing in type 'Number'.
!!! error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: any[]; }'.
!!! error TS2323: Types of property 'one' are incompatible.
!!! error TS2323: Type 'number' is not assignable to type 'any[]'.
!!! error TS2323: Property 'length' is missing in type 'Number'.

View File

@ -1,6 +1,6 @@
tests/cases/compiler/assignmentCompatability17.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ two: any[]; }':
Types of property 'two' are incompatible:
Type 'string' is not assignable to type 'any[]':
tests/cases/compiler/assignmentCompatability17.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ two: any[]; }'.
Types of property 'two' are incompatible.
Type 'string' is not assignable to type 'any[]'.
Property 'push' is missing in type 'String'.
@ -15,7 +15,7 @@ tests/cases/compiler/assignmentCompatability17.ts(9,1): error TS2322: Type 'inte
}
__test2__.__val__obj = __test1__.__val__obj4
~~~~~~~~~~~~~~~~~~~~
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ two: any[]; }':
!!! error TS2322: Types of property 'two' are incompatible:
!!! error TS2322: Type 'string' is not assignable to type 'any[]':
!!! error TS2322: Property 'push' is missing in type 'String'.
!!! error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ two: any[]; }'.
!!! error TS2323: Types of property 'two' are incompatible.
!!! error TS2323: Type 'string' is not assignable to type 'any[]'.
!!! error TS2323: Property 'push' is missing in type 'String'.

View File

@ -1,6 +1,6 @@
tests/cases/compiler/assignmentCompatability18.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: number[]; }':
Types of property 'one' are incompatible:
Type 'number' is not assignable to type 'number[]':
tests/cases/compiler/assignmentCompatability18.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: number[]; }'.
Types of property 'one' are incompatible.
Type 'number' is not assignable to type 'number[]'.
Property 'length' is missing in type 'Number'.
@ -15,7 +15,7 @@ tests/cases/compiler/assignmentCompatability18.ts(9,1): error TS2322: Type 'inte
}
__test2__.__val__obj = __test1__.__val__obj4
~~~~~~~~~~~~~~~~~~~~
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: number[]; }':
!!! error TS2322: Types of property 'one' are incompatible:
!!! error TS2322: Type 'number' is not assignable to type 'number[]':
!!! error TS2322: Property 'length' is missing in type 'Number'.
!!! error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: number[]; }'.
!!! error TS2323: Types of property 'one' are incompatible.
!!! error TS2323: Type 'number' is not assignable to type 'number[]'.
!!! error TS2323: Property 'length' is missing in type 'Number'.

View File

@ -1,6 +1,6 @@
tests/cases/compiler/assignmentCompatability19.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ two: number[]; }':
Types of property 'two' are incompatible:
Type 'string' is not assignable to type 'number[]':
tests/cases/compiler/assignmentCompatability19.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ two: number[]; }'.
Types of property 'two' are incompatible.
Type 'string' is not assignable to type 'number[]'.
Property 'push' is missing in type 'String'.
@ -15,7 +15,7 @@ tests/cases/compiler/assignmentCompatability19.ts(9,1): error TS2322: Type 'inte
}
__test2__.__val__obj = __test1__.__val__obj4
~~~~~~~~~~~~~~~~~~~~
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ two: number[]; }':
!!! error TS2322: Types of property 'two' are incompatible:
!!! error TS2322: Type 'string' is not assignable to type 'number[]':
!!! error TS2322: Property 'push' is missing in type 'String'.
!!! error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ two: number[]; }'.
!!! error TS2323: Types of property 'two' are incompatible.
!!! error TS2323: Type 'string' is not assignable to type 'number[]'.
!!! error TS2323: Property 'push' is missing in type 'String'.

View File

@ -1,6 +1,6 @@
tests/cases/compiler/assignmentCompatability20.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: string[]; }':
Types of property 'one' are incompatible:
Type 'number' is not assignable to type 'string[]':
tests/cases/compiler/assignmentCompatability20.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: string[]; }'.
Types of property 'one' are incompatible.
Type 'number' is not assignable to type 'string[]'.
Property 'length' is missing in type 'Number'.
@ -15,7 +15,7 @@ tests/cases/compiler/assignmentCompatability20.ts(9,1): error TS2322: Type 'inte
}
__test2__.__val__obj = __test1__.__val__obj4
~~~~~~~~~~~~~~~~~~~~
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: string[]; }':
!!! error TS2322: Types of property 'one' are incompatible:
!!! error TS2322: Type 'number' is not assignable to type 'string[]':
!!! error TS2322: Property 'length' is missing in type 'Number'.
!!! error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: string[]; }'.
!!! error TS2323: Types of property 'one' are incompatible.
!!! error TS2323: Type 'number' is not assignable to type 'string[]'.
!!! error TS2323: Property 'length' is missing in type 'Number'.

View File

@ -1,6 +1,6 @@
tests/cases/compiler/assignmentCompatability21.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ two: string[]; }':
Types of property 'two' are incompatible:
Type 'string' is not assignable to type 'string[]':
tests/cases/compiler/assignmentCompatability21.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ two: string[]; }'.
Types of property 'two' are incompatible.
Type 'string' is not assignable to type 'string[]'.
Property 'push' is missing in type 'String'.
@ -15,7 +15,7 @@ tests/cases/compiler/assignmentCompatability21.ts(9,1): error TS2322: Type 'inte
}
__test2__.__val__obj = __test1__.__val__obj4
~~~~~~~~~~~~~~~~~~~~
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ two: string[]; }':
!!! error TS2322: Types of property 'two' are incompatible:
!!! error TS2322: Type 'string' is not assignable to type 'string[]':
!!! error TS2322: Property 'push' is missing in type 'String'.
!!! error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ two: string[]; }'.
!!! error TS2323: Types of property 'two' are incompatible.
!!! error TS2323: Type 'string' is not assignable to type 'string[]'.
!!! error TS2323: Property 'push' is missing in type 'String'.

View File

@ -1,6 +1,6 @@
tests/cases/compiler/assignmentCompatability22.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: boolean[]; }':
Types of property 'one' are incompatible:
Type 'number' is not assignable to type 'boolean[]':
tests/cases/compiler/assignmentCompatability22.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: boolean[]; }'.
Types of property 'one' are incompatible.
Type 'number' is not assignable to type 'boolean[]'.
Property 'length' is missing in type 'Number'.
@ -15,7 +15,7 @@ tests/cases/compiler/assignmentCompatability22.ts(9,1): error TS2322: Type 'inte
}
__test2__.__val__obj = __test1__.__val__obj4
~~~~~~~~~~~~~~~~~~~~
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: boolean[]; }':
!!! error TS2322: Types of property 'one' are incompatible:
!!! error TS2322: Type 'number' is not assignable to type 'boolean[]':
!!! error TS2322: Property 'length' is missing in type 'Number'.
!!! error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: boolean[]; }'.
!!! error TS2323: Types of property 'one' are incompatible.
!!! error TS2323: Type 'number' is not assignable to type 'boolean[]'.
!!! error TS2323: Property 'length' is missing in type 'Number'.

View File

@ -1,6 +1,6 @@
tests/cases/compiler/assignmentCompatability23.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ two: boolean[]; }':
Types of property 'two' are incompatible:
Type 'string' is not assignable to type 'boolean[]':
tests/cases/compiler/assignmentCompatability23.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ two: boolean[]; }'.
Types of property 'two' are incompatible.
Type 'string' is not assignable to type 'boolean[]'.
Property 'push' is missing in type 'String'.
@ -15,7 +15,7 @@ tests/cases/compiler/assignmentCompatability23.ts(9,1): error TS2322: Type 'inte
}
__test2__.__val__obj = __test1__.__val__obj4
~~~~~~~~~~~~~~~~~~~~
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ two: boolean[]; }':
!!! error TS2322: Types of property 'two' are incompatible:
!!! error TS2322: Type 'string' is not assignable to type 'boolean[]':
!!! error TS2322: Property 'push' is missing in type 'String'.
!!! error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ two: boolean[]; }'.
!!! error TS2323: Types of property 'two' are incompatible.
!!! error TS2323: Type 'string' is not assignable to type 'boolean[]'.
!!! error TS2323: Property 'push' is missing in type 'String'.

View File

@ -1,5 +1,5 @@
tests/cases/compiler/assignmentCompatability25.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ two: number; }':
Types of property 'two' are incompatible:
tests/cases/compiler/assignmentCompatability25.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ two: number; }'.
Types of property 'two' are incompatible.
Type 'string' is not assignable to type 'number'.
@ -14,6 +14,6 @@ tests/cases/compiler/assignmentCompatability25.ts(9,1): error TS2322: Type 'inte
}
__test2__.__val__aa = __test1__.__val__obj4
~~~~~~~~~~~~~~~~~~~
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ two: number; }':
!!! error TS2322: Types of property 'two' are incompatible:
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ two: number; }'.
!!! error TS2323: Types of property 'two' are incompatible.
!!! error TS2323: Type 'string' is not assignable to type 'number'.

View File

@ -1,5 +1,5 @@
tests/cases/compiler/assignmentCompatability26.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: string; }':
Types of property 'one' are incompatible:
tests/cases/compiler/assignmentCompatability26.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: string; }'.
Types of property 'one' are incompatible.
Type 'number' is not assignable to type 'string'.
@ -14,6 +14,6 @@ tests/cases/compiler/assignmentCompatability26.ts(9,1): error TS2322: Type 'inte
}
__test2__.__val__aa = __test1__.__val__obj4
~~~~~~~~~~~~~~~~~~~
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: string; }':
!!! error TS2322: Types of property 'one' are incompatible:
!!! error TS2322: Type 'number' is not assignable to type 'string'.
!!! error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: string; }'.
!!! error TS2323: Types of property 'one' are incompatible.
!!! error TS2323: Type 'number' is not assignable to type 'string'.

View File

@ -1,4 +1,4 @@
tests/cases/compiler/assignmentCompatability27.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ two: string; }':
tests/cases/compiler/assignmentCompatability27.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ two: string; }'.
Property 'two' is optional in type 'interfaceWithPublicAndOptional<number, string>' but required in type '{ two: string; }'.
@ -13,5 +13,5 @@ tests/cases/compiler/assignmentCompatability27.ts(9,1): error TS2322: Type 'inte
}
__test2__.__val__aa = __test1__.__val__obj4
~~~~~~~~~~~~~~~~~~~
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ two: string; }':
!!! error TS2322: Property 'two' is optional in type 'interfaceWithPublicAndOptional<number, string>' but required in type '{ two: string; }'.
!!! error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ two: string; }'.
!!! error TS2323: Property 'two' is optional in type 'interfaceWithPublicAndOptional<number, string>' but required in type '{ two: string; }'.

View File

@ -1,5 +1,5 @@
tests/cases/compiler/assignmentCompatability28.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: boolean; }':
Types of property 'one' are incompatible:
tests/cases/compiler/assignmentCompatability28.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: boolean; }'.
Types of property 'one' are incompatible.
Type 'number' is not assignable to type 'boolean'.
@ -14,6 +14,6 @@ tests/cases/compiler/assignmentCompatability28.ts(9,1): error TS2322: Type 'inte
}
__test2__.__val__aa = __test1__.__val__obj4
~~~~~~~~~~~~~~~~~~~
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: boolean; }':
!!! error TS2322: Types of property 'one' are incompatible:
!!! error TS2322: Type 'number' is not assignable to type 'boolean'.
!!! error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: boolean; }'.
!!! error TS2323: Types of property 'one' are incompatible.
!!! error TS2323: Type 'number' is not assignable to type 'boolean'.

View File

@ -1,6 +1,6 @@
tests/cases/compiler/assignmentCompatability29.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: any[]; }':
Types of property 'one' are incompatible:
Type 'number' is not assignable to type 'any[]':
tests/cases/compiler/assignmentCompatability29.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: any[]; }'.
Types of property 'one' are incompatible.
Type 'number' is not assignable to type 'any[]'.
Property 'length' is missing in type 'Number'.
@ -15,7 +15,7 @@ tests/cases/compiler/assignmentCompatability29.ts(9,1): error TS2322: Type 'inte
}
__test2__.__val__aa = __test1__.__val__obj4
~~~~~~~~~~~~~~~~~~~
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: any[]; }':
!!! error TS2322: Types of property 'one' are incompatible:
!!! error TS2322: Type 'number' is not assignable to type 'any[]':
!!! error TS2322: Property 'length' is missing in type 'Number'.
!!! error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: any[]; }'.
!!! error TS2323: Types of property 'one' are incompatible.
!!! error TS2323: Type 'number' is not assignable to type 'any[]'.
!!! error TS2323: Property 'length' is missing in type 'Number'.

View File

@ -1,6 +1,6 @@
tests/cases/compiler/assignmentCompatability30.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: number[]; }':
Types of property 'one' are incompatible:
Type 'number' is not assignable to type 'number[]':
tests/cases/compiler/assignmentCompatability30.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: number[]; }'.
Types of property 'one' are incompatible.
Type 'number' is not assignable to type 'number[]'.
Property 'length' is missing in type 'Number'.
@ -15,7 +15,7 @@ tests/cases/compiler/assignmentCompatability30.ts(9,1): error TS2322: Type 'inte
}
__test2__.__val__aa = __test1__.__val__obj4
~~~~~~~~~~~~~~~~~~~
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: number[]; }':
!!! error TS2322: Types of property 'one' are incompatible:
!!! error TS2322: Type 'number' is not assignable to type 'number[]':
!!! error TS2322: Property 'length' is missing in type 'Number'.
!!! error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: number[]; }'.
!!! error TS2323: Types of property 'one' are incompatible.
!!! error TS2323: Type 'number' is not assignable to type 'number[]'.
!!! error TS2323: Property 'length' is missing in type 'Number'.

View File

@ -1,6 +1,6 @@
tests/cases/compiler/assignmentCompatability31.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: string[]; }':
Types of property 'one' are incompatible:
Type 'number' is not assignable to type 'string[]':
tests/cases/compiler/assignmentCompatability31.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: string[]; }'.
Types of property 'one' are incompatible.
Type 'number' is not assignable to type 'string[]'.
Property 'length' is missing in type 'Number'.
@ -15,7 +15,7 @@ tests/cases/compiler/assignmentCompatability31.ts(9,1): error TS2322: Type 'inte
}
__test2__.__val__aa = __test1__.__val__obj4
~~~~~~~~~~~~~~~~~~~
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: string[]; }':
!!! error TS2322: Types of property 'one' are incompatible:
!!! error TS2322: Type 'number' is not assignable to type 'string[]':
!!! error TS2322: Property 'length' is missing in type 'Number'.
!!! error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: string[]; }'.
!!! error TS2323: Types of property 'one' are incompatible.
!!! error TS2323: Type 'number' is not assignable to type 'string[]'.
!!! error TS2323: Property 'length' is missing in type 'Number'.

View File

@ -1,6 +1,6 @@
tests/cases/compiler/assignmentCompatability32.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: boolean[]; }':
Types of property 'one' are incompatible:
Type 'number' is not assignable to type 'boolean[]':
tests/cases/compiler/assignmentCompatability32.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: boolean[]; }'.
Types of property 'one' are incompatible.
Type 'number' is not assignable to type 'boolean[]'.
Property 'length' is missing in type 'Number'.
@ -15,7 +15,7 @@ tests/cases/compiler/assignmentCompatability32.ts(9,1): error TS2322: Type 'inte
}
__test2__.__val__aa = __test1__.__val__obj4
~~~~~~~~~~~~~~~~~~~
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: boolean[]; }':
!!! error TS2322: Types of property 'one' are incompatible:
!!! error TS2322: Type 'number' is not assignable to type 'boolean[]':
!!! error TS2322: Property 'length' is missing in type 'Number'.
!!! error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: boolean[]; }'.
!!! error TS2323: Types of property 'one' are incompatible.
!!! error TS2323: Type 'number' is not assignable to type 'boolean[]'.
!!! error TS2323: Property 'length' is missing in type 'Number'.

View File

@ -1,4 +1,4 @@
tests/cases/compiler/assignmentCompatability35.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ [x: number]: number; }':
tests/cases/compiler/assignmentCompatability35.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ [x: number]: number; }'.
Index signature is missing in type 'interfaceWithPublicAndOptional<number, string>'.
@ -13,5 +13,5 @@ tests/cases/compiler/assignmentCompatability35.ts(9,1): error TS2322: Type 'inte
}
__test2__.__val__aa = __test1__.__val__obj4
~~~~~~~~~~~~~~~~~~~
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ [x: number]: number; }':
!!! error TS2322: Index signature is missing in type 'interfaceWithPublicAndOptional<number, string>'.
!!! error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ [x: number]: number; }'.
!!! error TS2323: Index signature is missing in type 'interfaceWithPublicAndOptional<number, string>'.

View File

@ -1,4 +1,4 @@
tests/cases/compiler/assignmentCompatability36.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ [x: string]: any; }':
tests/cases/compiler/assignmentCompatability36.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ [x: string]: any; }'.
Index signature is missing in type 'interfaceWithPublicAndOptional<number, string>'.
@ -13,5 +13,5 @@ tests/cases/compiler/assignmentCompatability36.ts(9,1): error TS2322: Type 'inte
}
__test2__.__val__aa = __test1__.__val__obj4
~~~~~~~~~~~~~~~~~~~
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ [x: string]: any; }':
!!! error TS2322: Index signature is missing in type 'interfaceWithPublicAndOptional<number, string>'.
!!! error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ [x: string]: any; }'.
!!! error TS2323: Index signature is missing in type 'interfaceWithPublicAndOptional<number, string>'.

View File

@ -1,4 +1,4 @@
tests/cases/compiler/assignmentCompatability39.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type 'classWithTwoPublic<number, string>':
tests/cases/compiler/assignmentCompatability39.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type 'classWithTwoPublic<number, string>'.
Property 'two' is optional in type 'interfaceWithPublicAndOptional<number, string>' but required in type 'classWithTwoPublic<number, string>'.
@ -13,5 +13,5 @@ tests/cases/compiler/assignmentCompatability39.ts(9,1): error TS2322: Type 'inte
}
__test2__.__val__x2 = __test1__.__val__obj4
~~~~~~~~~~~~~~~~~~~
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type 'classWithTwoPublic<number, string>':
!!! error TS2322: Property 'two' is optional in type 'interfaceWithPublicAndOptional<number, string>' but required in type 'classWithTwoPublic<number, string>'.
!!! error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type 'classWithTwoPublic<number, string>'.
!!! error TS2323: Property 'two' is optional in type 'interfaceWithPublicAndOptional<number, string>' but required in type 'classWithTwoPublic<number, string>'.

View File

@ -1,4 +1,4 @@
tests/cases/compiler/assignmentCompatability40.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type 'classWithPrivate<number>':
tests/cases/compiler/assignmentCompatability40.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type 'classWithPrivate<number>'.
Property 'one' is private in type 'classWithPrivate<number>' but not in type 'interfaceWithPublicAndOptional<number, string>'.
@ -13,5 +13,5 @@ tests/cases/compiler/assignmentCompatability40.ts(9,1): error TS2322: Type 'inte
}
__test2__.__val__x5 = __test1__.__val__obj4
~~~~~~~~~~~~~~~~~~~
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type 'classWithPrivate<number>':
!!! error TS2322: Property 'one' is private in type 'classWithPrivate<number>' but not in type 'interfaceWithPublicAndOptional<number, string>'.
!!! error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type 'classWithPrivate<number>'.
!!! error TS2323: Property 'one' is private in type 'classWithPrivate<number>' but not in type 'interfaceWithPublicAndOptional<number, string>'.

View File

@ -1,4 +1,4 @@
tests/cases/compiler/assignmentCompatability41.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type 'classWithTwoPrivate<number, string>':
tests/cases/compiler/assignmentCompatability41.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type 'classWithTwoPrivate<number, string>'.
Property 'one' is private in type 'classWithTwoPrivate<number, string>' but not in type 'interfaceWithPublicAndOptional<number, string>'.
@ -13,5 +13,5 @@ tests/cases/compiler/assignmentCompatability41.ts(9,1): error TS2322: Type 'inte
}
__test2__.__val__x6 = __test1__.__val__obj4
~~~~~~~~~~~~~~~~~~~
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type 'classWithTwoPrivate<number, string>':
!!! error TS2322: Property 'one' is private in type 'classWithTwoPrivate<number, string>' but not in type 'interfaceWithPublicAndOptional<number, string>'.
!!! error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type 'classWithTwoPrivate<number, string>'.
!!! error TS2323: Property 'one' is private in type 'classWithTwoPrivate<number, string>' but not in type 'interfaceWithPublicAndOptional<number, string>'.

View File

@ -1,4 +1,4 @@
tests/cases/compiler/assignmentCompatability42.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type 'classWithPublicPrivate<number, string>':
tests/cases/compiler/assignmentCompatability42.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type 'classWithPublicPrivate<number, string>'.
Property 'two' is private in type 'classWithPublicPrivate<number, string>' but not in type 'interfaceWithPublicAndOptional<number, string>'.
@ -13,5 +13,5 @@ tests/cases/compiler/assignmentCompatability42.ts(9,1): error TS2322: Type 'inte
}
__test2__.__val__x7 = __test1__.__val__obj4
~~~~~~~~~~~~~~~~~~~
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type 'classWithPublicPrivate<number, string>':
!!! error TS2322: Property 'two' is private in type 'classWithPublicPrivate<number, string>' but not in type 'interfaceWithPublicAndOptional<number, string>'.
!!! error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type 'classWithPublicPrivate<number, string>'.
!!! error TS2323: Property 'two' is private in type 'classWithPublicPrivate<number, string>' but not in type 'interfaceWithPublicAndOptional<number, string>'.

View File

@ -1,4 +1,4 @@
tests/cases/compiler/assignmentCompatability43.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type 'interfaceTwo<number, string>':
tests/cases/compiler/assignmentCompatability43.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type 'interfaceTwo<number, string>'.
Property 'two' is optional in type 'interfaceWithPublicAndOptional<number, string>' but required in type 'interfaceTwo<number, string>'.
@ -13,5 +13,5 @@ tests/cases/compiler/assignmentCompatability43.ts(9,1): error TS2322: Type 'inte
}
__test2__.__val__obj2 = __test1__.__val__obj4
~~~~~~~~~~~~~~~~~~~~~
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type 'interfaceTwo<number, string>':
!!! error TS2322: Property 'two' is optional in type 'interfaceWithPublicAndOptional<number, string>' but required in type 'interfaceTwo<number, string>'.
!!! error TS2323: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type 'interfaceTwo<number, string>'.
!!! error TS2323: Property 'two' is optional in type 'interfaceWithPublicAndOptional<number, string>' but required in type 'interfaceTwo<number, string>'.

View File

@ -1,10 +1,10 @@
tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(10,1): error TS2322: Type 'string' is not assignable to type 'Applicable':
tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(10,1): error TS2323: Type 'string' is not assignable to type 'Applicable'.
Property 'apply' is missing in type 'String'.
tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(11,1): error TS2322: Type 'string[]' is not assignable to type 'Applicable':
tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(11,1): error TS2323: Type 'string[]' is not assignable to type 'Applicable'.
Property 'apply' is missing in type 'string[]'.
tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(12,1): error TS2322: Type 'number' is not assignable to type 'Applicable':
tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(12,1): error TS2323: Type 'number' is not assignable to type 'Applicable'.
Property 'apply' is missing in type 'Number'.
tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(13,1): error TS2322: Type '{}' is not assignable to type 'Applicable':
tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(13,1): error TS2323: Type '{}' is not assignable to type 'Applicable'.
Property 'apply' is missing in type '{}'.
tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(22,4): error TS2345: Argument of type 'string' is not assignable to parameter of type 'Applicable'.
tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(23,4): error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'Applicable'.
@ -25,20 +25,20 @@ tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-functi
// Should fail
x = '';
~
!!! error TS2322: Type 'string' is not assignable to type 'Applicable':
!!! error TS2322: Property 'apply' is missing in type 'String'.
!!! error TS2323: Type 'string' is not assignable to type 'Applicable'.
!!! error TS2323: Property 'apply' is missing in type 'String'.
x = [''];
~
!!! error TS2322: Type 'string[]' is not assignable to type 'Applicable':
!!! error TS2322: Property 'apply' is missing in type 'string[]'.
!!! error TS2323: Type 'string[]' is not assignable to type 'Applicable'.
!!! error TS2323: Property 'apply' is missing in type 'string[]'.
x = 4;
~
!!! error TS2322: Type 'number' is not assignable to type 'Applicable':
!!! error TS2322: Property 'apply' is missing in type 'Number'.
!!! error TS2323: Type 'number' is not assignable to type 'Applicable'.
!!! error TS2323: Property 'apply' is missing in type 'Number'.
x = {};
~
!!! error TS2322: Type '{}' is not assignable to type 'Applicable':
!!! error TS2322: Property 'apply' is missing in type '{}'.
!!! error TS2323: Type '{}' is not assignable to type 'Applicable'.
!!! error TS2323: Property 'apply' is missing in type '{}'.
// Should work
function f() { };

View File

@ -1,10 +1,10 @@
tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(10,1): error TS2322: Type 'string' is not assignable to type 'Callable':
tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(10,1): error TS2323: Type 'string' is not assignable to type 'Callable'.
Property 'call' is missing in type 'String'.
tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(11,1): error TS2322: Type 'string[]' is not assignable to type 'Callable':
tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(11,1): error TS2323: Type 'string[]' is not assignable to type 'Callable'.
Property 'call' is missing in type 'string[]'.
tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(12,1): error TS2322: Type 'number' is not assignable to type 'Callable':
tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(12,1): error TS2323: Type 'number' is not assignable to type 'Callable'.
Property 'call' is missing in type 'Number'.
tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(13,1): error TS2322: Type '{}' is not assignable to type 'Callable':
tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(13,1): error TS2323: Type '{}' is not assignable to type 'Callable'.
Property 'call' is missing in type '{}'.
tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(22,4): error TS2345: Argument of type 'string' is not assignable to parameter of type 'Callable'.
tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(23,4): error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'Callable'.
@ -25,20 +25,20 @@ tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-functio
// Should fail
x = '';
~
!!! error TS2322: Type 'string' is not assignable to type 'Callable':
!!! error TS2322: Property 'call' is missing in type 'String'.
!!! error TS2323: Type 'string' is not assignable to type 'Callable'.
!!! error TS2323: Property 'call' is missing in type 'String'.
x = [''];
~
!!! error TS2322: Type 'string[]' is not assignable to type 'Callable':
!!! error TS2322: Property 'call' is missing in type 'string[]'.
!!! error TS2323: Type 'string[]' is not assignable to type 'Callable'.
!!! error TS2323: Property 'call' is missing in type 'string[]'.
x = 4;
~
!!! error TS2322: Type 'number' is not assignable to type 'Callable':
!!! error TS2322: Property 'call' is missing in type 'Number'.
!!! error TS2323: Type 'number' is not assignable to type 'Callable'.
!!! error TS2323: Property 'call' is missing in type 'Number'.
x = {};
~
!!! error TS2322: Type '{}' is not assignable to type 'Callable':
!!! error TS2322: Property 'call' is missing in type '{}'.
!!! error TS2323: Type '{}' is not assignable to type 'Callable'.
!!! error TS2323: Property 'call' is missing in type '{}'.
// Should work
function f() { };

View File

@ -1,5 +1,5 @@
tests/cases/compiler/assignmentToObject.ts(3,5): error TS2322: Type '{ toString: number; }' is not assignable to type 'Object':
Types of property 'toString' are incompatible:
tests/cases/compiler/assignmentToObject.ts(3,5): error TS2323: Type '{ toString: number; }' is not assignable to type 'Object'.
Types of property 'toString' are incompatible.
Type 'number' is not assignable to type '() => string'.
@ -8,7 +8,7 @@ tests/cases/compiler/assignmentToObject.ts(3,5): error TS2322: Type '{ toString:
var b: {} = a; // ok
var c: Object = a; // should be error
~
!!! error TS2322: Type '{ toString: number; }' is not assignable to type 'Object':
!!! error TS2322: Types of property 'toString' are incompatible:
!!! error TS2322: Type 'number' is not assignable to type '() => string'.
!!! error TS2323: Type '{ toString: number; }' is not assignable to type 'Object'.
!!! error TS2323: Types of property 'toString' are incompatible.
!!! error TS2323: Type 'number' is not assignable to type '() => string'.

View File

@ -1,19 +1,19 @@
tests/cases/compiler/assignmentToObjectAndFunction.ts(1,5): error TS2322: Type '{ toString: number; }' is not assignable to type 'Object':
Types of property 'toString' are incompatible:
tests/cases/compiler/assignmentToObjectAndFunction.ts(1,5): error TS2323: Type '{ toString: number; }' is not assignable to type 'Object'.
Types of property 'toString' are incompatible.
Type 'number' is not assignable to type '() => string'.
tests/cases/compiler/assignmentToObjectAndFunction.ts(8,5): error TS2322: Type '{}' is not assignable to type 'Function':
tests/cases/compiler/assignmentToObjectAndFunction.ts(8,5): error TS2323: Type '{}' is not assignable to type 'Function'.
Property 'apply' is missing in type '{}'.
tests/cases/compiler/assignmentToObjectAndFunction.ts(29,5): error TS2322: Type 'typeof bad' is not assignable to type 'Function':
Types of property 'apply' are incompatible:
tests/cases/compiler/assignmentToObjectAndFunction.ts(29,5): error TS2323: Type 'typeof bad' is not assignable to type 'Function'.
Types of property 'apply' are incompatible.
Type 'number' is not assignable to type '(thisArg: any, argArray?: any) => any'.
==== tests/cases/compiler/assignmentToObjectAndFunction.ts (3 errors) ====
var errObj: Object = { toString: 0 }; // Error, incompatible toString
~~~~~~
!!! error TS2322: Type '{ toString: number; }' is not assignable to type 'Object':
!!! error TS2322: Types of property 'toString' are incompatible:
!!! error TS2322: Type 'number' is not assignable to type '() => string'.
!!! error TS2323: Type '{ toString: number; }' is not assignable to type 'Object'.
!!! error TS2323: Types of property 'toString' are incompatible.
!!! error TS2323: Type 'number' is not assignable to type '() => string'.
var goodObj: Object = {
toString(x?) {
return "";
@ -22,8 +22,8 @@ tests/cases/compiler/assignmentToObjectAndFunction.ts(29,5): error TS2322: Type
var errFun: Function = {}; // Error for no call signature
~~~~~~
!!! error TS2322: Type '{}' is not assignable to type 'Function':
!!! error TS2322: Property 'apply' is missing in type '{}'.
!!! error TS2323: Type '{}' is not assignable to type 'Function'.
!!! error TS2323: Property 'apply' is missing in type '{}'.
function foo() { }
module foo {
@ -46,6 +46,6 @@ tests/cases/compiler/assignmentToObjectAndFunction.ts(29,5): error TS2322: Type
var badFundule: Function = bad; // error
~~~~~~~~~~
!!! error TS2322: Type 'typeof bad' is not assignable to type 'Function':
!!! error TS2322: Types of property 'apply' are incompatible:
!!! error TS2322: Type 'number' is not assignable to type '(thisArg: any, argArray?: any) => any'.
!!! error TS2323: Type 'typeof bad' is not assignable to type 'Function'.
!!! error TS2323: Types of property 'apply' are incompatible.
!!! error TS2323: Type 'number' is not assignable to type '(thisArg: any, argArray?: any) => any'.

View File

@ -6,14 +6,14 @@ tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesize
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(17,1): error TS2364: Invalid left-hand side of assignment expression.
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(18,1): error TS2364: Invalid left-hand side of assignment expression.
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(25,5): error TS2364: Invalid left-hand side of assignment expression.
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(31,1): error TS2322: Type '{ x: string; }' is not assignable to type 'typeof M3':
Types of property 'x' are incompatible:
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(31,1): error TS2323: Type '{ x: string; }' is not assignable to type 'typeof M3'.
Types of property 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(32,1): error TS2322: Type '{ x: string; }' is not assignable to type 'typeof M3':
Types of property 'x' are incompatible:
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(32,1): error TS2323: Type '{ x: string; }' is not assignable to type 'typeof M3'.
Types of property 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(33,1): error TS2322: Type '{ x: string; }' is not assignable to type 'typeof M3':
Types of property 'x' are incompatible:
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(33,1): error TS2323: Type '{ x: string; }' is not assignable to type 'typeof M3'.
Types of property 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(37,1): error TS2364: Invalid left-hand side of assignment expression.
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(38,1): error TS2364: Invalid left-hand side of assignment expression.
@ -79,19 +79,19 @@ tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesize
M2.M3 = { x: '' }; // Error
~~~~~
!!! error TS2322: Type '{ x: string; }' is not assignable to type 'typeof M3':
!!! error TS2322: Types of property 'x' are incompatible:
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2323: Type '{ x: string; }' is not assignable to type 'typeof M3'.
!!! error TS2323: Types of property 'x' are incompatible.
!!! error TS2323: Type 'string' is not assignable to type 'number'.
(M2).M3 = { x: '' }; // Error
~~~~~~~
!!! error TS2322: Type '{ x: string; }' is not assignable to type 'typeof M3':
!!! error TS2322: Types of property 'x' are incompatible:
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2323: Type '{ x: string; }' is not assignable to type 'typeof M3'.
!!! error TS2323: Types of property 'x' are incompatible.
!!! error TS2323: Type 'string' is not assignable to type 'number'.
(M2.M3) = { x: '' }; // Error
~~~~~~~
!!! error TS2322: Type '{ x: string; }' is not assignable to type 'typeof M3':
!!! error TS2322: Types of property 'x' are incompatible:
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2323: Type '{ x: string; }' is not assignable to type 'typeof M3'.
!!! error TS2323: Types of property 'x' are incompatible.
!!! error TS2323: Type 'string' is not assignable to type 'number'.
function fn() { }

View File

@ -1,6 +1,6 @@
tests/cases/conformance/types/members/augmentedTypeAssignmentCompatIndexSignature.ts(15,5): error TS2322: Type '{}' is not assignable to type '{ [x: number]: Foo; }':
tests/cases/conformance/types/members/augmentedTypeAssignmentCompatIndexSignature.ts(15,5): error TS2323: Type '{}' is not assignable to type '{ [x: number]: Foo; }'.
Index signature is missing in type '{}'.
tests/cases/conformance/types/members/augmentedTypeAssignmentCompatIndexSignature.ts(19,5): error TS2322: Type '() => void' is not assignable to type '{ [x: number]: Bar; }':
tests/cases/conformance/types/members/augmentedTypeAssignmentCompatIndexSignature.ts(19,5): error TS2323: Type '() => void' is not assignable to type '{ [x: number]: Bar; }'.
Index signature is missing in type '() => void'.
@ -21,14 +21,14 @@ tests/cases/conformance/types/members/augmentedTypeAssignmentCompatIndexSignatur
var v1: {
~~
!!! error TS2322: Type '{}' is not assignable to type '{ [x: number]: Foo; }':
!!! error TS2322: Index signature is missing in type '{}'.
!!! error TS2323: Type '{}' is not assignable to type '{ [x: number]: Foo; }'.
!!! error TS2323: Index signature is missing in type '{}'.
[n: number]: Foo
} = o; // Should be allowed
var v2: {
~~
!!! error TS2322: Type '() => void' is not assignable to type '{ [x: number]: Bar; }':
!!! error TS2322: Index signature is missing in type '() => void'.
!!! error TS2323: Type '() => void' is not assignable to type '{ [x: number]: Bar; }'.
!!! error TS2323: Index signature is missing in type '() => void'.
[n: number]: Bar
} = f; // Should be allowed

View File

@ -1,4 +1,4 @@
tests/cases/compiler/baseTypePrivateMemberClash.ts(8,11): error TS2320: Interface 'Z' cannot simultaneously extend types 'X' and 'Y':
tests/cases/compiler/baseTypePrivateMemberClash.ts(8,11): error TS2320: Interface 'Z' cannot simultaneously extend types 'X' and 'Y'.
Named properties 'm' of types 'X' and 'Y' are not identical.
@ -12,5 +12,5 @@ tests/cases/compiler/baseTypePrivateMemberClash.ts(8,11): error TS2320: Interfac
interface Z extends X, Y { }
~
!!! error TS2320: Interface 'Z' cannot simultaneously extend types 'X' and 'Y':
!!! error TS2320: Interface 'Z' cannot simultaneously extend types 'X' and 'Y'.
!!! error TS2320: Named properties 'm' of types 'X' and 'Y' are not identical.

View File

@ -2,7 +2,7 @@ tests/cases/compiler/bases.ts(7,15): error TS1005: ';' expected.
tests/cases/compiler/bases.ts(13,15): error TS1005: ';' expected.
tests/cases/compiler/bases.ts(7,14): error TS2339: Property 'y' does not exist on type 'B'.
tests/cases/compiler/bases.ts(7,17): error TS2304: Cannot find name 'any'.
tests/cases/compiler/bases.ts(11,7): error TS2421: Class 'C' incorrectly implements interface 'I':
tests/cases/compiler/bases.ts(11,7): error TS2420: Class 'C' incorrectly implements interface 'I'.
Property 'x' is missing in type 'C'.
tests/cases/compiler/bases.ts(12,5): error TS2377: Constructors for derived classes must contain a 'super' call.
tests/cases/compiler/bases.ts(13,14): error TS2339: Property 'x' does not exist on type 'C'.
@ -30,8 +30,8 @@ tests/cases/compiler/bases.ts(18,9): error TS2339: Property 'y' does not exist o
class C extends B implements I {
~
!!! error TS2421: Class 'C' incorrectly implements interface 'I':
!!! error TS2421: Property 'x' is missing in type 'C'.
!!! error TS2420: Class 'C' incorrectly implements interface 'I'.
!!! error TS2420: Property 'x' is missing in type 'C'.
constructor() {
~~~~~~~~~~~~~~~
this.x: any;

View File

@ -1,6 +1,6 @@
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance.ts(57,15): error TS2429: Interface 'I2' incorrectly extends interface 'Base2':
Types of property 'a' are incompatible:
Type '(x: number) => string' is not assignable to type '(x: number) => number':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance.ts(57,15): error TS2430: Interface 'I2' incorrectly extends interface 'Base2'.
Types of property 'a' are incompatible.
Type '(x: number) => string' is not assignable to type '(x: number) => number'.
Type 'string' is not assignable to type 'number'.
@ -63,10 +63,10 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSign
// S's
interface I2 extends Base2 {
~~
!!! error TS2429: Interface 'I2' incorrectly extends interface 'Base2':
!!! error TS2429: Types of property 'a' are incompatible:
!!! error TS2429: Type '(x: number) => string' is not assignable to type '(x: number) => number':
!!! error TS2429: Type 'string' is not assignable to type 'number'.
!!! error TS2430: Interface 'I2' incorrectly extends interface 'Base2'.
!!! error TS2430: Types of property 'a' are incompatible.
!!! error TS2430: Type '(x: number) => string' is not assignable to type '(x: number) => number'.
!!! error TS2430: Type 'string' is not assignable to type 'number'.
// N's
a: (x: number) => string; // error because base returns non-void;
}

View File

@ -1,16 +1,16 @@
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance3.ts(51,19): error TS2429: Interface 'I2<T, U>' incorrectly extends interface 'A':
Types of property 'a2' are incompatible:
Type '(x: T) => U[]' is not assignable to type '(x: number) => string[]':
Types of parameters 'x' and 'x' are incompatible:
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance3.ts(51,19): error TS2430: Interface 'I2<T, U>' incorrectly extends interface 'A'.
Types of property 'a2' are incompatible.
Type '(x: T) => U[]' is not assignable to type '(x: number) => string[]'.
Types of parameters 'x' and 'x' are incompatible.
Type 'T' is not assignable to type 'number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance3.ts(60,19): error TS2429: Interface 'I4' incorrectly extends interface 'A':
Types of property 'a8' are incompatible:
Type '<T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived':
Types of parameters 'y' and 'y' are incompatible:
Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived':
Types of parameters 'arg2' and 'arg2' are incompatible:
Type '{ foo: number; }' is not assignable to type 'Base':
Types of property 'foo' are incompatible:
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance3.ts(60,19): error TS2430: Interface 'I4' incorrectly extends interface 'A'.
Types of property 'a8' are incompatible.
Type '<T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'.
Types of parameters 'y' and 'y' are incompatible.
Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'.
Types of parameters 'arg2' and 'arg2' are incompatible.
Type '{ foo: number; }' is not assignable to type 'Base'.
Types of property 'foo' are incompatible.
Type 'number' is not assignable to type 'string'.
@ -67,11 +67,11 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSign
interface I2<T, U> extends A {
~~
!!! error TS2429: Interface 'I2<T, U>' incorrectly extends interface 'A':
!!! error TS2429: Types of property 'a2' are incompatible:
!!! error TS2429: Type '(x: T) => U[]' is not assignable to type '(x: number) => string[]':
!!! error TS2429: Types of parameters 'x' and 'x' are incompatible:
!!! error TS2429: Type 'T' is not assignable to type 'number'.
!!! error TS2430: Interface 'I2<T, U>' incorrectly extends interface 'A'.
!!! error TS2430: Types of property 'a2' are incompatible.
!!! error TS2430: Type '(x: T) => U[]' is not assignable to type '(x: number) => string[]'.
!!! error TS2430: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2430: Type 'T' is not assignable to type 'number'.
a2: (x: T) => U[]; // error, no contextual signature instantiation since I2.a2 is not generic
}
@ -82,15 +82,15 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSign
interface I4 extends A {
~~
!!! error TS2429: Interface 'I4' incorrectly extends interface 'A':
!!! error TS2429: Types of property 'a8' are incompatible:
!!! error TS2429: Type '<T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived':
!!! error TS2429: Types of parameters 'y' and 'y' are incompatible:
!!! error TS2429: Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived':
!!! error TS2429: Types of parameters 'arg2' and 'arg2' are incompatible:
!!! error TS2429: Type '{ foo: number; }' is not assignable to type 'Base':
!!! error TS2429: Types of property 'foo' are incompatible:
!!! error TS2429: Type 'number' is not assignable to type 'string'.
!!! error TS2430: Interface 'I4' incorrectly extends interface 'A'.
!!! error TS2430: Types of property 'a8' are incompatible.
!!! error TS2430: Type '<T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'.
!!! error TS2430: Types of parameters 'y' and 'y' are incompatible.
!!! error TS2430: Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'.
!!! error TS2430: Types of parameters 'arg2' and 'arg2' are incompatible.
!!! error TS2430: Type '{ foo: number; }' is not assignable to type 'Base'.
!!! error TS2430: Types of property 'foo' are incompatible.
!!! error TS2430: Type 'number' is not assignable to type 'string'.
a8: <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U; // error, type mismatch
}

View File

@ -1,4 +1,4 @@
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesThatDifferOnlyByReturnType2.ts(8,11): error TS2320: Interface 'A' cannot simultaneously extend types 'I<number>' and 'I<string>':
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesThatDifferOnlyByReturnType2.ts(8,11): error TS2320: Interface 'A' cannot simultaneously extend types 'I<number>' and 'I<string>'.
Named properties 'foo' of types 'I<number>' and 'I<string>' are not identical.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesThatDifferOnlyByReturnType2.ts(13,16): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'.
@ -13,7 +13,7 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesTha
interface A extends I<number>, I<string> { }
~
!!! error TS2320: Interface 'A' cannot simultaneously extend types 'I<number>' and 'I<string>':
!!! error TS2320: Interface 'A' cannot simultaneously extend types 'I<number>' and 'I<string>'.
!!! error TS2320: Named properties 'foo' of types 'I<number>' and 'I<string>' are not identical.
var x: A;

View File

@ -1,19 +1,19 @@
tests/cases/conformance/types/tuple/castingTuple.ts(13,23): error TS2353: Neither type '[number, string]' nor type '[number, string, boolean]' is assignable to the other:
tests/cases/conformance/types/tuple/castingTuple.ts(13,23): error TS2352: Neither type '[number, string]' nor type '[number, string, boolean]' is assignable to the other.
Property '2' is missing in type '[number, string]'.
tests/cases/conformance/types/tuple/castingTuple.ts(16,21): error TS2353: Neither type '[C, D]' nor type '[C, D, A]' is assignable to the other:
tests/cases/conformance/types/tuple/castingTuple.ts(16,21): error TS2352: Neither type '[C, D]' nor type '[C, D, A]' is assignable to the other.
Property '2' is missing in type '[C, D]'.
tests/cases/conformance/types/tuple/castingTuple.ts(24,10): error TS2353: Neither type '[number, string]' nor type '[number, number]' is assignable to the other:
Types of property '1' are incompatible:
tests/cases/conformance/types/tuple/castingTuple.ts(24,10): error TS2352: Neither type '[number, string]' nor type '[number, number]' is assignable to the other.
Types of property '1' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/types/tuple/castingTuple.ts(25,10): error TS2353: Neither type '[C, D]' nor type '[A, I]' is assignable to the other:
Types of property '0' are incompatible:
Type 'C' is not assignable to type 'A':
tests/cases/conformance/types/tuple/castingTuple.ts(25,10): error TS2352: Neither type '[C, D]' nor type '[A, I]' is assignable to the other.
Types of property '0' are incompatible.
Type 'C' is not assignable to type 'A'.
Property 'a' is missing in type 'C'.
tests/cases/conformance/types/tuple/castingTuple.ts(26,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'array1' must be of type '{}[]', but here has type 'number[]'.
tests/cases/conformance/types/tuple/castingTuple.ts(26,14): error TS2353: Neither type '[number, string]' nor type 'number[]' is assignable to the other:
Types of property 'pop' are incompatible:
Type '() => string | number' is not assignable to type '() => number':
Type 'string | number' is not assignable to type 'number':
tests/cases/conformance/types/tuple/castingTuple.ts(26,14): error TS2352: Neither type '[number, string]' nor type 'number[]' is assignable to the other.
Types of property 'pop' are incompatible.
Type '() => string | number' is not assignable to type '() => number'.
Type 'string | number' is not assignable to type 'number'.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/types/tuple/castingTuple.ts(27,1): error TS2304: Cannot find name 't4'.
@ -33,14 +33,14 @@ tests/cases/conformance/types/tuple/castingTuple.ts(27,1): error TS2304: Cannot
var emptyObjTuple = <[{}, {}]>numStrTuple;
var numStrBoolTuple = <[number, string, boolean]>numStrTuple;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2353: Neither type '[number, string]' nor type '[number, string, boolean]' is assignable to the other:
!!! error TS2353: Property '2' is missing in type '[number, string]'.
!!! error TS2352: Neither type '[number, string]' nor type '[number, string, boolean]' is assignable to the other.
!!! error TS2352: Property '2' is missing in type '[number, string]'.
var classCDTuple: [C, D] = [new C(), new D()];
var interfaceIITuple = <[I, I]>classCDTuple;
var classCDATuple = <[C, D, A]>classCDTuple;
~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2353: Neither type '[C, D]' nor type '[C, D, A]' is assignable to the other:
!!! error TS2353: Property '2' is missing in type '[C, D]'.
!!! error TS2352: Neither type '[C, D]' nor type '[C, D, A]' is assignable to the other.
!!! error TS2352: Property '2' is missing in type '[C, D]'.
var eleFromCDA1 = classCDATuple[2]; // A
var eleFromCDA2 = classCDATuple[5]; // {}
var t10: [E1, E2] = [E1.one, E2.one];
@ -50,24 +50,24 @@ tests/cases/conformance/types/tuple/castingTuple.ts(27,1): error TS2304: Cannot
// error
var t3 = <[number, number]>numStrTuple;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2353: Neither type '[number, string]' nor type '[number, number]' is assignable to the other:
!!! error TS2353: Types of property '1' are incompatible:
!!! error TS2353: Type 'string' is not assignable to type 'number'.
!!! error TS2352: Neither type '[number, string]' nor type '[number, number]' is assignable to the other.
!!! error TS2352: Types of property '1' are incompatible.
!!! error TS2352: Type 'string' is not assignable to type 'number'.
var t9 = <[A, I]>classCDTuple;
~~~~~~~~~~~~~~~~~~~~
!!! error TS2353: Neither type '[C, D]' nor type '[A, I]' is assignable to the other:
!!! error TS2353: Types of property '0' are incompatible:
!!! error TS2353: Type 'C' is not assignable to type 'A':
!!! error TS2353: Property 'a' is missing in type 'C'.
!!! error TS2352: Neither type '[C, D]' nor type '[A, I]' is assignable to the other.
!!! error TS2352: Types of property '0' are incompatible.
!!! error TS2352: Type 'C' is not assignable to type 'A'.
!!! error TS2352: Property 'a' is missing in type 'C'.
var array1 = <number[]>numStrTuple;
~~~~~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'array1' must be of type '{}[]', but here has type 'number[]'.
~~~~~~~~~~~~~~~~~~~~~
!!! error TS2353: Neither type '[number, string]' nor type 'number[]' is assignable to the other:
!!! error TS2353: Types of property 'pop' are incompatible:
!!! error TS2353: Type '() => string | number' is not assignable to type '() => number':
!!! error TS2353: Type 'string | number' is not assignable to type 'number':
!!! error TS2353: Type 'string' is not assignable to type 'number'.
!!! error TS2352: Neither type '[number, string]' nor type 'number[]' is assignable to the other.
!!! error TS2352: Types of property 'pop' are incompatible.
!!! error TS2352: Type '() => string | number' is not assignable to type '() => number'.
!!! error TS2352: Type 'string | number' is not assignable to type 'number'.
!!! error TS2352: Type 'string' is not assignable to type 'number'.
t4[2] = 10;
~~
!!! error TS2304: Cannot find name 't4'.

View File

@ -1,6 +1,6 @@
tests/cases/compiler/chainedAssignment1.ts(21,1): error TS2322: Type 'Z' is not assignable to type 'X':
tests/cases/compiler/chainedAssignment1.ts(21,1): error TS2323: Type 'Z' is not assignable to type 'X'.
Property 'a' is missing in type 'Z'.
tests/cases/compiler/chainedAssignment1.ts(21,6): error TS2322: Type 'Z' is not assignable to type 'Y':
tests/cases/compiler/chainedAssignment1.ts(21,6): error TS2323: Type 'Z' is not assignable to type 'Y'.
Property 'a' is missing in type 'Z'.
tests/cases/compiler/chainedAssignment1.ts(22,1): error TS2323: Type 'Z' is not assignable to type 'Y'.
@ -28,11 +28,11 @@ tests/cases/compiler/chainedAssignment1.ts(22,1): error TS2323: Type 'Z' is not
var c3 = new Z();
c1 = c2 = c3; // a bug made this not report the same error as below
~~
!!! error TS2322: Type 'Z' is not assignable to type 'X':
!!! error TS2322: Property 'a' is missing in type 'Z'.
!!! error TS2323: Type 'Z' is not assignable to type 'X'.
!!! error TS2323: Property 'a' is missing in type 'Z'.
~~
!!! error TS2322: Type 'Z' is not assignable to type 'Y':
!!! error TS2322: Property 'a' is missing in type 'Z'.
!!! error TS2323: Type 'Z' is not assignable to type 'Y'.
!!! error TS2323: Property 'a' is missing in type 'Z'.
c2 = c3; // Error TS111: Cannot convert Z to Y
~~
!!! error TS2323: Type 'Z' is not assignable to type 'Y'.

View File

@ -1,4 +1,4 @@
tests/cases/compiler/chainedAssignment3.ts(18,1): error TS2322: Type 'A' is not assignable to type 'B':
tests/cases/compiler/chainedAssignment3.ts(18,1): error TS2323: Type 'A' is not assignable to type 'B'.
Property 'value' is missing in type 'A'.
tests/cases/compiler/chainedAssignment3.ts(19,5): error TS2323: Type 'A' is not assignable to type 'B'.
@ -23,8 +23,8 @@ tests/cases/compiler/chainedAssignment3.ts(19,5): error TS2323: Type 'A' is not
// error cases
b = a = new A();
~
!!! error TS2322: Type 'A' is not assignable to type 'B':
!!! error TS2322: Property 'value' is missing in type 'A'.
!!! error TS2323: Type 'A' is not assignable to type 'B'.
!!! error TS2323: Property 'value' is missing in type 'A'.
a = b = new A();
~
!!! error TS2323: Type 'A' is not assignable to type 'B'.

View File

@ -1,6 +1,6 @@
tests/cases/compiler/chainedAssignmentChecking.ts(21,1): error TS2322: Type 'Z' is not assignable to type 'X':
tests/cases/compiler/chainedAssignmentChecking.ts(21,1): error TS2323: Type 'Z' is not assignable to type 'X'.
Property 'a' is missing in type 'Z'.
tests/cases/compiler/chainedAssignmentChecking.ts(21,6): error TS2322: Type 'Z' is not assignable to type 'Y':
tests/cases/compiler/chainedAssignmentChecking.ts(21,6): error TS2323: Type 'Z' is not assignable to type 'Y'.
Property 'a' is missing in type 'Z'.
@ -27,9 +27,9 @@ tests/cases/compiler/chainedAssignmentChecking.ts(21,6): error TS2322: Type 'Z'
c1 = c2 = c3; // Should be error
~~
!!! error TS2322: Type 'Z' is not assignable to type 'X':
!!! error TS2322: Property 'a' is missing in type 'Z'.
!!! error TS2323: Type 'Z' is not assignable to type 'X'.
!!! error TS2323: Property 'a' is missing in type 'Z'.
~~
!!! error TS2322: Type 'Z' is not assignable to type 'Y':
!!! error TS2322: Property 'a' is missing in type 'Z'.
!!! error TS2323: Type 'Z' is not assignable to type 'Y'.
!!! error TS2323: Property 'a' is missing in type 'Z'.

View File

@ -1,4 +1,4 @@
tests/cases/compiler/classExtendsInterfaceThatExtendsClassWithPrivates1.ts(10,7): error TS2421: Class 'D2' incorrectly implements interface 'I':
tests/cases/compiler/classExtendsInterfaceThatExtendsClassWithPrivates1.ts(10,7): error TS2420: Class 'D2' incorrectly implements interface 'I'.
Types have separate declarations of a private property 'x'.
@ -14,8 +14,8 @@ tests/cases/compiler/classExtendsInterfaceThatExtendsClassWithPrivates1.ts(10,7)
class D2 implements I {
~~
!!! error TS2421: Class 'D2' incorrectly implements interface 'I':
!!! error TS2421: Types have separate declarations of a private property 'x'.
!!! error TS2420: Class 'D2' incorrectly implements interface 'I'.
!!! error TS2420: Types have separate declarations of a private property 'x'.
public foo(x: any) { return x }
private x = 3;
other(x: any) { return x }

View File

@ -1,6 +1,6 @@
tests/cases/compiler/classImplementsClass2.ts(2,7): error TS2421: Class 'C' incorrectly implements interface 'A':
tests/cases/compiler/classImplementsClass2.ts(2,7): error TS2420: Class 'C' incorrectly implements interface 'A'.
Property 'foo' is missing in type 'C'.
tests/cases/compiler/classImplementsClass2.ts(13,1): error TS2322: Type 'C' is not assignable to type 'C2':
tests/cases/compiler/classImplementsClass2.ts(13,1): error TS2323: Type 'C' is not assignable to type 'C2'.
Property 'foo' is missing in type 'C'.
@ -8,8 +8,8 @@ tests/cases/compiler/classImplementsClass2.ts(13,1): error TS2322: Type 'C' is n
class A { foo(): number { return 1; } }
class C implements A {} // error
~
!!! error TS2421: Class 'C' incorrectly implements interface 'A':
!!! error TS2421: Property 'foo' is missing in type 'C'.
!!! error TS2420: Class 'C' incorrectly implements interface 'A'.
!!! error TS2420: Property 'foo' is missing in type 'C'.
class C2 extends A {
foo() {
@ -22,5 +22,5 @@ tests/cases/compiler/classImplementsClass2.ts(13,1): error TS2322: Type 'C' is n
c = c2;
c2 = c;
~~
!!! error TS2322: Type 'C' is not assignable to type 'C2':
!!! error TS2322: Property 'foo' is missing in type 'C'.
!!! error TS2323: Type 'C' is not assignable to type 'C2'.
!!! error TS2323: Property 'foo' is missing in type 'C'.

View File

@ -1,6 +1,6 @@
tests/cases/compiler/classImplementsClass4.ts(5,7): error TS2421: Class 'C' incorrectly implements interface 'A':
tests/cases/compiler/classImplementsClass4.ts(5,7): error TS2420: Class 'C' incorrectly implements interface 'A'.
Property 'x' is missing in type 'C'.
tests/cases/compiler/classImplementsClass4.ts(16,1): error TS2322: Type 'C' is not assignable to type 'C2':
tests/cases/compiler/classImplementsClass4.ts(16,1): error TS2323: Type 'C' is not assignable to type 'C2'.
Property 'x' is missing in type 'C'.
@ -11,8 +11,8 @@ tests/cases/compiler/classImplementsClass4.ts(16,1): error TS2322: Type 'C' is n
}
class C implements A {
~
!!! error TS2421: Class 'C' incorrectly implements interface 'A':
!!! error TS2421: Property 'x' is missing in type 'C'.
!!! error TS2420: Class 'C' incorrectly implements interface 'A'.
!!! error TS2420: Property 'x' is missing in type 'C'.
foo() {
return 1;
}
@ -25,5 +25,5 @@ tests/cases/compiler/classImplementsClass4.ts(16,1): error TS2322: Type 'C' is n
c = c2;
c2 = c;
~~
!!! error TS2322: Type 'C' is not assignable to type 'C2':
!!! error TS2322: Property 'x' is missing in type 'C'.
!!! error TS2323: Type 'C' is not assignable to type 'C2'.
!!! error TS2323: Property 'x' is missing in type 'C'.

View File

@ -1,8 +1,8 @@
tests/cases/compiler/classImplementsClass5.ts(5,7): error TS2421: Class 'C' incorrectly implements interface 'A':
tests/cases/compiler/classImplementsClass5.ts(5,7): error TS2420: Class 'C' incorrectly implements interface 'A'.
Types have separate declarations of a private property 'x'.
tests/cases/compiler/classImplementsClass5.ts(16,1): error TS2322: Type 'C2' is not assignable to type 'C':
tests/cases/compiler/classImplementsClass5.ts(16,1): error TS2323: Type 'C2' is not assignable to type 'C'.
Types have separate declarations of a private property 'x'.
tests/cases/compiler/classImplementsClass5.ts(17,1): error TS2322: Type 'C' is not assignable to type 'C2':
tests/cases/compiler/classImplementsClass5.ts(17,1): error TS2323: Type 'C' is not assignable to type 'C2'.
Types have separate declarations of a private property 'x'.
@ -13,8 +13,8 @@ tests/cases/compiler/classImplementsClass5.ts(17,1): error TS2322: Type 'C' is n
}
class C implements A {
~
!!! error TS2421: Class 'C' incorrectly implements interface 'A':
!!! error TS2421: Types have separate declarations of a private property 'x'.
!!! error TS2420: Class 'C' incorrectly implements interface 'A'.
!!! error TS2420: Types have separate declarations of a private property 'x'.
private x = 1;
foo() {
return 1;
@ -27,9 +27,9 @@ tests/cases/compiler/classImplementsClass5.ts(17,1): error TS2322: Type 'C' is n
var c2: C2;
c = c2;
~
!!! error TS2322: Type 'C2' is not assignable to type 'C':
!!! error TS2322: Types have separate declarations of a private property 'x'.
!!! error TS2323: Type 'C2' is not assignable to type 'C'.
!!! error TS2323: Types have separate declarations of a private property 'x'.
c2 = c;
~~
!!! error TS2322: Type 'C' is not assignable to type 'C2':
!!! error TS2322: Types have separate declarations of a private property 'x'.
!!! error TS2323: Type 'C' is not assignable to type 'C2'.
!!! error TS2323: Types have separate declarations of a private property 'x'.

View File

@ -1,6 +1,6 @@
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classIsSubtypeOfBaseType.ts(11,7): error TS2416: Class 'Derived2' incorrectly extends base class 'Base<{ bar: string; }>':
Types of property 'foo' are incompatible:
Type '{ bar?: string; }' is not assignable to type '{ bar: string; }':
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classIsSubtypeOfBaseType.ts(11,7): error TS2415: Class 'Derived2' incorrectly extends base class 'Base<{ bar: string; }>'.
Types of property 'foo' are incompatible.
Type '{ bar?: string; }' is not assignable to type '{ bar: string; }'.
Property 'bar' is optional in type '{ bar?: string; }' but required in type '{ bar: string; }'.
@ -17,10 +17,10 @@ tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/cla
class Derived2 extends Base<{ bar: string; }> {
~~~~~~~~
!!! error TS2416: Class 'Derived2' incorrectly extends base class 'Base<{ bar: string; }>':
!!! error TS2416: Types of property 'foo' are incompatible:
!!! error TS2416: Type '{ bar?: string; }' is not assignable to type '{ bar: string; }':
!!! error TS2416: Property 'bar' is optional in type '{ bar?: string; }' but required in type '{ bar: string; }'.
!!! error TS2415: Class 'Derived2' incorrectly extends base class 'Base<{ bar: string; }>'.
!!! error TS2415: Types of property 'foo' are incompatible.
!!! error TS2415: Type '{ bar?: string; }' is not assignable to type '{ bar: string; }'.
!!! error TS2415: Property 'bar' is optional in type '{ bar?: string; }' but required in type '{ bar: string; }'.
foo: {
bar?: string; // error
}

View File

@ -9,9 +9,9 @@ tests/cases/compiler/classUpdateTests.ts(43,18): error TS2335: 'super' can only
tests/cases/compiler/classUpdateTests.ts(46,17): error TS2311: A class may only extend another class.
tests/cases/compiler/classUpdateTests.ts(47,18): error TS2335: 'super' can only be referenced in a derived class.
tests/cases/compiler/classUpdateTests.ts(57,2): error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.
tests/cases/compiler/classUpdateTests.ts(63,7): error TS2416: Class 'L' incorrectly extends base class 'G':
tests/cases/compiler/classUpdateTests.ts(63,7): error TS2415: Class 'L' incorrectly extends base class 'G'.
Property 'p1' is private in type 'L' but not in type 'G'.
tests/cases/compiler/classUpdateTests.ts(69,7): error TS2416: Class 'M' incorrectly extends base class 'G':
tests/cases/compiler/classUpdateTests.ts(69,7): error TS2415: Class 'M' incorrectly extends base class 'G'.
Property 'p1' is private in type 'M' but not in type 'G'.
tests/cases/compiler/classUpdateTests.ts(70,2): error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.
tests/cases/compiler/classUpdateTests.ts(105,15): error TS2339: Property 'p1' does not exist on type 'Q'.
@ -96,8 +96,8 @@ tests/cases/compiler/classUpdateTests.ts(111,16): error TS2339: Property 'p1' do
class L extends G {
~
!!! error TS2416: Class 'L' incorrectly extends base class 'G':
!!! error TS2416: Property 'p1' is private in type 'L' but not in type 'G'.
!!! error TS2415: Class 'L' incorrectly extends base class 'G'.
!!! error TS2415: Property 'p1' is private in type 'L' but not in type 'G'.
constructor(private p1:number) {
super(); // NO ERROR
}
@ -105,8 +105,8 @@ tests/cases/compiler/classUpdateTests.ts(111,16): error TS2339: Property 'p1' do
class M extends G {
~
!!! error TS2416: Class 'M' incorrectly extends base class 'G':
!!! error TS2416: Property 'p1' is private in type 'M' but not in type 'G'.
!!! error TS2415: Class 'M' incorrectly extends base class 'G'.
!!! error TS2415: Property 'p1' is private in type 'M' but not in type 'G'.
constructor(private p1:number) { // ERROR
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
var i = 0;

View File

@ -1,4 +1,4 @@
tests/cases/compiler/classWithMultipleBaseClasses.ts(18,7): error TS2421: Class 'D' incorrectly implements interface 'I':
tests/cases/compiler/classWithMultipleBaseClasses.ts(18,7): error TS2420: Class 'D' incorrectly implements interface 'I'.
Property 'foo' is missing in type 'D'.
@ -22,8 +22,8 @@ tests/cases/compiler/classWithMultipleBaseClasses.ts(18,7): error TS2421: Class
class D implements I, J {
~
!!! error TS2421: Class 'D' incorrectly implements interface 'I':
!!! error TS2421: Property 'foo' is missing in type 'D'.
!!! error TS2420: Class 'D' incorrectly implements interface 'I'.
!!! error TS2420: Property 'foo' is missing in type 'D'.
baz() { }
bat() { }
}

View File

@ -1,6 +1,6 @@
tests/cases/compiler/clodulesDerivedClasses.ts(9,7): error TS2418: Class static side 'typeof Path' incorrectly extends base class static side 'typeof Shape':
Types of property 'Utils' are incompatible:
Type 'typeof Utils' is not assignable to type 'typeof Utils':
tests/cases/compiler/clodulesDerivedClasses.ts(9,7): error TS2417: Class static side 'typeof Path' incorrectly extends base class static side 'typeof Shape'.
Types of property 'Utils' are incompatible.
Type 'typeof Utils' is not assignable to type 'typeof Utils'.
Property 'convert' is missing in type 'typeof Utils'.
@ -15,10 +15,10 @@ tests/cases/compiler/clodulesDerivedClasses.ts(9,7): error TS2418: Class static
class Path extends Shape {
~~~~
!!! error TS2418: Class static side 'typeof Path' incorrectly extends base class static side 'typeof Shape':
!!! error TS2418: Types of property 'Utils' are incompatible:
!!! error TS2418: Type 'typeof Utils' is not assignable to type 'typeof Utils':
!!! error TS2418: Property 'convert' is missing in type 'typeof Utils'.
!!! error TS2417: Class static side 'typeof Path' incorrectly extends base class static side 'typeof Shape'.
!!! error TS2417: Types of property 'Utils' are incompatible.
!!! error TS2417: Type 'typeof Utils' is not assignable to type 'typeof Utils'.
!!! error TS2417: Property 'convert' is missing in type 'typeof Utils'.
name: string;
}

View File

@ -1,7 +1,7 @@
tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts(5,1): error TS2323: Type 'string' is not assignable to type 'boolean'.
tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts(8,1): error TS2323: Type 'string' is not assignable to type 'number'.
tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts(11,1): error TS2323: Type 'string' is not assignable to type 'E'.
tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts(14,1): error TS2322: Type 'string' is not assignable to type '{ a: string; }':
tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts(14,1): error TS2323: Type 'string' is not assignable to type '{ a: string; }'.
Property 'a' is missing in type 'String'.
tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts(17,1): error TS2323: Type 'string' is not assignable to type 'void'.
@ -28,8 +28,8 @@ tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmen
var x4: {a: string};
x4 += '';
~~
!!! error TS2322: Type 'string' is not assignable to type '{ a: string; }':
!!! error TS2322: Property 'a' is missing in type 'String'.
!!! error TS2323: Type 'string' is not assignable to type '{ a: string; }'.
!!! error TS2323: Property 'a' is missing in type 'String'.
var x5: void;
x5 += '';

View File

@ -1,9 +1,9 @@
tests/cases/compiler/conditionalExpression1.ts(1,5): error TS2322: Type 'string | number' is not assignable to type 'boolean':
tests/cases/compiler/conditionalExpression1.ts(1,5): error TS2323: Type 'string | number' is not assignable to type 'boolean'.
Type 'string' is not assignable to type 'boolean'.
==== tests/cases/compiler/conditionalExpression1.ts (1 errors) ====
var x: boolean = (true ? 1 : ""); // should be an error
~
!!! error TS2322: Type 'string | number' is not assignable to type 'boolean':
!!! error TS2322: Type 'string' is not assignable to type 'boolean'.
!!! error TS2323: Type 'string | number' is not assignable to type 'boolean'.
!!! error TS2323: Type 'string' is not assignable to type 'boolean'.

View File

@ -1,17 +1,17 @@
tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts(15,5): error TS2322: Type 'A | B' is not assignable to type 'A':
Type 'B' is not assignable to type 'A':
tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts(15,5): error TS2323: Type 'A | B' is not assignable to type 'A'.
Type 'B' is not assignable to type 'A'.
Property 'propertyA' is missing in type 'B'.
tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts(16,5): error TS2322: Type 'A | B' is not assignable to type 'B':
Type 'A' is not assignable to type 'B':
tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts(16,5): error TS2323: Type 'A | B' is not assignable to type 'B'.
Type 'A' is not assignable to type 'B'.
Property 'propertyB' is missing in type 'A'.
tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts(18,5): error TS2322: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => number':
Type '(n: X) => string' is not assignable to type '(t: X) => number':
tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts(18,5): error TS2323: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => number'.
Type '(n: X) => string' is not assignable to type '(t: X) => number'.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts(19,5): error TS2322: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => string':
Type '(m: X) => number' is not assignable to type '(t: X) => string':
tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts(19,5): error TS2323: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => string'.
Type '(m: X) => number' is not assignable to type '(t: X) => string'.
Type 'number' is not assignable to type 'string'.
tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts(20,5): error TS2322: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => boolean':
Type '(m: X) => number' is not assignable to type '(t: X) => boolean':
tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts(20,5): error TS2323: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => boolean'.
Type '(m: X) => number' is not assignable to type '(t: X) => boolean'.
Type 'number' is not assignable to type 'boolean'.
@ -32,27 +32,27 @@ tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithou
//Be contextually typed and and bct is not identical, results in errors that union type is not assignable to target
var result2: A = true ? a : b;
~~~~~~~
!!! error TS2322: Type 'A | B' is not assignable to type 'A':
!!! error TS2322: Type 'B' is not assignable to type 'A':
!!! error TS2322: Property 'propertyA' is missing in type 'B'.
!!! error TS2323: Type 'A | B' is not assignable to type 'A'.
!!! error TS2323: Type 'B' is not assignable to type 'A'.
!!! error TS2323: Property 'propertyA' is missing in type 'B'.
var result3: B = true ? a : b;
~~~~~~~
!!! error TS2322: Type 'A | B' is not assignable to type 'B':
!!! error TS2322: Type 'A' is not assignable to type 'B':
!!! error TS2322: Property 'propertyB' is missing in type 'A'.
!!! error TS2323: Type 'A | B' is not assignable to type 'B'.
!!! error TS2323: Type 'A' is not assignable to type 'B'.
!!! error TS2323: Property 'propertyB' is missing in type 'A'.
var result4: (t: X) => number = true ? (m) => m.propertyX1 : (n) => n.propertyX2;
~~~~~~~
!!! error TS2322: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => number':
!!! error TS2322: Type '(n: X) => string' is not assignable to type '(t: X) => number':
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2323: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => number'.
!!! error TS2323: Type '(n: X) => string' is not assignable to type '(t: X) => number'.
!!! error TS2323: Type 'string' is not assignable to type 'number'.
var result5: (t: X) => string = true ? (m) => m.propertyX1 : (n) => n.propertyX2;
~~~~~~~
!!! error TS2322: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => string':
!!! error TS2322: Type '(m: X) => number' is not assignable to type '(t: X) => string':
!!! error TS2322: Type 'number' is not assignable to type 'string'.
!!! error TS2323: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => string'.
!!! error TS2323: Type '(m: X) => number' is not assignable to type '(t: X) => string'.
!!! error TS2323: Type 'number' is not assignable to type 'string'.
var result6: (t: X) => boolean = true ? (m) => m.propertyX1 : (n) => n.propertyX2;
~~~~~~~
!!! error TS2322: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => boolean':
!!! error TS2322: Type '(m: X) => number' is not assignable to type '(t: X) => boolean':
!!! error TS2322: Type 'number' is not assignable to type 'boolean'.
!!! error TS2323: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => boolean'.
!!! error TS2323: Type '(m: X) => number' is not assignable to type '(t: X) => boolean'.
!!! error TS2323: Type 'number' is not assignable to type 'boolean'.

View File

@ -1,4 +1,4 @@
tests/cases/compiler/conflictingMemberTypesInBases.ts(12,11): error TS2320: Interface 'E' cannot simultaneously extend types 'B' and 'D':
tests/cases/compiler/conflictingMemberTypesInBases.ts(12,11): error TS2320: Interface 'E' cannot simultaneously extend types 'B' and 'D'.
Named properties 'm' of types 'B' and 'D' are not identical.
@ -16,7 +16,7 @@ tests/cases/compiler/conflictingMemberTypesInBases.ts(12,11): error TS2320: Inte
interface E extends B { } // Error here for extending B and D
~
!!! error TS2320: Interface 'E' cannot simultaneously extend types 'B' and 'D':
!!! error TS2320: Interface 'E' cannot simultaneously extend types 'B' and 'D'.
!!! error TS2320: Named properties 'm' of types 'B' and 'D' are not identical.
interface E extends D { } // No duplicate error here

View File

@ -1,4 +1,4 @@
tests/cases/compiler/constraints0.ts(14,9): error TS2343: Type 'B' does not satisfy the constraint 'A':
tests/cases/compiler/constraints0.ts(14,9): error TS2344: Type 'B' does not satisfy the constraint 'A'.
Property 'a' is missing in type 'B'.
@ -18,7 +18,7 @@ tests/cases/compiler/constraints0.ts(14,9): error TS2343: Type 'B' does not sati
var v1: C<A>; // should work
var v2: C<B>; // should not work
~~~~
!!! error TS2343: Type 'B' does not satisfy the constraint 'A':
!!! error TS2343: Property 'a' is missing in type 'B'.
!!! error TS2344: Type 'B' does not satisfy the constraint 'A'.
!!! error TS2344: Property 'a' is missing in type 'B'.
var y = v1.x.a; // 'a' should be of type 'number'

View File

@ -1,6 +1,6 @@
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance.ts(61,15): error TS2429: Interface 'I2' incorrectly extends interface 'Base2':
Types of property 'a' are incompatible:
Type 'new (x: number) => string' is not assignable to type 'new (x: number) => number':
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance.ts(61,15): error TS2430: Interface 'I2' incorrectly extends interface 'Base2'.
Types of property 'a' are incompatible.
Type 'new (x: number) => string' is not assignable to type 'new (x: number) => number'.
Type 'string' is not assignable to type 'number'.
@ -67,10 +67,10 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/construc
// S's
interface I2 extends Base2 {
~~
!!! error TS2429: Interface 'I2' incorrectly extends interface 'Base2':
!!! error TS2429: Types of property 'a' are incompatible:
!!! error TS2429: Type 'new (x: number) => string' is not assignable to type 'new (x: number) => number':
!!! error TS2429: Type 'string' is not assignable to type 'number'.
!!! error TS2430: Interface 'I2' incorrectly extends interface 'Base2'.
!!! error TS2430: Types of property 'a' are incompatible.
!!! error TS2430: Type 'new (x: number) => string' is not assignable to type 'new (x: number) => number'.
!!! error TS2430: Type 'string' is not assignable to type 'number'.
// N's
a: new (x: number) => string; // error because base returns non-void;
}

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