Merge branch 'master' into jsdoc-values-as-namespaces

This commit is contained in:
Nathan Shively-Sanders 2017-11-30 10:34:50 -08:00
commit 69bbfedd63
150 changed files with 2120 additions and 969 deletions

View file

@ -1341,7 +1341,7 @@ namespace ts {
function checkAndReportErrorForUsingTypeAsNamespace(errorLocation: Node, name: __String, meaning: SymbolFlags): boolean {
if (meaning === SymbolFlags.Namespace) {
const symbol = resolveSymbol(resolveName(errorLocation, name, SymbolFlags.Type & ~SymbolFlags.Value, /*nameNotFoundMessage*/undefined, /*nameArg*/ undefined, /*isUse*/ false));
const symbol = resolveSymbol(resolveName(errorLocation, name, SymbolFlags.Type & ~SymbolFlags.Namespace, /*nameNotFoundMessage*/undefined, /*nameArg*/ undefined, /*isUse*/ false));
const parent = errorLocation.parent;
if (symbol) {
if (isQualifiedName(parent)) {
@ -1903,13 +1903,17 @@ namespace ts {
function tryGetMemberInModuleExportsAndProperties(memberName: __String, moduleSymbol: Symbol): Symbol | undefined {
const symbol = tryGetMemberInModuleExports(memberName, moduleSymbol);
if (!symbol) {
const exportEquals = resolveExternalModuleSymbol(moduleSymbol);
if (exportEquals !== moduleSymbol) {
return getPropertyOfType(getTypeOfSymbol(exportEquals), memberName);
}
if (symbol) {
return symbol;
}
return symbol;
const exportEquals = resolveExternalModuleSymbol(moduleSymbol);
if (exportEquals === moduleSymbol) {
return undefined;
}
const type = getTypeOfSymbol(exportEquals);
return type.flags & TypeFlags.Primitive ? undefined : getPropertyOfType(type, memberName);
}
function getExportsOfSymbol(symbol: Symbol): SymbolTable {
@ -4482,7 +4486,7 @@ namespace ts {
else if (jsDocType !== unknownType && declarationType !== unknownType &&
!isTypeIdenticalTo(jsDocType, declarationType) &&
!(symbol.flags & SymbolFlags.JSContainer)) {
errorNextVariableOrPropertyDeclarationMustHaveSameType(symbol.valueDeclaration, jsDocType, declaration, declarationType);
errorNextVariableOrPropertyDeclarationMustHaveSameType(jsDocType, declaration, declarationType);
}
}
else if (!jsDocType) {
@ -6248,12 +6252,12 @@ namespace ts {
function getAllPossiblePropertiesOfTypes(types: Type[]): Symbol[] {
const unionType = getUnionType(types);
if (!(unionType.flags & TypeFlags.Union)) {
return getPropertiesOfType(unionType);
return getAugmentedPropertiesOfType(unionType);
}
const props = createSymbolTable();
for (const memberType of types) {
for (const { escapedName } of getPropertiesOfType(memberType)) {
for (const { escapedName } of getAugmentedPropertiesOfType(memberType)) {
if (!props.has(escapedName)) {
props.set(escapedName, createUnionOrIntersectionProperty(unionType as UnionType, escapedName));
}
@ -9383,9 +9387,7 @@ namespace ts {
!(target.flags & TypeFlags.Union) &&
!isIntersectionConstituent &&
source !== globalObjectType &&
(getPropertiesOfType(source).length > 0 ||
getSignaturesOfType(source, SignatureKind.Call).length > 0 ||
getSignaturesOfType(source, SignatureKind.Construct).length > 0) &&
(getPropertiesOfType(source).length > 0 || typeHasCallOrConstructSignatures(source)) &&
isWeakType(target) &&
!hasCommonProperties(source, target)) {
if (reportErrors) {
@ -10773,8 +10775,7 @@ namespace ts {
*/
function isObjectTypeWithInferableIndex(type: Type) {
return type.symbol && (type.symbol.flags & (SymbolFlags.ObjectLiteral | SymbolFlags.TypeLiteral | SymbolFlags.ValueModule)) !== 0 &&
getSignaturesOfType(type, SignatureKind.Call).length === 0 &&
getSignaturesOfType(type, SignatureKind.Construct).length === 0;
!typeHasCallOrConstructSignatures(type);
}
function createSymbolWithType(source: Symbol, type: Type) {
@ -13051,7 +13052,7 @@ namespace ts {
// must instead be rewritten to point to a temporary variable to avoid issues with the double-bind
// behavior of class names in ES6.
if (declaration.kind === SyntaxKind.ClassDeclaration
&& nodeIsDecorated(declaration)) {
&& nodeIsDecorated(declaration as ClassDeclaration)) {
let container = getContainingClass(node);
while (container !== undefined) {
if (container === declaration && container.name !== node) {
@ -15584,6 +15585,8 @@ namespace ts {
function checkPropertyAccessExpressionOrQualifiedName(node: PropertyAccessExpression | QualifiedName, left: Expression | QualifiedName, right: Identifier) {
let propType: Type;
let leftSymbol = getNodeLinks(left) && getNodeLinks(left).resolvedSymbol;
const leftWasReferenced = leftSymbol && getSymbolLinks(leftSymbol).referenced;
const leftType = checkNonNullExpression(left);
const apparentType = getApparentType(getWidenedType(leftType));
if (isTypeAny(apparentType) || apparentType === silentNeverType) {
@ -15607,6 +15610,13 @@ namespace ts {
else {
checkPropertyNotUsedBeforeDeclaration(prop, node, right);
markPropertyAsReferenced(prop, node, left.kind === SyntaxKind.ThisKeyword);
// Reset the referenced-ness of the LHS expression if this access refers to a const enum or const enum only module
leftSymbol = getNodeLinks(left) && getNodeLinks(left).resolvedSymbol;
if (leftSymbol && !leftWasReferenced && getSymbolLinks(leftSymbol).referenced &&
!(isNonLocalAlias(leftSymbol, /*excludes*/ SymbolFlags.Value) && !isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(prop))
) {
getSymbolLinks(leftSymbol).referenced = undefined;
}
getNodeLinks(node).resolvedSymbol = prop;
checkPropertyAccessibility(node, left, apparentType, prop);
if (assignmentKind) {
@ -18317,6 +18327,12 @@ namespace ts {
(kind & TypeFlags.NonPrimitive && isTypeAssignableTo(source, nonPrimitiveType));
}
function allTypesAssignableToKind(source: Type, kind: TypeFlags, strict?: boolean): boolean {
return source.flags & TypeFlags.Union ?
every((source as UnionType).types, subType => allTypesAssignableToKind(subType, kind, strict)) :
isTypeAssignableToKind(source, kind, strict);
}
function isConstEnumObjectType(type: Type): boolean {
return getObjectFlags(type) & ObjectFlags.Anonymous && type.symbol && isConstEnumSymbol(type.symbol);
}
@ -18334,14 +18350,12 @@ namespace ts {
// and the right operand to be of type Any, a subtype of the 'Function' interface type, or have a call or construct signature.
// The result is always of the Boolean primitive type.
// NOTE: do not raise error if leftType is unknown as related error was already reported
if (!isTypeAny(leftType) && isTypeAssignableToKind(leftType, TypeFlags.Primitive)) {
if (!isTypeAny(leftType) &&
allTypesAssignableToKind(leftType, TypeFlags.Primitive)) {
error(left, Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter);
}
// NOTE: do not raise error if right is unknown as related error was already reported
if (!(isTypeAny(rightType) ||
getSignaturesOfType(rightType, SignatureKind.Call).length ||
getSignaturesOfType(rightType, SignatureKind.Construct).length ||
isTypeSubtypeOf(rightType, globalFunctionType))) {
if (!(isTypeAny(rightType) || typeHasCallOrConstructSignatures(rightType) || isTypeSubtypeOf(rightType, globalFunctionType))) {
error(right, Diagnostics.The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type);
}
return booleanType;
@ -20693,7 +20707,7 @@ namespace ts {
// skip this check for nodes that cannot have decorators. These should have already had an error reported by
// checkGrammarDecorators.
if (!nodeCanBeDecorated(node)) {
if (!nodeCanBeDecorated(node, node.parent, node.parent.parent)) {
return;
}
@ -21440,7 +21454,7 @@ namespace ts {
if (type !== unknownType && declarationType !== unknownType &&
!isTypeIdenticalTo(type, declarationType) &&
!(symbol.flags & SymbolFlags.JSContainer)) {
errorNextVariableOrPropertyDeclarationMustHaveSameType(symbol.valueDeclaration, type, node, declarationType);
errorNextVariableOrPropertyDeclarationMustHaveSameType(type, node, declarationType);
}
if (node.initializer) {
checkTypeAssignableTo(checkExpressionCached(node.initializer), declarationType, node, /*headMessage*/ undefined);
@ -21464,21 +21478,16 @@ namespace ts {
}
}
function errorNextVariableOrPropertyDeclarationMustHaveSameType(firstDeclaration: Declaration, firstType: Type, nextDeclaration: Declaration, nextType: Type): void {
const firstSourceFile = getSourceFileOfNode(firstDeclaration);
const firstSpan = getErrorSpanForNode(firstSourceFile, getNameOfDeclaration(firstDeclaration) || firstDeclaration);
const firstLocation = getLineAndCharacterOfPosition(firstSourceFile, firstSpan.start);
const firstLocationDescription = firstSourceFile.fileName + " " + firstLocation.line + ":" + firstLocation.character;
function errorNextVariableOrPropertyDeclarationMustHaveSameType(firstType: Type, nextDeclaration: Declaration, nextType: Type): void {
const nextDeclarationName = getNameOfDeclaration(nextDeclaration);
const message = nextDeclaration.kind === SyntaxKind.PropertyDeclaration || nextDeclaration.kind === SyntaxKind.PropertySignature
? Diagnostics.Subsequent_property_declarations_must_have_the_same_type_Property_0_has_type_1_at_2_but_here_has_type_3
: Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_has_type_1_at_2_but_here_has_type_3;
? Diagnostics.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2
: Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2;
error(
nextDeclarationName,
message,
declarationNameToString(nextDeclarationName),
typeToString(firstType),
firstLocationDescription,
typeToString(nextType));
}
@ -22053,17 +22062,16 @@ namespace ts {
if (func) {
const signature = getSignatureFromDeclaration(func);
const returnType = getReturnTypeOfSignature(signature);
const functionFlags = getFunctionFlags(func);
if (functionFlags & FunctionFlags.Generator) { // AsyncGenerator function or Generator function
// A generator does not need its return expressions checked against its return type.
// Instead, the yield expressions are checked against the element type.
// TODO: Check return expressions of generators when return type tracking is added
// for generators.
return;
}
if (strictNullChecks || node.expression || returnType.flags & TypeFlags.Never) {
const exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType;
const functionFlags = getFunctionFlags(func);
if (functionFlags & FunctionFlags.Generator) { // AsyncGenerator function or Generator function
// A generator does not need its return expressions checked against its return type.
// Instead, the yield expressions are checked against the element type.
// TODO: Check return expressions of generators when return type tracking is added
// for generators.
return;
}
if (func.kind === SyntaxKind.SetAccessor) {
if (node.expression) {
error(node, Diagnostics.Setters_cannot_return_a_value);
@ -24427,7 +24435,7 @@ namespace ts {
function getAugmentedPropertiesOfType(type: Type): Symbol[] {
type = getApparentType(type);
const propsByName = createSymbolTable(getPropertiesOfType(type));
if (getSignaturesOfType(type, SignatureKind.Call).length || getSignaturesOfType(type, SignatureKind.Construct).length) {
if (typeHasCallOrConstructSignatures(type)) {
forEach(getPropertiesOfType(globalFunctionType), p => {
if (!propsByName.has(p.escapedName)) {
propsByName.set(p.escapedName, p);
@ -24437,6 +24445,10 @@ namespace ts {
return getNamedMembers(propsByName);
}
function typeHasCallOrConstructSignatures(type: Type): boolean {
return ts.typeHasCallOrConstructSignatures(type, checker);
}
function getRootSymbols(symbol: Symbol): Symbol[] {
if (getCheckFlags(symbol) & CheckFlags.Synthetic) {
const symbols: Symbol[] = [];
@ -24696,6 +24708,11 @@ namespace ts {
if (symbol && getSymbolLinks(symbol).referenced) {
return true;
}
const target = getSymbolLinks(symbol).target;
if (target && getModifierFlags(node) & ModifierFlags.Export && target.flags & SymbolFlags.Value) {
// An `export import ... =` of a value symbol is always considered referenced
return true;
}
}
if (checkChildren) {
@ -25202,7 +25219,7 @@ namespace ts {
if (!node.decorators) {
return false;
}
if (!nodeCanBeDecorated(node)) {
if (!nodeCanBeDecorated(node, node.parent, node.parent.parent)) {
if (node.kind === SyntaxKind.MethodDeclaration && !nodeIsPresent((<MethodDeclaration>node).body)) {
return grammarErrorOnFirstToken(node, Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload);
}

View file

@ -2758,6 +2758,12 @@ namespace ts {
VeryAggressive = 3,
}
/**
* Safer version of `Function` which should not be called.
* Every function should be assignable to this, but this should not be assignable to every function.
*/
export type AnyFunction = (...args: never[]) => void;
export namespace Debug {
export let currentAssertionLevel = AssertionLevel.None;
export let isDebugging = false;
@ -2766,7 +2772,7 @@ namespace ts {
return currentAssertionLevel >= level;
}
export function assert(expression: boolean, message?: string, verboseDebugInfo?: string | (() => string), stackCrawlMark?: Function): void {
export function assert(expression: boolean, message?: string, verboseDebugInfo?: string | (() => string), stackCrawlMark?: AnyFunction): void {
if (!expression) {
if (verboseDebugInfo) {
message += "\r\nVerbose Debug Information: " + (typeof verboseDebugInfo === "string" ? verboseDebugInfo : verboseDebugInfo());
@ -2800,7 +2806,7 @@ namespace ts {
}
}
export function fail(message?: string, stackCrawlMark?: Function): never {
export function fail(message?: string, stackCrawlMark?: AnyFunction): never {
debugger;
const e = new Error(message ? `Debug Failure. ${message}` : "Debug Failure.");
if ((<any>Error).captureStackTrace) {
@ -2809,11 +2815,11 @@ namespace ts {
throw e;
}
export function assertNever(member: never, message?: string, stackCrawlMark?: Function): never {
export function assertNever(member: never, message?: string, stackCrawlMark?: AnyFunction): never {
return fail(message || `Illegal value: ${member}`, stackCrawlMark || assertNever);
}
export function getFunctionName(func: Function) {
export function getFunctionName(func: AnyFunction) {
if (typeof func !== "function") {
return "";
}

View file

@ -1344,7 +1344,7 @@
"category": "Error",
"code": 2402
},
"Subsequent variable declarations must have the same type. Variable '{0}' has type '{1}' at {2}, but here has type '{3}'.": {
"Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.": {
"category": "Error",
"code": 2403
},
@ -2264,7 +2264,7 @@
"category": "Error",
"code": 2716
},
"Subsequent property declarations must have the same type. Property '{0}' has type '{1}' at {2}, but here has type '{3}'.": {
"Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'.": {
"category": "Error",
"code": 2717
},
@ -2606,7 +2606,7 @@
"category": "Error",
"code": 4102
},
"The current host does not support the '{0}' option.": {
"category": "Error",
"code": 5001

View file

@ -932,7 +932,7 @@ namespace ts {
return value;
}
function scanString(allowEscapes = true): string {
function scanString(jsxAttributeString = false): string {
const quote = text.charCodeAt(pos);
pos++;
let result = "";
@ -950,13 +950,13 @@ namespace ts {
pos++;
break;
}
if (ch === CharacterCodes.backslash && allowEscapes) {
if (ch === CharacterCodes.backslash && !jsxAttributeString) {
result += text.substring(start, pos);
result += scanEscapeSequence();
start = pos;
continue;
}
if (isLineBreak(ch)) {
if (isLineBreak(ch) && !jsxAttributeString) {
result += text.substring(start, pos);
tokenFlags |= TokenFlags.Unterminated;
error(Diagnostics.Unterminated_string_literal);
@ -1811,7 +1811,7 @@ namespace ts {
switch (text.charCodeAt(pos)) {
case CharacterCodes.doubleQuote:
case CharacterCodes.singleQuote:
tokenValue = scanString(/*allowEscapes*/ false);
tokenValue = scanString(/*jsxAttributeString*/ true);
return token = SyntaxKind.StringLiteral;
default:
// If this scans anything other than `{`, it's a parse error.

View file

@ -6,6 +6,7 @@
namespace ts {
export function transformJsx(context: TransformationContext) {
const compilerOptions = context.getCompilerOptions();
let currentSourceFile: SourceFile;
return transformSourceFile;
@ -19,6 +20,7 @@ namespace ts {
return node;
}
currentSourceFile = node;
const visited = visitEachChild(node, visitor, context);
addEmitHelpers(visited, context.readEmitHelpers());
return visited;
@ -167,8 +169,11 @@ namespace ts {
return createTrue();
}
else if (node.kind === SyntaxKind.StringLiteral) {
const decoded = tryDecodeEntities((<StringLiteral>node).text);
return decoded ? setTextRange(createLiteral(decoded), node) : node;
// Always recreate the literal to escape any escape sequences or newlines which may be in the original jsx string and which
// Need to be escaped to be handled correctly in a normal string
const literal = createLiteral(tryDecodeEntities((<StringLiteral>node).text) || (<StringLiteral>node).text);
literal.singleQuote = (node as StringLiteral).singleQuote !== undefined ? (node as StringLiteral).singleQuote : !isStringDoubleQuoted(node as StringLiteral, currentSourceFile);
return setTextRange(literal, node);
}
else if (node.kind === SyntaxKind.JsxExpression) {
if (node.expression === undefined) {

View file

@ -1261,7 +1261,7 @@ namespace ts {
* the class.
*/
function getDecoratedClassElements(node: ClassExpression | ClassDeclaration, isStatic: boolean): ReadonlyArray<ClassElement> {
return filter(node.members, isStatic ? isStaticDecoratedClassElement : isInstanceDecoratedClassElement);
return filter(node.members, isStatic ? m => isStaticDecoratedClassElement(m, node) : m => isInstanceDecoratedClassElement(m, node));
}
/**
@ -1270,8 +1270,8 @@ namespace ts {
*
* @param member The class member.
*/
function isStaticDecoratedClassElement(member: ClassElement) {
return isDecoratedClassElement(member, /*isStatic*/ true);
function isStaticDecoratedClassElement(member: ClassElement, parent: ClassLikeDeclaration) {
return isDecoratedClassElement(member, /*isStatic*/ true, parent);
}
/**
@ -1280,8 +1280,8 @@ namespace ts {
*
* @param member The class member.
*/
function isInstanceDecoratedClassElement(member: ClassElement) {
return isDecoratedClassElement(member, /*isStatic*/ false);
function isInstanceDecoratedClassElement(member: ClassElement, parent: ClassLikeDeclaration) {
return isDecoratedClassElement(member, /*isStatic*/ false, parent);
}
/**
@ -1290,8 +1290,8 @@ namespace ts {
*
* @param member The class member.
*/
function isDecoratedClassElement(member: ClassElement, isStatic: boolean) {
return nodeOrChildIsDecorated(member)
function isDecoratedClassElement(member: ClassElement, isStatic: boolean, parent: ClassLikeDeclaration) {
return nodeOrChildIsDecorated(member, parent)
&& isStatic === hasModifier(member, ModifierFlags.Static);
}

View file

@ -966,7 +966,7 @@ namespace ts {
kind: SyntaxKind.GetAccessor;
parent?: ClassDeclaration | ClassExpression | ObjectLiteralExpression;
name: PropertyName;
body: FunctionBody;
body?: FunctionBody;
}
// See the comment on MethodDeclaration for the intuition behind SetAccessorDeclaration being a
@ -975,7 +975,7 @@ namespace ts {
kind: SyntaxKind.SetAccessor;
parent?: ClassDeclaration | ClassExpression | ObjectLiteralExpression;
name: PropertyName;
body: FunctionBody;
body?: FunctionBody;
}
export type AccessorDeclaration = GetAccessorDeclaration | SetAccessorDeclaration;
@ -2766,7 +2766,10 @@ namespace ts {
getAmbientModules(): Symbol[];
tryGetMemberInModuleExports(memberName: string, moduleSymbol: Symbol): Symbol | undefined;
/** Unlike `tryGetMemberInModuleExports`, this includes properties of an `export =` value. */
/**
* Unlike `tryGetMemberInModuleExports`, this includes properties of an `export =` value.
* Does *not* return properties of primitive types.
*/
/* @internal */ tryGetMemberInModuleExportsAndProperties(memberName: string, moduleSymbol: Symbol): Symbol | undefined;
getApparentType(type: Type): Type;
getSuggestionForNonexistentProperty(node: Identifier, containingType: Type): string | undefined;

View file

@ -1205,7 +1205,10 @@ namespace ts {
return (<CallExpression | Decorator>node).expression;
}
export function nodeCanBeDecorated(node: Node): boolean {
export function nodeCanBeDecorated(node: ClassDeclaration): true;
export function nodeCanBeDecorated(node: ClassElement, parent: Node): boolean;
export function nodeCanBeDecorated(node: Node, parent: Node, grandparent: Node): boolean;
export function nodeCanBeDecorated(node: Node, parent?: Node, grandparent?: Node): boolean {
switch (node.kind) {
case SyntaxKind.ClassDeclaration:
// classes are valid targets
@ -1213,43 +1216,51 @@ namespace ts {
case SyntaxKind.PropertyDeclaration:
// property declarations are valid if their parent is a class declaration.
return node.parent.kind === SyntaxKind.ClassDeclaration;
return parent.kind === SyntaxKind.ClassDeclaration;
case SyntaxKind.GetAccessor:
case SyntaxKind.SetAccessor:
case SyntaxKind.MethodDeclaration:
// if this method has a body and its parent is a class declaration, this is a valid target.
return (<FunctionLikeDeclaration>node).body !== undefined
&& node.parent.kind === SyntaxKind.ClassDeclaration;
&& parent.kind === SyntaxKind.ClassDeclaration;
case SyntaxKind.Parameter:
// if the parameter's parent has a body and its grandparent is a class declaration, this is a valid target;
return (<FunctionLikeDeclaration>node.parent).body !== undefined
&& (node.parent.kind === SyntaxKind.Constructor
|| node.parent.kind === SyntaxKind.MethodDeclaration
|| node.parent.kind === SyntaxKind.SetAccessor)
&& node.parent.parent.kind === SyntaxKind.ClassDeclaration;
return (<FunctionLikeDeclaration>parent).body !== undefined
&& (parent.kind === SyntaxKind.Constructor
|| parent.kind === SyntaxKind.MethodDeclaration
|| parent.kind === SyntaxKind.SetAccessor)
&& grandparent.kind === SyntaxKind.ClassDeclaration;
}
return false;
}
export function nodeIsDecorated(node: Node): boolean {
export function nodeIsDecorated(node: ClassDeclaration): boolean;
export function nodeIsDecorated(node: ClassElement, parent: Node): boolean;
export function nodeIsDecorated(node: Node, parent: Node, grandparent: Node): boolean;
export function nodeIsDecorated(node: Node, parent?: Node, grandparent?: Node): boolean {
return node.decorators !== undefined
&& nodeCanBeDecorated(node);
&& nodeCanBeDecorated(node, parent, grandparent);
}
export function nodeOrChildIsDecorated(node: Node): boolean {
return nodeIsDecorated(node) || childIsDecorated(node);
export function nodeOrChildIsDecorated(node: ClassDeclaration): boolean;
export function nodeOrChildIsDecorated(node: ClassElement, parent: Node): boolean;
export function nodeOrChildIsDecorated(node: Node, parent: Node, grandparent: Node): boolean;
export function nodeOrChildIsDecorated(node: Node, parent?: Node, grandparent?: Node): boolean {
return nodeIsDecorated(node, parent, grandparent) || childIsDecorated(node, parent);
}
export function childIsDecorated(node: Node): boolean {
export function childIsDecorated(node: ClassDeclaration): boolean;
export function childIsDecorated(node: Node, parent: Node): boolean;
export function childIsDecorated(node: Node, parent?: Node): boolean {
switch (node.kind) {
case SyntaxKind.ClassDeclaration:
return forEach((<ClassDeclaration>node).members, nodeOrChildIsDecorated);
return forEach((<ClassDeclaration>node).members, m => nodeOrChildIsDecorated(m, node, parent));
case SyntaxKind.MethodDeclaration:
case SyntaxKind.SetAccessor:
return forEach((<FunctionLikeDeclaration>node).parameters, nodeIsDecorated);
return forEach((<FunctionLikeDeclaration>node).parameters, p => nodeIsDecorated(p, node, parent));
}
}
@ -1965,6 +1976,11 @@ namespace ts {
return isKeyword(token) && !isContextualKeyword(token);
}
export function isStringANonContextualKeyword(name: string) {
const token = stringToToken(name);
return token !== undefined && isNonContextualKeyword(token);
}
export function isTrivia(token: SyntaxKind) {
return SyntaxKind.FirstTriviaToken <= token && token <= SyntaxKind.LastTriviaToken;
}
@ -3660,6 +3676,10 @@ namespace ts {
directory = parentPath;
}
}
export function typeHasCallOrConstructSignatures(type: Type, checker: TypeChecker) {
return checker.getSignaturesOfType(type, SignatureKind.Call).length !== 0 || checker.getSignaturesOfType(type, SignatureKind.Construct).length !== 0;
}
}
namespace ts {

View file

@ -3081,7 +3081,7 @@ Actual: ${stringify(fullActual)}`);
const itemsString = items.map(item => stringify({ name: item.name, source: item.source, kind: item.kind })).join(",\n");
this.raiseError(`Expected "${stringify({ entryId, text, documentation, kind })}" to be in list [${itemsString}]`);
}
else if (matchingItems.length > 1 && !(options && options.allowDuplicate)) {
else if (matchingItems.length > 1) {
this.raiseError(`Found duplicate completion items for ${stringify(entryId)}`);
}
const item = matchingItems[0];
@ -4558,7 +4558,6 @@ namespace FourSlashInterface {
export interface VerifyCompletionListContainsOptions extends ts.GetCompletionsAtPositionOptions {
sourceDisplay: string;
allowDuplicate: boolean; // TODO: GH#20042
}
export interface NewContentOptions {

View file

@ -135,7 +135,7 @@ namespace Utils {
return content;
}
export function memoize<T extends Function>(f: T, memoKey: (...anything: any[]) => string): T {
export function memoize<T extends ts.AnyFunction>(f: T, memoKey: (...anything: any[]) => string): T {
const cache = ts.createMap<any>();
return <any>(function(this: any, ...args: any[]) {

View file

@ -364,7 +364,7 @@ namespace Playback {
};
}
function recordReplay<T extends Function>(original: T, underlying: any) {
function recordReplay<T extends ts.AnyFunction>(original: T, underlying: any) {
function createWrapper(record: T, replay: T): T {
// tslint:disable-next-line only-arrow-functions
return <any>(function () {

View file

@ -2,7 +2,10 @@ namespace Harness.Parallel.Worker {
let errors: ErrorInfo[] = [];
let passing = 0;
type Executor = {name: string, callback: Function, kind: "suite" | "test"} | never;
type MochaCallback = (this: Mocha.ISuiteCallbackContext, done: MochaDone) => void;
type Callable = () => void;
type Executor = {name: string, callback: MochaCallback, kind: "suite" | "test"} | never;
function resetShimHarnessAndExecute(runner: RunnerBase) {
errors = [];
@ -15,7 +18,7 @@ namespace Harness.Parallel.Worker {
}
let beforeEachFunc: Function;
let beforeEachFunc: Callable;
const namestack: string[] = [];
let testList: Executor[] = [];
function shimMochaHarness() {
@ -33,19 +36,19 @@ namespace Harness.Parallel.Worker {
}) as Mocha.ITestDefinition;
}
function executeSuiteCallback(name: string, callback: Function) {
function executeSuiteCallback(name: string, callback: MochaCallback) {
const fakeContext: Mocha.ISuiteCallbackContext = {
retries() { return this; },
slow() { return this; },
timeout() { return this; },
};
namestack.push(name);
let beforeFunc: Function;
(before as any) = (cb: Function) => beforeFunc = cb;
let afterFunc: Function;
(after as any) = (cb: Function) => afterFunc = cb;
let beforeFunc: Callable;
(before as any) = (cb: Callable) => beforeFunc = cb;
let afterFunc: Callable;
(after as any) = (cb: Callable) => afterFunc = cb;
const savedBeforeEach = beforeEachFunc;
(beforeEach as any) = (cb: Function) => beforeEachFunc = cb;
(beforeEach as any) = (cb: Callable) => beforeEachFunc = cb;
const savedTestList = testList;
testList = [];
@ -90,7 +93,7 @@ namespace Harness.Parallel.Worker {
}
}
function executeCallback(name: string, callback: Function, kind: "suite" | "test") {
function executeCallback(name: string, callback: MochaCallback, kind: "suite" | "test") {
if (kind === "suite") {
executeSuiteCallback(name, callback);
}
@ -99,7 +102,7 @@ namespace Harness.Parallel.Worker {
}
}
function executeTestCallback(name: string, callback: Function) {
function executeTestCallback(name: string, callback: MochaCallback) {
const fakeContext: Mocha.ITestCallbackContext = {
skip() { return this; },
timeout() { return this; },
@ -238,7 +241,7 @@ namespace Harness.Parallel.Worker {
}
const unittest: "unittest" = "unittest";
let unitTests: {[name: string]: Function};
let unitTests: {[name: string]: MochaCallback};
function collectUnitTestsIfNeeded() {
if (!unitTests && testList.length) {
unitTests = {};

View file

@ -54,7 +54,7 @@ namespace ts.server {
}
// Disable sourcemap support for the duration of the test, as sourcemapping the errors generated during this test is slow and not something we care to test
let oldPrepare: Function;
let oldPrepare: AnyFunction;
before(() => {
oldPrepare = (Error as any).prepareStackTrace;
delete (Error as any).prepareStackTrace;
@ -402,7 +402,7 @@ namespace ts.server {
describe("exceptions", () => {
// Disable sourcemap support for the duration of the test, as sourcemapping the errors generated during this test is slow and not something we care to test
let oldPrepare: Function;
let oldPrepare: AnyFunction;
before(() => {
oldPrepare = (Error as any).prepareStackTrace;
delete (Error as any).prepareStackTrace;

View file

@ -224,6 +224,32 @@ namespace ts {
}
}
});
// https://github.com/Microsoft/TypeScript/issues/17384
testBaseline("transformAddDecoratedNode", () => {
return ts.transpileModule("", {
transformers: {
before: [transformAddDecoratedNode],
},
compilerOptions: {
target: ts.ScriptTarget.ES5,
newLine: NewLineKind.CarriageReturnLineFeed,
}
}).outputText;
function transformAddDecoratedNode(_context: ts.TransformationContext) {
return (sourceFile: ts.SourceFile): ts.SourceFile => {
return visitNode(sourceFile);
};
function visitNode(sf: ts.SourceFile) {
// produce `class Foo { @Bar baz() {} }`;
const classDecl = ts.createClassDeclaration([], [], "Foo", /*typeParameters*/ undefined, /*heritageClauses*/ undefined, [
ts.createMethod([ts.createDecorator(ts.createIdentifier("Bar"))], [], /**/ undefined, "baz", /**/ undefined, /**/ undefined, [], /**/ undefined, ts.createBlock([]))
]);
return ts.updateSourceFileNode(sf, [classDecl]);
}
}
});
});
}

View file

@ -4737,7 +4737,7 @@ namespace ts.projectSystem {
describe("cancellationToken", () => {
// Disable sourcemap support for the duration of the test, as sourcemapping the errors generated during this test is slow and not something we care to test
let oldPrepare: Function;
let oldPrepare: ts.AnyFunction;
before(() => {
oldPrepare = (Error as any).prepareStackTrace;
delete (Error as any).prepareStackTrace;

View file

@ -6579,20 +6579,17 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Subsequent_property_declarations_must_have_the_same_type_Property_0_has_type_1_at_2_but_here_has_typ_2717" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Subsequent property declarations must have the same type. Property '{0}' has type '{1}' at {2}, but here has type '{3}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[后续属性声明必须属于同一类型。属性“{0}”在“{2}”中必须为类型“{1}”,但此处却为类型“{3}”。]]></Val>
</Tgt>
<Val><![CDATA[Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'.]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Subsequent_variable_declarations_must_have_the_same_type_Variable_0_has_type_1_at_2_but_here_has_typ_2403" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_t_2403" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Subsequent variable declarations must have the same type. Variable '{0}' has type '{1}' at {2}, but here has type '{3}'.]]></Val>
<Val><![CDATA[Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[后续变量声明必须属于同一类型。变量 "{0}" 在“{2}”中必须为类型“{1}”,但此处却为类型“{3}”。]]></Val>
<Val><![CDATA[后续变量声明必须属于同一类型。变量“{0}”必须属于类型“{1}”,但此处却为类型“{2}”。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />

View file

@ -6579,20 +6579,17 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Subsequent_property_declarations_must_have_the_same_type_Property_0_has_type_1_at_2_but_here_has_typ_2717" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Subsequent property declarations must have the same type. Property '{0}' has type '{1}' at {2}, but here has type '{3}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[後續的屬性宣告必須具有相同的類型。屬性 '{0}' 在 {2} 具有型別 '{1}',但在這裡具有型別 '{3}'。]]></Val>
</Tgt>
<Val><![CDATA[Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'.]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Subsequent_variable_declarations_must_have_the_same_type_Variable_0_has_type_1_at_2_but_here_has_typ_2403" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_t_2403" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Subsequent variable declarations must have the same type. Variable '{0}' has type '{1}' at {2}, but here has type '{3}'.]]></Val>
<Val><![CDATA[Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[後續的變數宣告必須具有相同的類型。變數 '{0}' 必須在 {2} 有類型 '{1}' 但卻是 '{3}'。]]></Val>
<Val><![CDATA[後續的變數宣告必須具有相同的類型。變數 '{0}' 的類型必須是 '{1}' 但卻是 '{2}'。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />

View file

@ -318,6 +318,9 @@
<Item ItemId=";A_definite_assignment_assertion_is_not_permitted_in_this_context_1255" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A definite assignment assertion '!' is not permitted in this context.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Určitý kontrolní výraz přiřazení '!' není v tomto kontextu povolený.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@ -3774,32 +3777,11 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Import_0_from_1_90013" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Import_0_from_module_1_90013" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Import '{0}' from "{1}".]]></Val>
<Val><![CDATA[Import '{0}' from module "{1}".]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Importujte {0} z: {1}.]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Import {0} from {1}.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Import_0_require_1_95015" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Import '{0}' = require("{1}").]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Importovat {0} = vyžadovat({1})]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Import_Asterisk_as_0_from_1_95016" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Import * as '{0}' from "{1}".]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Importovat * jako {0} z {1}]]></Val>
<Val><![CDATA[Import {0} z modulu {1}]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@ -6606,20 +6588,17 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Subsequent_property_declarations_must_have_the_same_type_Property_0_has_type_1_at_2_but_here_has_typ_2717" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Subsequent property declarations must have the same type. Property '{0}' has type '{1}' at {2}, but here has type '{3}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Deklarace následných vlastností musí obsahovat stejný typ. Vlastnost {0} musí být typu {1} v {2}, ale tady je typu {3}.]]></Val>
</Tgt>
<Val><![CDATA[Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'.]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Subsequent_variable_declarations_must_have_the_same_type_Variable_0_has_type_1_at_2_but_here_has_typ_2403" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_t_2403" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Subsequent variable declarations must have the same type. Variable '{0}' has type '{1}' at {2}, but here has type '{3}'.]]></Val>
<Val><![CDATA[Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Deklarace následných proměnných musí obsahovat stejný typ. Proměnná {0} musí být typu {1} v {2}, ale tady je typu {3}.]]></Val>
<Val><![CDATA[Deklarace následných proměnných musí obsahovat stejný typ. Proměnná {0} musí být typu {1}, ale tady je typu {2}.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />

View file

@ -309,6 +309,9 @@
<Item ItemId=";A_definite_assignment_assertion_is_not_permitted_in_this_context_1255" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A definite assignment assertion '!' is not permitted in this context.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Eine definitive Zuweisungsassertion "!" ist in diesem Kontext nicht zulässig.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@ -3753,32 +3756,11 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Import_0_from_1_90013" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Import_0_from_module_1_90013" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Import '{0}' from "{1}".]]></Val>
<Val><![CDATA[Import '{0}' from module "{1}".]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Importieren Sie "{0}" aus "{1}".]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Import {0} from {1}.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Import_0_require_1_95015" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Import '{0}' = require("{1}").]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA["{0}" importieren = require("{1}").]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Import_Asterisk_as_0_from_1_95016" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Import * as '{0}' from "{1}".]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[* als "{0}" aus "{1}" importieren]]></Val>
<Val><![CDATA[Import von "{0}" aus Modul "{1}".]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@ -6576,20 +6558,17 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Subsequent_property_declarations_must_have_the_same_type_Property_0_has_type_1_at_2_but_here_has_typ_2717" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Subsequent property declarations must have the same type. Property '{0}' has type '{1}' at {2}, but here has type '{3}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Nachfolgende Eigenschaftendeklarationen müssen den gleichen Typ aufweisen. Die Eigenschaft "{0}" muss bei "{2}" den Typ "{1}" aufweisen, ist hier aber vom Typ "{3}".]]></Val>
</Tgt>
<Val><![CDATA[Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'.]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Subsequent_variable_declarations_must_have_the_same_type_Variable_0_has_type_1_at_2_but_here_has_typ_2403" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_t_2403" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Subsequent variable declarations must have the same type. Variable '{0}' has type '{1}' at {2}, but here has type '{3}'.]]></Val>
<Val><![CDATA[Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Nachfolgende Variablendeklarationen müssen den gleichen Typ aufweisen. Die Variable "{0}" muss bei "{2}" den Typ "{1}" aufweisen, ist hier aber vom Typ "{3}".]]></Val>
<Val><![CDATA[Nachfolgende Variablendeklarationen müssen den gleichen Typ aufweisen. Die Variable "{0}" muss den Typ "{1}" aufweisen, ist hier aber vom Typ "{2}".]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />

View file

@ -6588,20 +6588,17 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Subsequent_property_declarations_must_have_the_same_type_Property_0_has_type_1_at_2_but_here_has_typ_2717" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Subsequent property declarations must have the same type. Property '{0}' has type '{1}' at {2}, but here has type '{3}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Las declaraciones de propiedad siguientes deben tener el mismo tipo. La propiedad "{0}" tiene el tipo "{1}" en {2}, pero aquí tiene el tipo "{3}".]]></Val>
</Tgt>
<Val><![CDATA[Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'.]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Subsequent_variable_declarations_must_have_the_same_type_Variable_0_has_type_1_at_2_but_here_has_typ_2403" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_t_2403" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Subsequent variable declarations must have the same type. Variable '{0}' has type '{1}' at {2}, but here has type '{3}'.]]></Val>
<Val><![CDATA[Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Las declaraciones de variable subsiguientes deben tener el mismo tipo. La variable "{0}" tiene el tipo "{1}" en {2}, pero aquí tiene el tipo "{3}".]]></Val>
<Val><![CDATA[Las declaraciones de variable subsiguientes deben tener el mismo tipo. La variable '{0}' debe ser de tipo '{1}', pero aquí tiene el tipo '{2}'.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />

View file

@ -318,6 +318,9 @@
<Item ItemId=";A_definite_assignment_assertion_is_not_permitted_in_this_context_1255" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A definite assignment assertion '!' is not permitted in this context.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Une assertion d'affectation définie ' !' n'est pas autorisée dans ce contexte.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@ -3774,32 +3777,11 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Import_0_from_1_90013" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Import_0_from_module_1_90013" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Import '{0}' from "{1}".]]></Val>
<Val><![CDATA[Import '{0}' from module "{1}".]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Importez '{0}' à partir de "{1}".]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Import {0} from {1}.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Import_0_require_1_95015" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Import '{0}' = require("{1}").]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Importer '{0}' = require("{1}").]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Import_Asterisk_as_0_from_1_95016" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Import * as '{0}' from "{1}".]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Importer * en tant que '{0}' à partir de "{1}".]]></Val>
<Val><![CDATA[Importez '{0}' à partir du module "{1}".]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@ -6606,20 +6588,17 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Subsequent_property_declarations_must_have_the_same_type_Property_0_has_type_1_at_2_but_here_has_typ_2717" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Subsequent property declarations must have the same type. Property '{0}' has type '{1}' at {2}, but here has type '{3}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Les déclarations de propriétés ultérieures doivent avoir le même type. La propriété '{0}' a le type '{1}' au niveau de {2}, mais ici elle a le type '{3}'.]]></Val>
</Tgt>
<Val><![CDATA[Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'.]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Subsequent_variable_declarations_must_have_the_same_type_Variable_0_has_type_1_at_2_but_here_has_typ_2403" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_t_2403" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Subsequent variable declarations must have the same type. Variable '{0}' has type '{1}' at {2}, but here has type '{3}'.]]></Val>
<Val><![CDATA[Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Les déclarations de variables ultérieures doivent avoir le même type. La variable '{0}' a le type '{1}' au niveau de {2}, mais ici elle a le type '{3}'.]]></Val>
<Val><![CDATA[Les déclarations de variable ultérieures doivent avoir le même type. La variable '{0}' doit être de type '{1}', mais elle a ici le type '{2}'.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />

View file

@ -6579,20 +6579,17 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Subsequent_property_declarations_must_have_the_same_type_Property_0_has_type_1_at_2_but_here_has_typ_2717" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Subsequent property declarations must have the same type. Property '{0}' has type '{1}' at {2}, but here has type '{3}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Le dichiarazioni di proprietà successive devono essere dello stesso tipo. La proprietà '{0}' è di tipo '{1}' alla posizione {2}, ma qui è di tipo '{3}'.]]></Val>
</Tgt>
<Val><![CDATA[Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'.]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Subsequent_variable_declarations_must_have_the_same_type_Variable_0_has_type_1_at_2_but_here_has_typ_2403" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_t_2403" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Subsequent variable declarations must have the same type. Variable '{0}' has type '{1}' at {2}, but here has type '{3}'.]]></Val>
<Val><![CDATA[Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Le dichiarazioni di variabili successive devono essere dello stesso tipo. La variabile '{0}' è di tipo '{1}' alla posizione {2}, ma qui è di tipo '{3}'.]]></Val>
<Val><![CDATA[Le dichiarazioni di variabili successive devono essere dello stesso tipo. La variabile '{0}' deve essere di tipo '{1}', mentre è di tipo '{2}'.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />

View file

@ -6579,20 +6579,17 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Subsequent_property_declarations_must_have_the_same_type_Property_0_has_type_1_at_2_but_here_has_typ_2717" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Subsequent property declarations must have the same type. Property '{0}' has type '{1}' at {2}, but here has type '{3}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[後続のプロパティ宣言は同じ型でなければなりません。プロパティ '{0}' の型は {2} では '{1}' ですが、ここでは型が '{3}' になっています。]]></Val>
</Tgt>
<Val><![CDATA[Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'.]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Subsequent_variable_declarations_must_have_the_same_type_Variable_0_has_type_1_at_2_but_here_has_typ_2403" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_t_2403" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Subsequent variable declarations must have the same type. Variable '{0}' has type '{1}' at {2}, but here has type '{3}'.]]></Val>
<Val><![CDATA[Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[後続の変数宣言は同じ型でなければなりません。変数 '{0}' の型は {2} では '{1}' ですが、ここでは型が '{3}' になっています。]]></Val>
<Val><![CDATA[後続の変数宣言は同じ型でなければなりません。変数 '{0}' の型は '{1}' である必要がありますが、'{2}' になっています。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />

View file

@ -6579,20 +6579,17 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Subsequent_property_declarations_must_have_the_same_type_Property_0_has_type_1_at_2_but_here_has_typ_2717" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Subsequent property declarations must have the same type. Property '{0}' has type '{1}' at {2}, but here has type '{3}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[후속 속성 선언에 같은 형식이 있어야 합니다. '{0}' 속성이 {2}에서 '{1}' 형식이어야 하는데 여기에는 '{3}' 형식이 있습니다.]]></Val>
</Tgt>
<Val><![CDATA[Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'.]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Subsequent_variable_declarations_must_have_the_same_type_Variable_0_has_type_1_at_2_but_here_has_typ_2403" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_t_2403" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Subsequent variable declarations must have the same type. Variable '{0}' has type '{1}' at {2}, but here has type '{3}'.]]></Val>
<Val><![CDATA[Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[후속 변수 선언에 같은 형식이 있어야 합니다. '{0}' 변수가 {2}에서 '{1}' 형식이어야 하는데 여기에는 '{3}' 형식이 있습니다.]]></Val>
<Val><![CDATA[후속 변수 선언에 같은 형식이 있어야 합니다. '{0}' 변수가 '{1}' 형식이어야 하는데 여기에는 '{2}' 형식이 있습니다.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />

View file

@ -302,6 +302,9 @@
<Item ItemId=";A_definite_assignment_assertion_is_not_permitted_in_this_context_1255" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A definite assignment assertion '!' is not permitted in this context.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Asercja określonego przydziału „!” nie jest dozwolona w tym kontekście.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@ -3746,32 +3749,11 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Import_0_from_1_90013" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Import_0_from_module_1_90013" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Import '{0}' from "{1}".]]></Val>
<Val><![CDATA[Import '{0}' from module "{1}".]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Importuj element „{0}” z elementu „{1}”.]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Import {0} from {1}.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Import_0_require_1_95015" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Import '{0}' = require("{1}").]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Importuj „{0}” = wymagaj(„{1}”).]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Import_Asterisk_as_0_from_1_95016" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Import * as '{0}' from "{1}".]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Importuj * jako „{0}” z „{1}”.]]></Val>
<Val><![CDATA[Import „{0}” z modułu „{1}”.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@ -6569,20 +6551,17 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Subsequent_property_declarations_must_have_the_same_type_Property_0_has_type_1_at_2_but_here_has_typ_2717" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Subsequent property declarations must have the same type. Property '{0}' has type '{1}' at {2}, but here has type '{3}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Kolejne deklaracje właściwości muszą być tego samego typu. Właściwość „{0}” jest typu „{1}” w {2} , ale w tym miejscu jest typu „{3}”.]]></Val>
</Tgt>
<Val><![CDATA[Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'.]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Subsequent_variable_declarations_must_have_the_same_type_Variable_0_has_type_1_at_2_but_here_has_typ_2403" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_t_2403" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Subsequent variable declarations must have the same type. Variable '{0}' has type '{1}' at {2}, but here has type '{3}'.]]></Val>
<Val><![CDATA[Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Kolejne deklaracje zmiennej muszą być tego samego typu. Zmienna „{0}” musi być typu „{1}” w {2} , ale w tym miejscu jest typu „{3}”.]]></Val>
<Val><![CDATA[Kolejne deklaracje zmiennej muszą być tego samego typu. Zmienna „{0}” musi być typu „{1}”, ale w tym miejscu jest typu „{2}”.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />

View file

@ -6551,20 +6551,17 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Subsequent_property_declarations_must_have_the_same_type_Property_0_has_type_1_at_2_but_here_has_typ_2717" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Subsequent property declarations must have the same type. Property '{0}' has type '{1}' at {2}, but here has type '{3}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Declarações de propriedade subsequentes devem ter o mesmo tipo. A propriedade '{0}' tem o tipo '{1}' em {2}, mas aqui tem o tipo '{3}'.]]></Val>
</Tgt>
<Val><![CDATA[Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'.]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Subsequent_variable_declarations_must_have_the_same_type_Variable_0_has_type_1_at_2_but_here_has_typ_2403" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_t_2403" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Subsequent variable declarations must have the same type. Variable '{0}' has type '{1}' at {2}, but here has type '{3}'.]]></Val>
<Val><![CDATA[Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Declarações de variável subsequentes devem ter o mesmo tipo. A variável "{0}" deve ser do tipo "{1}" em {2}, mas aqui tem o tipo "{3}".]]></Val>
<Val><![CDATA[Declarações de variável subsequentes devem ter o mesmo tipo. A variável '{0}' deve ser do tipo '{1}', mas aqui tem o tipo '{2}'.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />

View file

@ -308,6 +308,9 @@
<Item ItemId=";A_definite_assignment_assertion_is_not_permitted_in_this_context_1255" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A definite assignment assertion '!' is not permitted in this context.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Утверждение определенного присваивания "!" запрещено в этом контексте.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@ -3764,32 +3767,11 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Import_0_from_1_90013" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Import_0_from_module_1_90013" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Import '{0}' from "{1}".]]></Val>
<Val><![CDATA[Import '{0}' from module "{1}".]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Импортируйте "{0}" из "{1}".]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Import {0} from {1}.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Import_0_require_1_95015" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Import '{0}' = require("{1}").]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Import "{0}" = require("{1}").]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Import_Asterisk_as_0_from_1_95016" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Import * as '{0}' from "{1}".]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Import * as "{0}" from "{1}".]]></Val>
<Val><![CDATA[Импорт "{0}" из модуля "{1}".]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@ -6596,20 +6578,17 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Subsequent_property_declarations_must_have_the_same_type_Property_0_has_type_1_at_2_but_here_has_typ_2717" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Subsequent property declarations must have the same type. Property '{0}' has type '{1}' at {2}, but here has type '{3}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Последующие объявления свойств должны иметь тот же тип. Свойство "{0}" имеет тип "{1}" в {2}, но здесь оно имеет тип "{3}".]]></Val>
</Tgt>
<Val><![CDATA[Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'.]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Subsequent_variable_declarations_must_have_the_same_type_Variable_0_has_type_1_at_2_but_here_has_typ_2403" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_t_2403" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Subsequent variable declarations must have the same type. Variable '{0}' has type '{1}' at {2}, but here has type '{3}'.]]></Val>
<Val><![CDATA[Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Последующие объявления переменных должны иметь тот же тип. Переменная "{0}" должна иметь тип "{1}" в {2}, но имеет тип "{3}".]]></Val>
<Val><![CDATA[Последующие объявления переменных должны иметь тот же тип. Переменная "{0}" должна иметь тип "{1}", однако имеет тип "{2}".]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />

View file

@ -302,6 +302,9 @@
<Item ItemId=";A_definite_assignment_assertion_is_not_permitted_in_this_context_1255" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A definite assignment assertion '!' is not permitted in this context.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Bu bağlamda '!' belirli atama onayına izin verilmez.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@ -3758,32 +3761,11 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Import_0_from_1_90013" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Import_0_from_module_1_90013" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Import '{0}' from "{1}".]]></Val>
<Val><![CDATA[Import '{0}' from module "{1}".]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['{0}' öğesini "{1}" kaynağından içeri aktarın.]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Import {0} from {1}.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Import_0_require_1_95015" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Import '{0}' = require("{1}").]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['{0}' = require("{1}") öğesini içeri aktar.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Import_Asterisk_as_0_from_1_95016" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Import * as '{0}' from "{1}".]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[* öğesini "{1}" konumundan '{0}' olarak içeri aktar.]]></Val>
<Val><![CDATA["{1}" modülünden '{0}' öğesini içeri aktarın.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@ -6590,20 +6572,17 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Subsequent_property_declarations_must_have_the_same_type_Property_0_has_type_1_at_2_but_here_has_typ_2717" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Subsequent property declarations must have the same type. Property '{0}' has type '{1}' at {2}, but here has type '{3}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Sonraki özellik bildirimleri aynı türe sahip olmalıdır. '{0}' özelliği {2} konumunda '{1}' türüne sahip, ancak burada '{3}' türüne sahip.]]></Val>
</Tgt>
<Val><![CDATA[Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'.]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Subsequent_variable_declarations_must_have_the_same_type_Variable_0_has_type_1_at_2_but_here_has_typ_2403" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_t_2403" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Subsequent variable declarations must have the same type. Variable '{0}' has type '{1}' at {2}, but here has type '{3}'.]]></Val>
<Val><![CDATA[Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Ardışık değişken bildirimleri aynı türe sahip olmalıdır. '{0}' değişkeni {2} konumunda '{1}' türüne sahip olmasına rağmen burada '{3}' türüne sahip.]]></Val>
<Val><![CDATA[Ardışık değişken bildirimleri aynı türe sahip olmalıdır. '{0}' değişkeni '{1}' türünde olmalıdır, ancak burada '{2}' türüne sahip.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />

View file

@ -814,7 +814,6 @@ namespace ts.codefix {
lastCharWasValid = isValid;
}
// Need `|| "_"` to ensure result isn't empty.
const token = stringToToken(res);
return token === undefined || !isNonContextualKeyword(token) ? res || "_" : `_${res}`;
return !isStringANonContextualKeyword(res) ? res || "_" : `_${res}`;
}
}

View file

@ -112,7 +112,7 @@ namespace ts.Completions {
}
const realName = unescapeLeadingUnderscores(name);
if (uniqueNames.has(realName)) {
if (uniqueNames.has(realName) || isStringANonContextualKeyword(realName)) {
return;
}
@ -552,8 +552,6 @@ namespace ts.Completions {
options: GetCompletionsAtPositionOptions,
target: ScriptTarget,
): CompletionData | undefined {
const isJavaScriptFile = isSourceFileJavaScript(sourceFile);
let request: Request | undefined;
let start = timestamp();
@ -832,23 +830,21 @@ namespace ts.Completions {
}
}
function addTypeProperties(type: Type) {
// Filter private properties
for (const symbol of type.getApparentProperties()) {
if (typeChecker.isValidPropertyAccess(<PropertyAccessExpression>(node.parent), symbol.name)) {
symbols.push(symbol);
}
}
if (isJavaScriptFile && type.flags & TypeFlags.Union) {
function addTypeProperties(type: Type): void {
if (isSourceFileJavaScript(sourceFile)) {
// In javascript files, for union types, we don't just get the members that
// the individual types have in common, we also include all the members that
// each individual type has. This is because we're going to add all identifiers
// anyways. So we might as well elevate the members that were at least part
// each individual type has. This is because we're going to add all identifiers
// anyways. So we might as well elevate the members that were at least part
// of the individual types to a higher status since we know what they are.
const unionType = <UnionType>type;
for (const elementType of unionType.types) {
addTypeProperties(elementType);
symbols.push(...getPropertiesForCompletion(type, typeChecker, /*isForAccess*/ true));
}
else {
// Filter private properties
for (const symbol of type.getApparentProperties()) {
if (typeChecker.isValidPropertyAccess(<PropertyAccessExpression>(node.parent), symbol.name)) {
symbols.push(symbol);
}
}
}
}
@ -1239,7 +1235,7 @@ namespace ts.Completions {
isNewIdentifierLocation = true;
const typeForObject = typeChecker.getContextualType(<ObjectLiteralExpression>objectLikeContainer);
if (!typeForObject) return false;
typeMembers = getPropertiesForCompletion(typeForObject, typeChecker);
typeMembers = getPropertiesForCompletion(typeForObject, typeChecker, /*isForAccess*/ false);
existingMembers = (<ObjectLiteralExpression>objectLikeContainer).properties;
}
else {
@ -1952,6 +1948,8 @@ namespace ts.Completions {
function getAllKeywordCompletions() {
const allKeywordsCompletions: CompletionEntry[] = [];
for (let i = SyntaxKind.FirstKeyword; i <= SyntaxKind.LastKeyword; i++) {
// "undefined" is a global variable, so don't need a keyword completion for it.
if (i === SyntaxKind.UndefinedKeyword) continue;
allKeywordsCompletions.push({
name: tokenToString(i),
kind: ScriptElementKind.keyword,
@ -2050,14 +2048,15 @@ namespace ts.Completions {
* tries to only include those types which declare properties, not methods.
* This ensures that we don't try providing completions for all the methods on e.g. Array.
*/
function getPropertiesForCompletion(type: Type, checker: TypeChecker): Symbol[] {
function getPropertiesForCompletion(type: Type, checker: TypeChecker, isForAccess: boolean): Symbol[] {
if (!(type.flags & TypeFlags.Union)) {
return checker.getPropertiesOfType(type);
return type.getApparentProperties();
}
const { types } = type as UnionType;
const filteredTypes = types.filter(memberType => !(memberType.flags & TypeFlags.Primitive || checker.isArrayLikeType(memberType)));
// If there are no property-only types, just provide completions for every type as usual.
// If we're providing completions for an object literal, skip primitive, array-like, or callable types since those shouldn't be implemented by object literals.
const filteredTypes = isForAccess ? types : types.filter(memberType =>
!(memberType.flags & TypeFlags.Primitive || checker.isArrayLikeType(memberType) || typeHasCallOrConstructSignatures(memberType, checker)));
return checker.getAllPossiblePropertiesOfTypes(filteredTypes);
}
}

View file

@ -336,46 +336,53 @@ namespace ts.NavigationBar {
nameToItems.set(name, [itemWithSameName, child]);
return true;
}
function tryMerge(a: NavigationBarNode, b: NavigationBarNode): boolean {
if (shouldReallyMerge(a.node, b.node)) {
merge(a, b);
return true;
}
return false;
}
});
}
/** a and b have the same name, but they may not be mergeable. */
function shouldReallyMerge(a: Node, b: Node): boolean {
return a.kind === b.kind && (a.kind !== SyntaxKind.ModuleDeclaration || areSameModule(<ModuleDeclaration>a, <ModuleDeclaration>b));
function tryMerge(a: NavigationBarNode, b: NavigationBarNode): boolean {
if (shouldReallyMerge(a.node, b.node)) {
merge(a, b);
return true;
}
return false;
}
// We use 1 NavNode to represent 'A.B.C', but there are multiple source nodes.
// Only merge module nodes that have the same chain. Don't merge 'A.B.C' with 'A'!
function areSameModule(a: ModuleDeclaration, b: ModuleDeclaration): boolean {
if (a.body.kind !== b.body.kind) {
return false;
}
if (a.body.kind !== SyntaxKind.ModuleDeclaration) {
return true;
}
return areSameModule(<ModuleDeclaration>a.body, <ModuleDeclaration>b.body);
}
/** a and b have the same name, but they may not be mergeable. */
function shouldReallyMerge(a: Node, b: Node): boolean {
if (a.kind !== b.kind) {
return false;
}
switch (a.kind) {
case SyntaxKind.PropertyDeclaration:
case SyntaxKind.MethodDeclaration:
case SyntaxKind.GetAccessor:
case SyntaxKind.SetAccessor:
return hasModifier(a, ModifierFlags.Static) === hasModifier(b, ModifierFlags.Static);
case SyntaxKind.ModuleDeclaration:
return areSameModule(<ModuleDeclaration>a, <ModuleDeclaration>b);
default:
return true;
}
}
// We use 1 NavNode to represent 'A.B.C', but there are multiple source nodes.
// Only merge module nodes that have the same chain. Don't merge 'A.B.C' with 'A'!
function areSameModule(a: ModuleDeclaration, b: ModuleDeclaration): boolean {
return a.body.kind === b.body.kind && (a.body.kind !== SyntaxKind.ModuleDeclaration || areSameModule(<ModuleDeclaration>a.body, <ModuleDeclaration>b.body));
}
/** Merge source into target. Source should be thrown away after this is called. */
function merge(target: NavigationBarNode, source: NavigationBarNode): void {
target.additionalNodes = target.additionalNodes || [];
target.additionalNodes.push(source.node);
if (source.additionalNodes) {
target.additionalNodes.push(...source.additionalNodes);
}
/** Merge source into target. Source should be thrown away after this is called. */
function merge(target: NavigationBarNode, source: NavigationBarNode): void {
target.additionalNodes = target.additionalNodes || [];
target.additionalNodes.push(source.node);
if (source.additionalNodes) {
target.additionalNodes.push(...source.additionalNodes);
}
target.children = concatenate(target.children, source.children);
if (target.children) {
mergeChildren(target.children);
sortChildren(target.children);
}
target.children = concatenate(target.children, source.children);
if (target.children) {
mergeChildren(target.children);
sortChildren(target.children);
}
}

View file

@ -138,39 +138,36 @@ namespace ts.Completions.PathCompletions {
function getCompletionEntriesForNonRelativeModules(fragment: string, scriptPath: string, span: TextSpan, compilerOptions: CompilerOptions, host: LanguageServiceHost, typeChecker: TypeChecker): CompletionEntry[] {
const { baseUrl, paths } = compilerOptions;
let result: CompletionEntry[];
const result: CompletionEntry[] = [];
const fileExtensions = getSupportedExtensions(compilerOptions);
if (baseUrl) {
const projectDir = compilerOptions.project || host.getCurrentDirectory();
const absolute = isRootedDiskPath(baseUrl) ? baseUrl : combinePaths(projectDir, baseUrl);
result = getCompletionEntriesForDirectoryFragment(fragment, normalizePath(absolute), fileExtensions, /*includeExtensions*/ false, span, host);
getCompletionEntriesForDirectoryFragment(fragment, normalizePath(absolute), fileExtensions, /*includeExtensions*/ false, span, host, /*exclude*/ undefined, result);
if (paths) {
for (const path in paths) {
if (paths.hasOwnProperty(path)) {
if (path === "*") {
if (paths[path]) {
for (const pattern of paths[path]) {
for (const match of getModulesForPathsPattern(fragment, baseUrl, pattern, fileExtensions, host)) {
result.push(createCompletionEntryForModule(match, ScriptElementKind.externalModuleName, span));
}
}
}
}
else if (startsWith(path, fragment)) {
const entry = paths[path] && paths[path].length === 1 && paths[path][0];
if (entry) {
result.push(createCompletionEntryForModule(path, ScriptElementKind.externalModuleName, span));
}
for (const path in paths) {
if (!paths.hasOwnProperty(path)) continue;
const patterns = paths[path];
if (!patterns) continue;
if (path === "*") {
for (const pattern of patterns) {
for (const match of getModulesForPathsPattern(fragment, baseUrl, pattern, fileExtensions, host)) {
// Path mappings may provide a duplicate way to get to something we've already added, so don't add again.
if (result.some(entry => entry.name === match)) continue;
result.push(createCompletionEntryForModule(match, ScriptElementKind.externalModuleName, span));
}
}
}
else if (startsWith(path, fragment)) {
if (patterns.length === 1) {
if (result.some(entry => entry.name === path)) continue;
result.push(createCompletionEntryForModule(path, ScriptElementKind.externalModuleName, span));
}
}
}
}
else {
result = [];
}
if (compilerOptions.moduleResolution === ts.ModuleResolutionKind.NodeJs) {
forEachAncestorDirectory(scriptPath, ancestor => {

View file

@ -46,9 +46,19 @@ namespace ts.refactor.installTypesForPackage {
function getAction(context: RefactorContext): CodeAction | undefined {
const { file, startPosition } = context;
const node = getTokenAtPosition(file, startPosition, /*includeJsDocComment*/ false);
if (isStringLiteral(node) && isModuleIdentifier(node) && getResolvedModule(file, node.text) === undefined) {
return codefix.tryGetCodeActionForInstallPackageTypes(context.host, file.fileName, node.text);
if (!isStringLiteral(node) || !isModuleIdentifier(node)) {
return undefined;
}
const resolvedTo = getResolvedModule(file, node.text);
// Still offer to install types if it resolved to e.g. a ".js" file.
// `tryGetCodeActionForInstallPackageTypes` will verify that we're looking for a valid package name,
// so the fix won't trigger for imports of ".js" files that couldn't be better replaced by typings.
if (resolvedTo && extensionIsTypeScript(resolvedTo.extension)) {
return undefined;
}
return codefix.tryGetCodeActionForInstallPackageTypes(context.host, file.fileName, node.text);
}
function isModuleIdentifier(node: StringLiteral): boolean {

View file

@ -1,4 +1,4 @@
tests/cases/conformance/statements/for-ofStatements/ES5For-of7.ts(6,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'any' at tests/cases/conformance/statements/for-ofStatements/ES5For-of7.ts 1:8, but here has type 'any[]'.
tests/cases/conformance/statements/for-ofStatements/ES5For-of7.ts(6,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'any', but here has type 'any[]'.
==== tests/cases/conformance/statements/for-ofStatements/ES5For-of7.ts (1 errors) ====
@ -9,5 +9,5 @@ tests/cases/conformance/statements/for-ofStatements/ES5For-of7.ts(6,9): error TS
for (var v of []) {
var x = [w, v];
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'any' at tests/cases/conformance/statements/for-ofStatements/ES5For-of7.ts 1:8, but here has type 'any[]'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'any', but here has type 'any[]'.
}

View file

@ -1,6 +1,6 @@
tests/cases/conformance/internalModules/DeclarationMerging/module.ts(2,19): error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged.
tests/cases/conformance/internalModules/DeclarationMerging/simple.ts(13,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'fn' has type '() => { x: number; y: number; }' at tests/cases/conformance/internalModules/DeclarationMerging/test.ts 0:4, but here has type 'typeof Point'.
tests/cases/conformance/internalModules/DeclarationMerging/test.ts(2,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'fn' has type '() => { x: number; y: number; }' at tests/cases/conformance/internalModules/DeclarationMerging/test.ts 0:4, but here has type 'typeof Point'.
tests/cases/conformance/internalModules/DeclarationMerging/simple.ts(13,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'fn' must be of type '() => { x: number; y: number; }', but here has type 'typeof Point'.
tests/cases/conformance/internalModules/DeclarationMerging/test.ts(2,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'fn' must be of type '() => { x: number; y: number; }', but here has type 'typeof Point'.
==== tests/cases/conformance/internalModules/DeclarationMerging/function.ts (0 errors) ====
@ -23,7 +23,7 @@ tests/cases/conformance/internalModules/DeclarationMerging/test.ts(2,5): error T
var fn: () => { x: number; y: number };
var fn = A.Point;
~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'fn' has type '() => { x: number; y: number; }' at tests/cases/conformance/internalModules/DeclarationMerging/test.ts 0:4, but here has type 'typeof Point'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'fn' must be of type '() => { x: number; y: number; }', but here has type 'typeof Point'.
var cl: { x: number; y: number; }
var cl = A.Point();
@ -45,7 +45,7 @@ tests/cases/conformance/internalModules/DeclarationMerging/test.ts(2,5): error T
var fn: () => { x: number; y: number };
var fn = B.Point; // not expected to be an error. bug 840000: [corelang] Function of fundule not assignalbe as expected
~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'fn' has type '() => { x: number; y: number; }' at tests/cases/conformance/internalModules/DeclarationMerging/test.ts 0:4, but here has type 'typeof Point'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'fn' must be of type '() => { x: number; y: number; }', but here has type 'typeof Point'.
var cl: { x: number; y: number; }
var cl = B.Point();

View file

@ -672,13 +672,13 @@ declare namespace ts {
kind: SyntaxKind.GetAccessor;
parent?: ClassDeclaration | ClassExpression | ObjectLiteralExpression;
name: PropertyName;
body: FunctionBody;
body?: FunctionBody;
}
interface SetAccessorDeclaration extends FunctionLikeDeclarationBase, ClassElement, ObjectLiteralElement, JSDocContainer {
kind: SyntaxKind.SetAccessor;
parent?: ClassDeclaration | ClassExpression | ObjectLiteralExpression;
name: PropertyName;
body: FunctionBody;
body?: FunctionBody;
}
type AccessorDeclaration = GetAccessorDeclaration | SetAccessorDeclaration;
interface IndexSignatureDeclaration extends SignatureDeclarationBase, ClassElement, TypeElement {

View file

@ -672,13 +672,13 @@ declare namespace ts {
kind: SyntaxKind.GetAccessor;
parent?: ClassDeclaration | ClassExpression | ObjectLiteralExpression;
name: PropertyName;
body: FunctionBody;
body?: FunctionBody;
}
interface SetAccessorDeclaration extends FunctionLikeDeclarationBase, ClassElement, ObjectLiteralElement, JSDocContainer {
kind: SyntaxKind.SetAccessor;
parent?: ClassDeclaration | ClassExpression | ObjectLiteralExpression;
name: PropertyName;
body: FunctionBody;
body?: FunctionBody;
}
type AccessorDeclaration = GetAccessorDeclaration | SetAccessorDeclaration;
interface IndexSignatureDeclaration extends SignatureDeclarationBase, ClassElement, TypeElement {

View file

@ -1,7 +1,7 @@
tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction5_es2017.ts(1,11): error TS2304: Cannot find name 'async'.
tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction5_es2017.ts(1,18): error TS2304: Cannot find name 'await'.
tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction5_es2017.ts(1,24): error TS1005: ',' expected.
tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction5_es2017.ts(1,26): error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 222:12, but here has type 'any'.
tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction5_es2017.ts(1,26): error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' must be of type 'PromiseConstructor', but here has type 'any'.
tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction5_es2017.ts(1,33): error TS1005: ',' expected.
tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction5_es2017.ts(1,40): error TS1109: Expression expected.
@ -15,7 +15,7 @@ tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction5_es20
~
!!! error TS1005: ',' expected.
~~~~~~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 222:12, but here has type 'any'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' must be of type 'PromiseConstructor', but here has type 'any'.
~
!!! error TS1005: ',' expected.
~~

View file

@ -1,7 +1,7 @@
tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction5_es5.ts(1,11): error TS2304: Cannot find name 'async'.
tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction5_es5.ts(1,18): error TS2304: Cannot find name 'await'.
tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction5_es5.ts(1,24): error TS1005: ',' expected.
tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction5_es5.ts(1,26): error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 222:12, but here has type 'any'.
tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction5_es5.ts(1,26): error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' must be of type 'PromiseConstructor', but here has type 'any'.
tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction5_es5.ts(1,33): error TS1005: ',' expected.
tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction5_es5.ts(1,40): error TS1109: Expression expected.
@ -15,7 +15,7 @@ tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction5_es5.ts(
~
!!! error TS1005: ',' expected.
~~~~~~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 222:12, but here has type 'any'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' must be of type 'PromiseConstructor', but here has type 'any'.
~
!!! error TS1005: ',' expected.
~~

View file

@ -1,7 +1,7 @@
tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction5_es6.ts(1,11): error TS2304: Cannot find name 'async'.
tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction5_es6.ts(1,18): error TS2304: Cannot find name 'await'.
tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction5_es6.ts(1,24): error TS1005: ',' expected.
tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction5_es6.ts(1,26): error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 222:12, but here has type 'any'.
tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction5_es6.ts(1,26): error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' must be of type 'PromiseConstructor', but here has type 'any'.
tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction5_es6.ts(1,33): error TS1005: ',' expected.
tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction5_es6.ts(1,40): error TS1109: Expression expected.
@ -15,7 +15,7 @@ tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction5_es6.ts(
~
!!! error TS1005: ',' expected.
~~~~~~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 222:12, but here has type 'any'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' must be of type 'PromiseConstructor', but here has type 'any'.
~
!!! error TS1005: ',' expected.
~~

View file

@ -1,7 +1,7 @@
tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction9_es2017.ts(1,11): error TS2304: Cannot find name 'async'.
tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction9_es2017.ts(1,18): error TS2304: Cannot find name 'a'.
tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction9_es2017.ts(1,37): error TS1005: ',' expected.
tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction9_es2017.ts(1,39): error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 222:12, but here has type 'any'.
tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction9_es2017.ts(1,39): error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' must be of type 'PromiseConstructor', but here has type 'any'.
tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction9_es2017.ts(1,46): error TS1005: ',' expected.
tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction9_es2017.ts(1,53): error TS1109: Expression expected.
@ -15,7 +15,7 @@ tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction9_es20
~
!!! error TS1005: ',' expected.
~~~~~~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 222:12, but here has type 'any'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' must be of type 'PromiseConstructor', but here has type 'any'.
~
!!! error TS1005: ',' expected.
~~

View file

@ -1,7 +1,7 @@
tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction9_es5.ts(1,11): error TS2304: Cannot find name 'async'.
tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction9_es5.ts(1,18): error TS2304: Cannot find name 'a'.
tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction9_es5.ts(1,37): error TS1005: ',' expected.
tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction9_es5.ts(1,39): error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 222:12, but here has type 'any'.
tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction9_es5.ts(1,39): error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' must be of type 'PromiseConstructor', but here has type 'any'.
tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction9_es5.ts(1,46): error TS1005: ',' expected.
tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction9_es5.ts(1,53): error TS1109: Expression expected.
@ -15,7 +15,7 @@ tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction9_es5.ts(
~
!!! error TS1005: ',' expected.
~~~~~~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 222:12, but here has type 'any'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' must be of type 'PromiseConstructor', but here has type 'any'.
~
!!! error TS1005: ',' expected.
~~

View file

@ -1,7 +1,7 @@
tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction9_es6.ts(1,11): error TS2304: Cannot find name 'async'.
tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction9_es6.ts(1,18): error TS2304: Cannot find name 'a'.
tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction9_es6.ts(1,37): error TS1005: ',' expected.
tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction9_es6.ts(1,39): error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 222:12, but here has type 'any'.
tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction9_es6.ts(1,39): error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' must be of type 'PromiseConstructor', but here has type 'any'.
tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction9_es6.ts(1,46): error TS1005: ',' expected.
tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction9_es6.ts(1,53): error TS1109: Expression expected.
@ -15,7 +15,7 @@ tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction9_es6.ts(
~
!!! error TS1005: ',' expected.
~~~~~~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 222:12, but here has type 'any'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' must be of type 'PromiseConstructor', but here has type 'any'.
~
!!! error TS1005: ',' expected.
~~

View file

@ -1,6 +1,6 @@
tests/cases/compiler/augmentedTypesVar.ts(6,5): error TS2300: Duplicate identifier 'x2'.
tests/cases/compiler/augmentedTypesVar.ts(7,10): error TS2300: Duplicate identifier 'x2'.
tests/cases/compiler/augmentedTypesVar.ts(10,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x3' has type 'number' at tests/cases/compiler/augmentedTypesVar.ts 8:4, but here has type '() => void'.
tests/cases/compiler/augmentedTypesVar.ts(10,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x3' must be of type 'number', but here has type '() => void'.
tests/cases/compiler/augmentedTypesVar.ts(13,5): error TS2300: Duplicate identifier 'x4'.
tests/cases/compiler/augmentedTypesVar.ts(14,7): error TS2300: Duplicate identifier 'x4'.
tests/cases/compiler/augmentedTypesVar.ts(16,5): error TS2300: Duplicate identifier 'x4a'.
@ -29,7 +29,7 @@ tests/cases/compiler/augmentedTypesVar.ts(31,8): error TS2300: Duplicate identif
var x3 = 1;
var x3 = () => { } // error
~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x3' has type 'number' at tests/cases/compiler/augmentedTypesVar.ts 8:4, but here has type '() => void'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x3' must be of type 'number', but here has type '() => void'.
// var then class
var x4 = 1; // error

View file

@ -11,7 +11,7 @@ tests/cases/conformance/types/tuple/castingTuple.ts(30,10): error TS2352: Type '
tests/cases/conformance/types/tuple/castingTuple.ts(31,10): error TS2352: Type '[C, D]' cannot be converted to type '[A, I]'.
Type 'C' is not comparable to type 'A'.
Property 'a' is missing in type 'C'.
tests/cases/conformance/types/tuple/castingTuple.ts(32,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'array1' has type '{}[]' at tests/cases/conformance/types/tuple/castingTuple.ts 22:4, but here has type 'number[]'.
tests/cases/conformance/types/tuple/castingTuple.ts(32,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(33,1): error TS2304: Cannot find name 't4'.
@ -68,7 +68,7 @@ tests/cases/conformance/types/tuple/castingTuple.ts(33,1): error TS2304: Cannot
!!! 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' has type '{}[]' at tests/cases/conformance/types/tuple/castingTuple.ts 22:4, but here has type 'number[]'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'array1' must be of type '{}[]', but here has type 'number[]'.
t4[2] = 10;
~~
!!! error TS2304: Cannot find name 't4'.

View file

@ -2,7 +2,7 @@ tests/cases/compiler/classWithDuplicateIdentifier.ts(3,5): error TS2300: Duplica
tests/cases/compiler/classWithDuplicateIdentifier.ts(6,5): error TS2300: Duplicate identifier 'b'.
tests/cases/compiler/classWithDuplicateIdentifier.ts(7,5): error TS2300: Duplicate identifier 'b'.
tests/cases/compiler/classWithDuplicateIdentifier.ts(11,5): error TS2300: Duplicate identifier 'c'.
tests/cases/compiler/classWithDuplicateIdentifier.ts(11,5): error TS2717: Subsequent property declarations must have the same type. Property 'c' has type 'number' at tests/cases/compiler/classWithDuplicateIdentifier.ts 9:4, but here has type 'string'.
tests/cases/compiler/classWithDuplicateIdentifier.ts(11,5): error TS2717: Subsequent property declarations must have the same type. Property 'c' must be of type 'number', but here has type 'string'.
==== tests/cases/compiler/classWithDuplicateIdentifier.ts (5 errors) ====
@ -26,6 +26,6 @@ tests/cases/compiler/classWithDuplicateIdentifier.ts(11,5): error TS2717: Subseq
~
!!! error TS2300: Duplicate identifier 'c'.
~
!!! error TS2717: Subsequent property declarations must have the same type. Property 'c' has type 'number' at tests/cases/compiler/classWithDuplicateIdentifier.ts 9:4, but here has type 'string'.
!!! error TS2717: Subsequent property declarations must have the same type. Property 'c' must be of type 'number', but here has type 'string'.
}

View file

@ -0,0 +1,34 @@
//// [tests/cases/compiler/constEnumNamespaceReferenceCausesNoImport.ts] ////
//// [foo.ts]
export const enum ConstFooEnum {
Some,
Values,
Here
};
export function fooFunc(): void { /* removed */ }
//// [index.ts]
import * as Foo from "./foo";
function check(x: Foo.ConstFooEnum): void {
switch (x) {
case Foo.ConstFooEnum.Some:
break;
}
}
//// [foo.js]
"use strict";
exports.__esModule = true;
;
function fooFunc() { }
exports.fooFunc = fooFunc;
//// [index.js]
"use strict";
exports.__esModule = true;
function check(x) {
switch (x) {
case 0 /* Some */:
break;
}
}

View file

@ -0,0 +1,40 @@
=== tests/cases/compiler/foo.ts ===
export const enum ConstFooEnum {
>ConstFooEnum : Symbol(ConstFooEnum, Decl(foo.ts, 0, 0))
Some,
>Some : Symbol(ConstFooEnum.Some, Decl(foo.ts, 0, 32))
Values,
>Values : Symbol(ConstFooEnum.Values, Decl(foo.ts, 1, 9))
Here
>Here : Symbol(ConstFooEnum.Here, Decl(foo.ts, 2, 11))
};
export function fooFunc(): void { /* removed */ }
>fooFunc : Symbol(fooFunc, Decl(foo.ts, 4, 2))
=== tests/cases/compiler/index.ts ===
import * as Foo from "./foo";
>Foo : Symbol(Foo, Decl(index.ts, 0, 6))
function check(x: Foo.ConstFooEnum): void {
>check : Symbol(check, Decl(index.ts, 0, 29))
>x : Symbol(x, Decl(index.ts, 2, 15))
>Foo : Symbol(Foo, Decl(index.ts, 0, 6))
>ConstFooEnum : Symbol(Foo.ConstFooEnum, Decl(foo.ts, 0, 0))
switch (x) {
>x : Symbol(x, Decl(index.ts, 2, 15))
case Foo.ConstFooEnum.Some:
>Foo.ConstFooEnum.Some : Symbol(Foo.ConstFooEnum.Some, Decl(foo.ts, 0, 32))
>Foo.ConstFooEnum : Symbol(Foo.ConstFooEnum, Decl(foo.ts, 0, 0))
>Foo : Symbol(Foo, Decl(index.ts, 0, 6))
>ConstFooEnum : Symbol(Foo.ConstFooEnum, Decl(foo.ts, 0, 0))
>Some : Symbol(Foo.ConstFooEnum.Some, Decl(foo.ts, 0, 32))
break;
}
}

View file

@ -0,0 +1,40 @@
=== tests/cases/compiler/foo.ts ===
export const enum ConstFooEnum {
>ConstFooEnum : ConstFooEnum
Some,
>Some : ConstFooEnum.Some
Values,
>Values : ConstFooEnum.Values
Here
>Here : ConstFooEnum.Here
};
export function fooFunc(): void { /* removed */ }
>fooFunc : () => void
=== tests/cases/compiler/index.ts ===
import * as Foo from "./foo";
>Foo : typeof Foo
function check(x: Foo.ConstFooEnum): void {
>check : (x: Foo.ConstFooEnum) => void
>x : Foo.ConstFooEnum
>Foo : any
>ConstFooEnum : Foo.ConstFooEnum
switch (x) {
>x : Foo.ConstFooEnum
case Foo.ConstFooEnum.Some:
>Foo.ConstFooEnum.Some : Foo.ConstFooEnum.Some
>Foo.ConstFooEnum : typeof Foo.ConstFooEnum
>Foo : typeof Foo
>ConstFooEnum : typeof Foo.ConstFooEnum
>Some : Foo.ConstFooEnum.Some
break;
}
}

View file

@ -5,7 +5,7 @@ tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(23,25):
tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(24,19): error TS2353: Object literal may only specify known properties, and 'x' does not exist in type '{ y: any; }'.
tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(28,28): error TS2353: Object literal may only specify known properties, and 'y' does not exist in type '{ x: any; }'.
tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(29,22): error TS2353: Object literal may only specify known properties, and 'x' does not exist in type '{ y: any; }'.
tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(58,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' has type 'string | 1' at tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts 55:16, but here has type 'string'.
tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(58,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'string | 1', but here has type 'string'.
tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(62,10): error TS2525: Initializer provides no value for this binding element and the binding element has no default value.
tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(62,13): error TS2525: Initializer provides no value for this binding element and the binding element has no default value.
tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(62,16): error TS2525: Initializer provides no value for this binding element and the binding element has no default value.
@ -99,7 +99,7 @@ tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(138,9):
var x: number;
var y: string;
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' has type 'string | 1' at tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts 55:16, but here has type 'string'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'string | 1', but here has type 'string'.
}
function f8() {

View file

@ -1,5 +1,5 @@
tests/cases/compiler/service.ts(7,9): error TS2503: Cannot find namespace 'db'.
tests/cases/compiler/service.ts(9,21): error TS2503: Cannot find namespace 'db'.
tests/cases/compiler/service.ts(7,9): error TS2702: 'db' only refers to a type, but is being used as a namespace here.
tests/cases/compiler/service.ts(9,21): error TS2702: 'db' only refers to a type, but is being used as a namespace here.
==== tests/cases/compiler/db.ts (0 errors) ====
@ -17,11 +17,11 @@ tests/cases/compiler/service.ts(9,21): error TS2503: Cannot find namespace 'db'.
class MyClass {
db: db.db; //error
~~
!!! error TS2503: Cannot find namespace 'db'.
!!! error TS2702: 'db' only refers to a type, but is being used as a namespace here.
constructor(db: db.db) { // error
~~
!!! error TS2503: Cannot find namespace 'db'.
!!! error TS2702: 'db' only refers to a type, but is being used as a namespace here.
this.db = db;
this.db.doSomething();
}

View file

@ -16,7 +16,7 @@ tests/cases/compiler/duplicateClassElements.ts(26,9): error TS2300: Duplicate id
tests/cases/compiler/duplicateClassElements.ts(29,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/duplicateClassElements.ts(32,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/duplicateClassElements.ts(34,12): error TS2300: Duplicate identifier 'x2'.
tests/cases/compiler/duplicateClassElements.ts(34,12): error TS2717: Subsequent property declarations must have the same type. Property 'x2' has type 'number' at tests/cases/compiler/duplicateClassElements.ts 28:8, but here has type 'any'.
tests/cases/compiler/duplicateClassElements.ts(34,12): error TS2717: Subsequent property declarations must have the same type. Property 'x2' must be of type 'number', but here has type 'any'.
tests/cases/compiler/duplicateClassElements.ts(36,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/duplicateClassElements.ts(36,9): error TS2300: Duplicate identifier 'z2'.
tests/cases/compiler/duplicateClassElements.ts(39,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
@ -96,7 +96,7 @@ tests/cases/compiler/duplicateClassElements.ts(41,12): error TS2300: Duplicate i
~~
!!! error TS2300: Duplicate identifier 'x2'.
~~
!!! error TS2717: Subsequent property declarations must have the same type. Property 'x2' has type 'number' at tests/cases/compiler/duplicateClassElements.ts 28:8, but here has type 'any'.
!!! error TS2717: Subsequent property declarations must have the same type. Property 'x2' must be of type 'number', but here has type 'any'.
get z2() {
~~

View file

@ -4,7 +4,7 @@ tests/cases/compiler/duplicateIdentifierInCatchBlock.ts(6,10): error TS2300: Dup
tests/cases/compiler/duplicateIdentifierInCatchBlock.ts(8,9): error TS2300: Duplicate identifier 'w'.
tests/cases/compiler/duplicateIdentifierInCatchBlock.ts(12,9): error TS2300: Duplicate identifier 'x'.
tests/cases/compiler/duplicateIdentifierInCatchBlock.ts(13,14): error TS2300: Duplicate identifier 'x'.
tests/cases/compiler/duplicateIdentifierInCatchBlock.ts(16,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'p' has type 'string' at tests/cases/compiler/duplicateIdentifierInCatchBlock.ts 14:8, but here has type 'number'.
tests/cases/compiler/duplicateIdentifierInCatchBlock.ts(16,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'p' must be of type 'string', but here has type 'number'.
==== tests/cases/compiler/duplicateIdentifierInCatchBlock.ts (7 errors) ====
@ -37,5 +37,5 @@ tests/cases/compiler/duplicateIdentifierInCatchBlock.ts(16,9): error TS2403: Sub
var p: string;
var p: number; // error
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'p' has type 'string' at tests/cases/compiler/duplicateIdentifierInCatchBlock.ts 14:8, but here has type 'number'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'p' must be of type 'string', but here has type 'number'.
}

View file

@ -1,7 +1,7 @@
tests/cases/compiler/duplicateLocalVariable1.ts(1,4): error TS1005: ';' expected.
tests/cases/compiler/duplicateLocalVariable1.ts(1,11): error TS1146: Declaration expected.
tests/cases/compiler/duplicateLocalVariable1.ts(1,13): error TS2304: Cannot find name 'commonjs'.
tests/cases/compiler/duplicateLocalVariable1.ts(186,22): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' has type 'string' at tests/cases/compiler/duplicateLocalVariable1.ts 180:21, but here has type 'number'.
tests/cases/compiler/duplicateLocalVariable1.ts(186,22): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'string', but here has type 'number'.
tests/cases/compiler/duplicateLocalVariable1.ts(186,29): error TS2365: Operator '<' cannot be applied to types 'string' and 'number'.
tests/cases/compiler/duplicateLocalVariable1.ts(186,37): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
@ -200,7 +200,7 @@ tests/cases/compiler/duplicateLocalVariable1.ts(186,37): error TS2356: An arithm
var bytes = [];
for (var i = 0; i < 14; i++) {
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'i' has type 'string' at tests/cases/compiler/duplicateLocalVariable1.ts 180:21, but here has type 'number'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'string', but here has type 'number'.
~~~~~~
!!! error TS2365: Operator '<' cannot be applied to types 'string' and 'number'.
~

View file

@ -1,4 +1,4 @@
tests/cases/compiler/duplicateLocalVariable2.ts(27,22): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' has type 'string' at tests/cases/compiler/duplicateLocalVariable2.ts 21:21, but here has type 'number'.
tests/cases/compiler/duplicateLocalVariable2.ts(27,22): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'string', but here has type 'number'.
tests/cases/compiler/duplicateLocalVariable2.ts(27,29): error TS2365: Operator '<' cannot be applied to types 'string' and 'number'.
tests/cases/compiler/duplicateLocalVariable2.ts(27,37): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
@ -32,7 +32,7 @@ tests/cases/compiler/duplicateLocalVariable2.ts(27,37): error TS2356: An arithme
var bytes = [];
for (var i = 0; i < 14; i++) {
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'i' has type 'string' at tests/cases/compiler/duplicateLocalVariable2.ts 21:21, but here has type 'number'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'string', but here has type 'number'.
~~~~~~
!!! error TS2365: Operator '<' cannot be applied to types 'string' and 'number'.
~

View file

@ -1,4 +1,4 @@
tests/cases/compiler/duplicateLocalVariable3.ts(11,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'z' has type 'number' at tests/cases/compiler/duplicateLocalVariable3.ts 9:8, but here has type 'string'.
tests/cases/compiler/duplicateLocalVariable3.ts(11,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'z' must be of type 'number', but here has type 'string'.
==== tests/cases/compiler/duplicateLocalVariable3.ts (1 errors) ====
@ -14,5 +14,5 @@ tests/cases/compiler/duplicateLocalVariable3.ts(11,9): error TS2403: Subsequent
var z = 3;
var z = "";
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'z' has type 'number' at tests/cases/compiler/duplicateLocalVariable3.ts 9:8, but here has type 'string'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'z' must be of type 'number', but here has type 'string'.
}

View file

@ -1,4 +1,4 @@
tests/cases/compiler/duplicateLocalVariable4.ts(6,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'typeof E' at tests/cases/compiler/duplicateLocalVariable4.ts 4:4, but here has type 'E'.
tests/cases/compiler/duplicateLocalVariable4.ts(6,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'typeof E', but here has type 'E'.
==== tests/cases/compiler/duplicateLocalVariable4.ts (1 errors) ====
@ -9,4 +9,4 @@ tests/cases/compiler/duplicateLocalVariable4.ts(6,5): error TS2403: Subsequent v
var x = E;
var x = E.a;
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'typeof E' at tests/cases/compiler/duplicateLocalVariable4.ts 4:4, but here has type 'E'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'typeof E', but here has type 'E'.

View file

@ -1,7 +1,7 @@
tests/cases/compiler/duplicateVariablesWithAny.ts(3,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'any' at tests/cases/compiler/duplicateVariablesWithAny.ts 1:4, but here has type 'number'.
tests/cases/compiler/duplicateVariablesWithAny.ts(6,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' has type 'string' at tests/cases/compiler/duplicateVariablesWithAny.ts 4:4, but here has type 'any'.
tests/cases/compiler/duplicateVariablesWithAny.ts(10,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'any' at tests/cases/compiler/duplicateVariablesWithAny.ts 8:8, but here has type 'number'.
tests/cases/compiler/duplicateVariablesWithAny.ts(13,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' has type 'string' at tests/cases/compiler/duplicateVariablesWithAny.ts 11:8, but here has type 'any'.
tests/cases/compiler/duplicateVariablesWithAny.ts(3,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'any', but here has type 'number'.
tests/cases/compiler/duplicateVariablesWithAny.ts(6,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'string', but here has type 'any'.
tests/cases/compiler/duplicateVariablesWithAny.ts(10,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'any', but here has type 'number'.
tests/cases/compiler/duplicateVariablesWithAny.ts(13,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'string', but here has type 'any'.
==== tests/cases/compiler/duplicateVariablesWithAny.ts (4 errors) ====
@ -9,23 +9,23 @@ tests/cases/compiler/duplicateVariablesWithAny.ts(13,9): error TS2403: Subsequen
var x: any;
var x = 2; //error
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'any' at tests/cases/compiler/duplicateVariablesWithAny.ts 1:4, but here has type 'number'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'any', but here has type 'number'.
var y = "";
var y; //error
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' has type 'string' at tests/cases/compiler/duplicateVariablesWithAny.ts 4:4, but here has type 'any'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'string', but here has type 'any'.
module N {
var x: any;
var x = 2; //error
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'any' at tests/cases/compiler/duplicateVariablesWithAny.ts 8:8, but here has type 'number'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'any', but here has type 'number'.
var y = "";
var y; //error
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' has type 'string' at tests/cases/compiler/duplicateVariablesWithAny.ts 11:8, but here has type 'any'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'string', but here has type 'any'.
}
var z: any;

View file

@ -1,7 +1,7 @@
tests/cases/compiler/duplicateVarsAcrossFileBoundaries_1.ts(1,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'number' at tests/cases/compiler/duplicateVarsAcrossFileBoundaries_0.ts 0:4, but here has type 'boolean'.
tests/cases/compiler/duplicateVarsAcrossFileBoundaries_2.ts(1,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'number' at tests/cases/compiler/duplicateVarsAcrossFileBoundaries_0.ts 0:4, but here has type 'string'.
tests/cases/compiler/duplicateVarsAcrossFileBoundaries_2.ts(2,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' has type 'string' at tests/cases/compiler/duplicateVarsAcrossFileBoundaries_0.ts 1:4, but here has type 'number'.
tests/cases/compiler/duplicateVarsAcrossFileBoundaries_2.ts(3,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'z' has type 'number' at tests/cases/compiler/duplicateVarsAcrossFileBoundaries_1.ts 1:4, but here has type 'boolean'.
tests/cases/compiler/duplicateVarsAcrossFileBoundaries_1.ts(1,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'number', but here has type 'boolean'.
tests/cases/compiler/duplicateVarsAcrossFileBoundaries_2.ts(1,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'number', but here has type 'string'.
tests/cases/compiler/duplicateVarsAcrossFileBoundaries_2.ts(2,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'string', but here has type 'number'.
tests/cases/compiler/duplicateVarsAcrossFileBoundaries_2.ts(3,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'z' must be of type 'number', but here has type 'boolean'.
==== tests/cases/compiler/duplicateVarsAcrossFileBoundaries_0.ts (0 errors) ====
@ -11,19 +11,19 @@ tests/cases/compiler/duplicateVarsAcrossFileBoundaries_2.ts(3,5): error TS2403:
==== tests/cases/compiler/duplicateVarsAcrossFileBoundaries_1.ts (1 errors) ====
var x = true;
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'number' at tests/cases/compiler/duplicateVarsAcrossFileBoundaries_0.ts 0:4, but here has type 'boolean'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'number', but here has type 'boolean'.
var z = 3;
==== tests/cases/compiler/duplicateVarsAcrossFileBoundaries_2.ts (3 errors) ====
var x = "";
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'number' at tests/cases/compiler/duplicateVarsAcrossFileBoundaries_0.ts 0:4, but here has type 'string'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'number', but here has type 'string'.
var y = 3;
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' has type 'string' at tests/cases/compiler/duplicateVarsAcrossFileBoundaries_0.ts 1:4, but here has type 'number'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'string', but here has type 'number'.
var z = false;
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'z' has type 'number' at tests/cases/compiler/duplicateVarsAcrossFileBoundaries_1.ts 1:4, but here has type 'boolean'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'z' must be of type 'number', but here has type 'boolean'.
==== tests/cases/compiler/duplicateVarsAcrossFileBoundaries_3.ts (0 errors) ====
var x = 0;

View file

@ -1,6 +1,6 @@
tests/cases/compiler/dynamicNamesErrors.ts(5,5): error TS2718: Duplicate declaration '[c0]'.
tests/cases/compiler/dynamicNamesErrors.ts(6,5): error TS2718: Duplicate declaration '[c0]'.
tests/cases/compiler/dynamicNamesErrors.ts(19,5): error TS2717: Subsequent property declarations must have the same type. Property '[c1]' has type 'number' at tests/cases/compiler/dynamicNamesErrors.ts 17:4, but here has type 'string'.
tests/cases/compiler/dynamicNamesErrors.ts(19,5): error TS2717: Subsequent property declarations must have the same type. Property '[c1]' must be of type 'number', but here has type 'string'.
tests/cases/compiler/dynamicNamesErrors.ts(24,1): error TS2322: Type 'T2' is not assignable to type 'T1'.
Types of property '[c0]' are incompatible.
Type 'string' is not assignable to type 'number'.
@ -50,7 +50,7 @@ tests/cases/compiler/dynamicNamesErrors.ts(54,14): error TS4025: Exported variab
[c0]: number;
[c1]: string;
~~~~
!!! error TS2717: Subsequent property declarations must have the same type. Property '[c1]' has type 'number' at tests/cases/compiler/dynamicNamesErrors.ts 17:4, but here has type 'string'.
!!! error TS2717: Subsequent property declarations must have the same type. Property '[c1]' must be of type 'number', but here has type 'string'.
}
let t1: T1;

View file

@ -1,5 +1,5 @@
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignabilityInInheritance.ts(104,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'r4' has type 'E' at tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignabilityInInheritance.ts 21:4, but here has type 'Object'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignabilityInInheritance.ts(109,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'r4' has type 'E' at tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignabilityInInheritance.ts 21:4, but here has type 'Object'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignabilityInInheritance.ts(104,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'r4' must be of type 'E', but here has type 'Object'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignabilityInInheritance.ts(109,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'r4' must be of type 'E', but here has type 'Object'.
==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignabilityInInheritance.ts (2 errors) ====
@ -108,11 +108,11 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssi
var r4 = foo16(E.A);
~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'r4' has type 'E' at tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignabilityInInheritance.ts 21:4, but here has type 'Object'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'r4' must be of type 'E', but here has type 'Object'.
declare function foo17(x: {}): {};
declare function foo17(x: E): E;
var r4 = foo16(E.A);
~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'r4' has type 'E' at tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignabilityInInheritance.ts 21:4, but here has type 'Object'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'r4' must be of type 'E', but here has type 'Object'.

View file

@ -1,6 +1,6 @@
tests/cases/compiler/errorForUsingPropertyOfTypeAsType01.ts(6,12): error TS2713: Cannot access 'Foo.bar' because 'Foo' is a type, but not a namespace. Did you mean to retrieve the type of the property 'bar' in 'Foo' with 'Foo["bar"]'?
tests/cases/compiler/errorForUsingPropertyOfTypeAsType01.ts(7,18): error TS2694: Namespace 'Test1' has no exported member 'Foo'.
tests/cases/compiler/errorForUsingPropertyOfTypeAsType01.ts(15,12): error TS2503: Cannot find namespace 'Foo'.
tests/cases/compiler/errorForUsingPropertyOfTypeAsType01.ts(15,12): error TS2713: Cannot access 'Foo.bar' because 'Foo' is a type, but not a namespace. Did you mean to retrieve the type of the property 'bar' in 'Foo' with 'Foo["bar"]'?
tests/cases/compiler/errorForUsingPropertyOfTypeAsType01.ts(16,18): error TS2694: Namespace 'Test2' has no exported member 'Foo'.
tests/cases/compiler/errorForUsingPropertyOfTypeAsType01.ts(24,12): error TS2713: Cannot access 'Foo.bar' because 'Foo' is a type, but not a namespace. Did you mean to retrieve the type of the property 'bar' in 'Foo' with 'Foo["bar"]'?
tests/cases/compiler/errorForUsingPropertyOfTypeAsType01.ts(25,18): error TS2694: Namespace 'Test3' has no exported member 'Foo'.
@ -32,8 +32,8 @@ tests/cases/compiler/errorForUsingPropertyOfTypeAsType01.ts(44,24): error TS1003
}
var x: Foo.bar = "";
~~~
!!! error TS2503: Cannot find namespace 'Foo'.
~~~~~~~
!!! error TS2713: Cannot access 'Foo.bar' because 'Foo' is a type, but not a namespace. Did you mean to retrieve the type of the property 'bar' in 'Foo' with 'Foo["bar"]'?
var y: Test2.Foo.bar = "";
~~~
!!! error TS2694: Namespace 'Test2' has no exported member 'Foo'.

View file

@ -0,0 +1,11 @@
tests/cases/compiler/errorForUsingPropertyOfTypeAsType02.ts(3,16): error TS2713: Cannot access 'T.abc' because 'T' is a type, but not a namespace. Did you mean to retrieve the type of the property 'abc' in 'T' with 'T["abc"]'?
==== tests/cases/compiler/errorForUsingPropertyOfTypeAsType02.ts (1 errors) ====
namespace Test1 {
function foo<T extends { abc: number }>(x: T) {
let a: T.abc = x.abc;
~~~~~
!!! error TS2713: Cannot access 'T.abc' because 'T' is a type, but not a namespace. Did you mean to retrieve the type of the property 'abc' in 'T' with 'T["abc"]'?
}
}

View file

@ -0,0 +1,14 @@
//// [errorForUsingPropertyOfTypeAsType02.ts]
namespace Test1 {
function foo<T extends { abc: number }>(x: T) {
let a: T.abc = x.abc;
}
}
//// [errorForUsingPropertyOfTypeAsType02.js]
var Test1;
(function (Test1) {
function foo(x) {
var a = x.abc;
}
})(Test1 || (Test1 = {}));

View file

@ -0,0 +1,18 @@
=== tests/cases/compiler/errorForUsingPropertyOfTypeAsType02.ts ===
namespace Test1 {
>Test1 : Symbol(Test1, Decl(errorForUsingPropertyOfTypeAsType02.ts, 0, 0))
function foo<T extends { abc: number }>(x: T) {
>foo : Symbol(foo, Decl(errorForUsingPropertyOfTypeAsType02.ts, 0, 17))
>T : Symbol(T, Decl(errorForUsingPropertyOfTypeAsType02.ts, 1, 17))
>abc : Symbol(abc, Decl(errorForUsingPropertyOfTypeAsType02.ts, 1, 28))
>x : Symbol(x, Decl(errorForUsingPropertyOfTypeAsType02.ts, 1, 44))
>T : Symbol(T, Decl(errorForUsingPropertyOfTypeAsType02.ts, 1, 17))
let a: T.abc = x.abc;
>a : Symbol(a, Decl(errorForUsingPropertyOfTypeAsType02.ts, 2, 11))
>x.abc : Symbol(abc, Decl(errorForUsingPropertyOfTypeAsType02.ts, 1, 28))
>x : Symbol(x, Decl(errorForUsingPropertyOfTypeAsType02.ts, 1, 44))
>abc : Symbol(abc, Decl(errorForUsingPropertyOfTypeAsType02.ts, 1, 28))
}
}

View file

@ -0,0 +1,20 @@
=== tests/cases/compiler/errorForUsingPropertyOfTypeAsType02.ts ===
namespace Test1 {
>Test1 : typeof Test1
function foo<T extends { abc: number }>(x: T) {
>foo : <T extends { abc: number; }>(x: T) => void
>T : T
>abc : number
>x : T
>T : T
let a: T.abc = x.abc;
>a : any
>T : any
>abc : No type information available!
>x.abc : number
>x : T
>abc : number
}
}

View file

@ -0,0 +1,50 @@
tests/cases/compiler/errorForUsingPropertyOfTypeAsType03.ts(11,19): error TS2694: Namespace 'Color' has no exported member 'Red'.
tests/cases/compiler/errorForUsingPropertyOfTypeAsType03.ts(13,19): error TS2339: Property 'Red' does not exist on type 'Color'.
tests/cases/compiler/errorForUsingPropertyOfTypeAsType03.ts(19,13): error TS2702: 'C1' only refers to a type, but is being used as a namespace here.
tests/cases/compiler/errorForUsingPropertyOfTypeAsType03.ts(20,13): error TS2702: 'C1' only refers to a type, but is being used as a namespace here.
tests/cases/compiler/errorForUsingPropertyOfTypeAsType03.ts(21,16): error TS2339: Property 'Red' does not exist on type 'Color'.
tests/cases/compiler/errorForUsingPropertyOfTypeAsType03.ts(23,13): error TS2713: Cannot access 'C2.Red' because 'C2' is a type, but not a namespace. Did you mean to retrieve the type of the property 'Red' in 'C2' with 'C2["Red"]'?
tests/cases/compiler/errorForUsingPropertyOfTypeAsType03.ts(24,13): error TS2713: Cannot access 'C2.Red' because 'C2' is a type, but not a namespace. Did you mean to retrieve the type of the property 'Red' in 'C2' with 'C2["Red"]'?
==== tests/cases/compiler/errorForUsingPropertyOfTypeAsType03.ts (7 errors) ====
namespace Test1 {
enum Color {
Red,
Green,
Blue
}
type C1 = Color;
type C2 = typeof Color;
let a1: Color.Red.toString;
~~~
!!! error TS2694: Namespace 'Color' has no exported member 'Red'.
let a2: Color.Red["toString"];
let a3: Color["Red"]["toString"];
~~~~~
!!! error TS2339: Property 'Red' does not exist on type 'Color'.
//let b1: (typeof Color).Red.toString;
//let b2: (typeof Color).Red["toString"];
let b3: (typeof Color)["Red"]["toString"];
let c1: C1.Red.toString;
~~
!!! error TS2702: 'C1' only refers to a type, but is being used as a namespace here.
let c2: C1.Red["toString"];
~~
!!! error TS2702: 'C1' only refers to a type, but is being used as a namespace here.
let c3: C1["Red"]["toString"];
~~~~~
!!! error TS2339: Property 'Red' does not exist on type 'Color'.
let d1: C2.Red.toString;
~~~~~~
!!! error TS2713: Cannot access 'C2.Red' because 'C2' is a type, but not a namespace. Did you mean to retrieve the type of the property 'Red' in 'C2' with 'C2["Red"]'?
let d2: C2.Red["toString"];
~~~~~~
!!! error TS2713: Cannot access 'C2.Red' because 'C2' is a type, but not a namespace. Did you mean to retrieve the type of the property 'Red' in 'C2' with 'C2["Red"]'?
let d3: C2["Red"]["toString"];
}

View file

@ -0,0 +1,50 @@
//// [errorForUsingPropertyOfTypeAsType03.ts]
namespace Test1 {
enum Color {
Red,
Green,
Blue
}
type C1 = Color;
type C2 = typeof Color;
let a1: Color.Red.toString;
let a2: Color.Red["toString"];
let a3: Color["Red"]["toString"];
//let b1: (typeof Color).Red.toString;
//let b2: (typeof Color).Red["toString"];
let b3: (typeof Color)["Red"]["toString"];
let c1: C1.Red.toString;
let c2: C1.Red["toString"];
let c3: C1["Red"]["toString"];
let d1: C2.Red.toString;
let d2: C2.Red["toString"];
let d3: C2["Red"]["toString"];
}
//// [errorForUsingPropertyOfTypeAsType03.js]
var Test1;
(function (Test1) {
var Color;
(function (Color) {
Color[Color["Red"] = 0] = "Red";
Color[Color["Green"] = 1] = "Green";
Color[Color["Blue"] = 2] = "Blue";
})(Color || (Color = {}));
var a1;
var a2;
var a3;
//let b1: (typeof Color).Red.toString;
//let b2: (typeof Color).Red["toString"];
var b3;
var c1;
var c2;
var c3;
var d1;
var d2;
var d3;
})(Test1 || (Test1 = {}));

View file

@ -0,0 +1,64 @@
=== tests/cases/compiler/errorForUsingPropertyOfTypeAsType03.ts ===
namespace Test1 {
>Test1 : Symbol(Test1, Decl(errorForUsingPropertyOfTypeAsType03.ts, 0, 0))
enum Color {
>Color : Symbol(Color, Decl(errorForUsingPropertyOfTypeAsType03.ts, 0, 17))
Red,
>Red : Symbol(Color.Red, Decl(errorForUsingPropertyOfTypeAsType03.ts, 1, 16))
Green,
>Green : Symbol(Color.Green, Decl(errorForUsingPropertyOfTypeAsType03.ts, 2, 12))
Blue
>Blue : Symbol(Color.Blue, Decl(errorForUsingPropertyOfTypeAsType03.ts, 3, 14))
}
type C1 = Color;
>C1 : Symbol(C1, Decl(errorForUsingPropertyOfTypeAsType03.ts, 5, 5))
>Color : Symbol(Color, Decl(errorForUsingPropertyOfTypeAsType03.ts, 0, 17))
type C2 = typeof Color;
>C2 : Symbol(C2, Decl(errorForUsingPropertyOfTypeAsType03.ts, 7, 20))
>Color : Symbol(Color, Decl(errorForUsingPropertyOfTypeAsType03.ts, 0, 17))
let a1: Color.Red.toString;
>a1 : Symbol(a1, Decl(errorForUsingPropertyOfTypeAsType03.ts, 10, 7))
>Color : Symbol(Color, Decl(errorForUsingPropertyOfTypeAsType03.ts, 0, 17))
let a2: Color.Red["toString"];
>a2 : Symbol(a2, Decl(errorForUsingPropertyOfTypeAsType03.ts, 11, 7))
>Color : Symbol(Color, Decl(errorForUsingPropertyOfTypeAsType03.ts, 0, 17))
>Red : Symbol(Color.Red, Decl(errorForUsingPropertyOfTypeAsType03.ts, 1, 16))
let a3: Color["Red"]["toString"];
>a3 : Symbol(a3, Decl(errorForUsingPropertyOfTypeAsType03.ts, 12, 7))
>Color : Symbol(Color, Decl(errorForUsingPropertyOfTypeAsType03.ts, 0, 17))
//let b1: (typeof Color).Red.toString;
//let b2: (typeof Color).Red["toString"];
let b3: (typeof Color)["Red"]["toString"];
>b3 : Symbol(b3, Decl(errorForUsingPropertyOfTypeAsType03.ts, 16, 7))
>Color : Symbol(Color, Decl(errorForUsingPropertyOfTypeAsType03.ts, 0, 17))
let c1: C1.Red.toString;
>c1 : Symbol(c1, Decl(errorForUsingPropertyOfTypeAsType03.ts, 18, 7))
let c2: C1.Red["toString"];
>c2 : Symbol(c2, Decl(errorForUsingPropertyOfTypeAsType03.ts, 19, 7))
let c3: C1["Red"]["toString"];
>c3 : Symbol(c3, Decl(errorForUsingPropertyOfTypeAsType03.ts, 20, 7))
>C1 : Symbol(C1, Decl(errorForUsingPropertyOfTypeAsType03.ts, 5, 5))
let d1: C2.Red.toString;
>d1 : Symbol(d1, Decl(errorForUsingPropertyOfTypeAsType03.ts, 22, 7))
let d2: C2.Red["toString"];
>d2 : Symbol(d2, Decl(errorForUsingPropertyOfTypeAsType03.ts, 23, 7))
let d3: C2["Red"]["toString"];
>d3 : Symbol(d3, Decl(errorForUsingPropertyOfTypeAsType03.ts, 24, 7))
>C2 : Symbol(C2, Decl(errorForUsingPropertyOfTypeAsType03.ts, 7, 20))
}

View file

@ -0,0 +1,76 @@
=== tests/cases/compiler/errorForUsingPropertyOfTypeAsType03.ts ===
namespace Test1 {
>Test1 : typeof Test1
enum Color {
>Color : Color
Red,
>Red : Color.Red
Green,
>Green : Color.Green
Blue
>Blue : Color.Blue
}
type C1 = Color;
>C1 : Color
>Color : Color
type C2 = typeof Color;
>C2 : typeof Color
>Color : typeof Color
let a1: Color.Red.toString;
>a1 : any
>Color : any
>Red : any
>toString : No type information available!
let a2: Color.Red["toString"];
>a2 : (radix?: number) => string
>Color : any
>Red : Color.Red
let a3: Color["Red"]["toString"];
>a3 : any
>Color : Color
//let b1: (typeof Color).Red.toString;
//let b2: (typeof Color).Red["toString"];
let b3: (typeof Color)["Red"]["toString"];
>b3 : (radix?: number) => string
>Color : typeof Color
let c1: C1.Red.toString;
>c1 : any
>C1 : any
>Red : any
>toString : No type information available!
let c2: C1.Red["toString"];
>c2 : any
>C1 : any
>Red : No type information available!
let c3: C1["Red"]["toString"];
>c3 : any
>C1 : Color
let d1: C2.Red.toString;
>d1 : any
>C2 : any
>Red : any
>toString : No type information available!
let d2: C2.Red["toString"];
>d2 : any
>C2 : any
>Red : No type information available!
let d3: C2["Red"]["toString"];
>d3 : (radix?: number) => string
>C2 : typeof Color
}

View file

@ -1,5 +1,5 @@
tests/cases/conformance/statements/for-inStatements/for-inStatements.ts(33,18): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'string' at tests/cases/conformance/statements/for-inStatements/for-inStatements.ts 30:17, but here has type 'keyof this'.
tests/cases/conformance/statements/for-inStatements/for-inStatements.ts(50,18): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'string' at tests/cases/conformance/statements/for-inStatements/for-inStatements.ts 47:17, but here has type 'keyof this'.
tests/cases/conformance/statements/for-inStatements/for-inStatements.ts(33,18): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'string', but here has type 'keyof this'.
tests/cases/conformance/statements/for-inStatements/for-inStatements.ts(50,18): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'string', but here has type 'keyof this'.
tests/cases/conformance/statements/for-inStatements/for-inStatements.ts(79,15): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.
@ -38,7 +38,7 @@ tests/cases/conformance/statements/for-inStatements/for-inStatements.ts(79,15):
for (var x in this.biz) { }
for (var x in this) { }
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'string' at tests/cases/conformance/statements/for-inStatements/for-inStatements.ts 30:17, but here has type 'keyof this'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'string', but here has type 'keyof this'.
return null;
}
@ -57,7 +57,7 @@ tests/cases/conformance/statements/for-inStatements/for-inStatements.ts(79,15):
for (var x in this.biz) { }
for (var x in this) { }
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'string' at tests/cases/conformance/statements/for-inStatements/for-inStatements.ts 47:17, but here has type 'keyof this'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'string', but here has type 'keyof this'.
for (var x in super.biz) { }
for (var x in super.biz()) { }

View file

@ -2,8 +2,8 @@ tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.
tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts(5,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts(6,9): error TS2365: Operator '===' cannot be applied to types 'string' and 'number'.
tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts(8,16): error TS2339: Property 'unknownProperty' does not exist on type 'string'.
tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts(12,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' has type 'number' at tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts 10:4, but here has type 'string'.
tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts(16,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'j' has type 'any' at tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts 14:4, but here has type 'string'.
tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts(12,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'number', but here has type 'string'.
tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts(16,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'j' must be of type 'any', but here has type 'string'.
==== tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts (6 errors) ====
@ -28,12 +28,12 @@ tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.
var i: number;
for (var i in a ) {
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'i' has type 'number' at tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts 10:4, but here has type 'string'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'number', but here has type 'string'.
}
var j: any;
for (var j in a ) {
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'j' has type 'any' at tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts 14:4, but here has type 'string'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'j' must be of type 'any', but here has type 'string'.
}

View file

@ -9,10 +9,10 @@ tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(1
tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(20,15): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.
tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(22,15): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.
tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(29,23): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.
tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(31,18): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'string' at tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts 28:17, but here has type 'keyof this'.
tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(31,18): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'string', but here has type 'keyof this'.
tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(38,23): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.
tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(46,23): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.
tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(48,18): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'string' at tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts 45:17, but here has type 'keyof this'.
tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(48,18): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'string', but here has type 'keyof this'.
tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(51,23): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.
tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(62,15): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.
@ -72,7 +72,7 @@ tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(6
for (var x in this.biz) { }
for (var x in this) { }
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'string' at tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts 28:17, but here has type 'keyof this'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'string', but here has type 'keyof this'.
return null;
}
@ -95,7 +95,7 @@ tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(6
for (var x in this.biz) { }
for (var x in this) { }
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'string' at tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts 45:17, but here has type 'keyof this'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'string', but here has type 'keyof this'.
for (var x in super.biz) { }
for (var x in super.biz()) { }

View file

@ -1,15 +1,15 @@
tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(32,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 30:9, but here has type 'number'.
tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(33,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 30:9, but here has type 'string'.
tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(34,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 30:9, but here has type 'C'.
tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(35,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 30:9, but here has type 'D<string>'.
tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(36,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 30:9, but here has type 'typeof M'.
tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(39,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'b' has type 'I' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 37:9, but here has type 'C'.
tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(40,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'b' has type 'I' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 37:9, but here has type 'C2'.
tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(43,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'f' has type '(x: string) => number' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 41:8, but here has type '(x: number) => string'.
tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(46,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' has type 'string[]' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 44:8, but here has type 'number[]'.
tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(47,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' has type 'string[]' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 44:8, but here has type '(C | D<string>)[]'.
tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(50,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'arr2' has type 'D<string>[]' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 48:8, but here has type 'D<number>[]'.
tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(53,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'm' has type 'typeof M' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 51:8, but here has type 'typeof A'.
tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(32,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'number'.
tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(33,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'string'.
tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(34,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'C'.
tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(35,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'D<string>'.
tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(36,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'typeof M'.
tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(39,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'I', but here has type 'C'.
tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(40,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'I', but here has type 'C2'.
tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(43,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'f' must be of type '(x: string) => number', but here has type '(x: number) => string'.
tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(46,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' must be of type 'string[]', but here has type 'number[]'.
tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(47,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' must be of type 'string[]', but here has type '(C | D<string>)[]'.
tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(50,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'arr2' must be of type 'D<string>[]', but here has type 'D<number>[]'.
tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(53,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'm' must be of type 'typeof M', but here has type 'typeof A'.
==== tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts (12 errors) ====
@ -46,47 +46,47 @@ tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDec
for( var a: any;;){}
for( var a = 1;;){}
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 30:9, but here has type 'number'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'number'.
for( var a = 'a string';;){}
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 30:9, but here has type 'string'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'string'.
for( var a = new C();;){}
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 30:9, but here has type 'C'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'C'.
for( var a = new D<string>();;){}
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 30:9, but here has type 'D<string>'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'D<string>'.
for( var a = M;;){}
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 30:9, but here has type 'typeof M'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'typeof M'.
for( var b: I;;){}
for( var b = new C();;){}
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'b' has type 'I' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 37:9, but here has type 'C'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'I', but here has type 'C'.
for( var b = new C2();;){}
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'b' has type 'I' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 37:9, but here has type 'C2'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'I', but here has type 'C2'.
for(var f = F;;){}
for( var f = (x: number) => '';;){}
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'f' has type '(x: string) => number' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 41:8, but here has type '(x: number) => string'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'f' must be of type '(x: string) => number', but here has type '(x: number) => string'.
for(var arr: string[];;){}
for( var arr = [1, 2, 3, 4];;){}
~~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' has type 'string[]' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 44:8, but here has type 'number[]'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' must be of type 'string[]', but here has type 'number[]'.
for( var arr = [new C(), new C2(), new D<string>()];;){}
~~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' has type 'string[]' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 44:8, but here has type '(C | D<string>)[]'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' must be of type 'string[]', but here has type '(C | D<string>)[]'.
for(var arr2 = [new D<string>()];;){}
for( var arr2 = new Array<D<number>>();;){}
~~~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'arr2' has type 'D<string>[]' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 48:8, but here has type 'D<number>[]'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'arr2' must be of type 'D<string>[]', but here has type 'D<number>[]'.
for(var m: typeof M;;){}
for( var m = M.A;;){}
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'm' has type 'typeof M' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 51:8, but here has type 'typeof A'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'm' must be of type 'typeof M', but here has type 'typeof A'.

View file

@ -1,6 +1,6 @@
tests/cases/compiler/functionArgShadowing.ts(4,8): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'A' at tests/cases/compiler/functionArgShadowing.ts 2:13, but here has type 'B'.
tests/cases/compiler/functionArgShadowing.ts(4,8): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'A', but here has type 'B'.
tests/cases/compiler/functionArgShadowing.ts(5,8): error TS2339: Property 'bar' does not exist on type 'A'.
tests/cases/compiler/functionArgShadowing.ts(10,7): error TS2403: Subsequent variable declarations must have the same type. Variable 'p' has type 'number' at tests/cases/compiler/functionArgShadowing.ts 8:20, but here has type 'string'.
tests/cases/compiler/functionArgShadowing.ts(10,7): error TS2403: Subsequent variable declarations must have the same type. Variable 'p' must be of type 'number', but here has type 'string'.
==== tests/cases/compiler/functionArgShadowing.ts (3 errors) ====
@ -9,7 +9,7 @@ tests/cases/compiler/functionArgShadowing.ts(10,7): error TS2403: Subsequent var
function foo(x: A) {
var x: B = new B();
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'A' at tests/cases/compiler/functionArgShadowing.ts 2:13, but here has type 'B'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'A', but here has type 'B'.
x.bar(); // the property bar does not exist on a value of type A
~~~
!!! error TS2339: Property 'bar' does not exist on type 'A'.
@ -19,7 +19,7 @@ tests/cases/compiler/functionArgShadowing.ts(10,7): error TS2403: Subsequent var
constructor(public p: number) {
var p: string;
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'p' has type 'number' at tests/cases/compiler/functionArgShadowing.ts 8:20, but here has type 'string'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'p' must be of type 'number', but here has type 'string'.
var n: number = p;
}

View file

@ -0,0 +1,17 @@
//// [generatorNoImplicitReturns.ts]
function* testGenerator () {
if (Math.random() > 0.5) {
return;
}
yield 'hello';
}
//// [generatorNoImplicitReturns.js]
function* testGenerator() {
if (Math.random() > 0.5) {
return;
}
yield 'hello';
}

View file

@ -0,0 +1,15 @@
=== tests/cases/conformance/es6/yieldExpressions/generatorNoImplicitReturns.ts ===
function* testGenerator () {
>testGenerator : Symbol(testGenerator, Decl(generatorNoImplicitReturns.ts, 0, 0))
if (Math.random() > 0.5) {
>Math.random : Symbol(Math.random, Decl(lib.es5.d.ts, --, --))
>Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --))
>random : Symbol(Math.random, Decl(lib.es5.d.ts, --, --))
return;
}
yield 'hello';
}

View file

@ -0,0 +1,20 @@
=== tests/cases/conformance/es6/yieldExpressions/generatorNoImplicitReturns.ts ===
function* testGenerator () {
>testGenerator : () => IterableIterator<string>
if (Math.random() > 0.5) {
>Math.random() > 0.5 : boolean
>Math.random() : number
>Math.random : () => number
>Math : Math
>random : () => number
>0.5 : 0.5
return;
}
yield 'hello';
>yield 'hello' : any
>'hello' : "hello"
}

View file

@ -1,7 +1,7 @@
tests/cases/compiler/gettersAndSettersErrors.ts(2,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/gettersAndSettersErrors.ts(3,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/gettersAndSettersErrors.ts(5,12): error TS2300: Duplicate identifier 'Foo'.
tests/cases/compiler/gettersAndSettersErrors.ts(5,12): error TS2717: Subsequent property declarations must have the same type. Property 'Foo' has type 'string' at tests/cases/compiler/gettersAndSettersErrors.ts 1:15, but here has type 'number'.
tests/cases/compiler/gettersAndSettersErrors.ts(5,12): error TS2717: Subsequent property declarations must have the same type. Property 'Foo' must be of type 'string', but here has type 'number'.
tests/cases/compiler/gettersAndSettersErrors.ts(6,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/gettersAndSettersErrors.ts(7,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/gettersAndSettersErrors.ts(11,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
@ -23,7 +23,7 @@ tests/cases/compiler/gettersAndSettersErrors.ts(12,16): error TS2379: Getter and
~~~
!!! error TS2300: Duplicate identifier 'Foo'.
~~~
!!! error TS2717: Subsequent property declarations must have the same type. Property 'Foo' has type 'string' at tests/cases/compiler/gettersAndSettersErrors.ts 1:15, but here has type 'number'.
!!! error TS2717: Subsequent property declarations must have the same type. Property 'Foo' must be of type 'string', but here has type 'number'.
public get Goo(v:string):string {return null;} // error - getters must not have a parameter
~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.

View file

@ -1,7 +1,7 @@
tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts(5,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'g' has type '<T, U>(x: T, y: U) => T' at tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts 3:4, but here has type '<T>(x: any, y: any) => any'.
tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts(8,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'h' has type '<T, U>(x: T, y: U) => T' at tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts 6:4, but here has type '(x: any, y: any) => any'.
tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts(11,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' has type '<T, U>(x: T, y: U) => T' at tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts 9:4, but here has type '<T, U>(x: any, y: string) => any'.
tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts(14,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'j' has type '<T, U>(x: T, y: U) => T' at tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts 12:4, but here has type '<T, U>(x: any, y: any) => string'.
tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts(5,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'g' must be of type '<T, U>(x: T, y: U) => T', but here has type '<T>(x: any, y: any) => any'.
tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts(8,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'h' must be of type '<T, U>(x: T, y: U) => T', but here has type '(x: any, y: any) => any'.
tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts(11,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type '<T, U>(x: T, y: U) => T', but here has type '<T, U>(x: any, y: string) => any'.
tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts(14,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'j' must be of type '<T, U>(x: T, y: U) => T', but here has type '<T, U>(x: any, y: any) => string'.
==== tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts (4 errors) ====
@ -11,19 +11,19 @@ tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts(14,5): err
var g: <T, U>(x: T, y: U) => T;
var g: <T>(x: any, y: any) => any;
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'g' has type '<T, U>(x: T, y: U) => T' at tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts 3:4, but here has type '<T>(x: any, y: any) => any'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'g' must be of type '<T, U>(x: T, y: U) => T', but here has type '<T>(x: any, y: any) => any'.
var h: <T, U>(x: T, y: U) => T;
var h: (x: any, y: any) => any;
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'h' has type '<T, U>(x: T, y: U) => T' at tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts 6:4, but here has type '(x: any, y: any) => any'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'h' must be of type '<T, U>(x: T, y: U) => T', but here has type '(x: any, y: any) => any'.
var i: <T, U>(x: T, y: U) => T;
var i: <T, U>(x: any, y: string) => any;
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'i' has type '<T, U>(x: T, y: U) => T' at tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts 9:4, but here has type '<T, U>(x: any, y: string) => any'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type '<T, U>(x: T, y: U) => T', but here has type '<T, U>(x: any, y: string) => any'.
var j: <T, U>(x: T, y: U) => T;
var j: <T, U>(x: any, y: any) => string;
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'j' has type '<T, U>(x: T, y: U) => T' at tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts 12:4, but here has type '<T, U>(x: any, y: any) => string'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'j' must be of type '<T, U>(x: T, y: U) => T', but here has type '<T, U>(x: any, y: any) => string'.

View file

@ -0,0 +1,21 @@
tests/cases/compiler/instanceofWithPrimitiveUnion.ts(2,9): error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.
tests/cases/compiler/instanceofWithPrimitiveUnion.ts(8,9): error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.
==== tests/cases/compiler/instanceofWithPrimitiveUnion.ts (2 errors) ====
function test1(x: number | string) {
if (x instanceof Object) {
~
!!! error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.
x;
}
}
function test2(x: (number | string) | number) {
if (x instanceof Object) {
~
!!! error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.
x;
}
}

View file

@ -0,0 +1,25 @@
//// [instanceofWithPrimitiveUnion.ts]
function test1(x: number | string) {
if (x instanceof Object) {
x;
}
}
function test2(x: (number | string) | number) {
if (x instanceof Object) {
x;
}
}
//// [instanceofWithPrimitiveUnion.js]
function test1(x) {
if (x instanceof Object) {
x;
}
}
function test2(x) {
if (x instanceof Object) {
x;
}
}

View file

@ -0,0 +1,27 @@
=== tests/cases/compiler/instanceofWithPrimitiveUnion.ts ===
function test1(x: number | string) {
>test1 : Symbol(test1, Decl(instanceofWithPrimitiveUnion.ts, 0, 0))
>x : Symbol(x, Decl(instanceofWithPrimitiveUnion.ts, 0, 15))
if (x instanceof Object) {
>x : Symbol(x, Decl(instanceofWithPrimitiveUnion.ts, 0, 15))
>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
x;
>x : Symbol(x, Decl(instanceofWithPrimitiveUnion.ts, 0, 15))
}
}
function test2(x: (number | string) | number) {
>test2 : Symbol(test2, Decl(instanceofWithPrimitiveUnion.ts, 4, 1))
>x : Symbol(x, Decl(instanceofWithPrimitiveUnion.ts, 6, 15))
if (x instanceof Object) {
>x : Symbol(x, Decl(instanceofWithPrimitiveUnion.ts, 6, 15))
>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
x;
>x : Symbol(x, Decl(instanceofWithPrimitiveUnion.ts, 6, 15))
}
}

View file

@ -0,0 +1,29 @@
=== tests/cases/compiler/instanceofWithPrimitiveUnion.ts ===
function test1(x: number | string) {
>test1 : (x: string | number) => void
>x : string | number
if (x instanceof Object) {
>x instanceof Object : boolean
>x : string | number
>Object : ObjectConstructor
x;
>x : string | number
}
}
function test2(x: (number | string) | number) {
>test2 : (x: string | number) => void
>x : string | number
if (x instanceof Object) {
>x instanceof Object : boolean
>x : string | number
>Object : ObjectConstructor
x;
>x : string | number
}
}

View file

@ -2,7 +2,7 @@ tests/cases/compiler/interfaceDeclaration1.ts(2,5): error TS2300: Duplicate iden
tests/cases/compiler/interfaceDeclaration1.ts(3,5): error TS2300: Duplicate identifier 'item'.
tests/cases/compiler/interfaceDeclaration1.ts(7,5): error TS2300: Duplicate identifier 'item'.
tests/cases/compiler/interfaceDeclaration1.ts(8,5): error TS2300: Duplicate identifier 'item'.
tests/cases/compiler/interfaceDeclaration1.ts(8,5): error TS2717: Subsequent property declarations must have the same type. Property 'item' has type 'any' at tests/cases/compiler/interfaceDeclaration1.ts 6:4, but here has type 'number'.
tests/cases/compiler/interfaceDeclaration1.ts(8,5): error TS2717: Subsequent property declarations must have the same type. Property 'item' must be of type 'any', but here has type 'number'.
tests/cases/compiler/interfaceDeclaration1.ts(22,11): error TS2310: Type 'I5' recursively references itself as a base type.
tests/cases/compiler/interfaceDeclaration1.ts(35,7): error TS2420: Class 'C1' incorrectly implements interface 'I3'.
Property 'prototype' is missing in type 'C1'.
@ -29,7 +29,7 @@ tests/cases/compiler/interfaceDeclaration1.ts(52,11): error TS2320: Interface 'i
~~~~
!!! error TS2300: Duplicate identifier 'item'.
~~~~
!!! error TS2717: Subsequent property declarations must have the same type. Property 'item' has type 'any' at tests/cases/compiler/interfaceDeclaration1.ts 6:4, but here has type 'number'.
!!! error TS2717: Subsequent property declarations must have the same type. Property 'item' must be of type 'any', but here has type 'number'.
}
interface I3 {

View file

@ -1,5 +1,5 @@
tests/cases/conformance/internalModules/importDeclarations/invalidImportAliasIdentifiers.ts(5,12): error TS2503: Cannot find namespace 'V'.
tests/cases/conformance/internalModules/importDeclarations/invalidImportAliasIdentifiers.ts(11,12): error TS2503: Cannot find namespace 'C'.
tests/cases/conformance/internalModules/importDeclarations/invalidImportAliasIdentifiers.ts(11,12): error TS2702: 'C' only refers to a type, but is being used as a namespace here.
tests/cases/conformance/internalModules/importDeclarations/invalidImportAliasIdentifiers.ts(23,12): error TS2702: 'I' only refers to a type, but is being used as a namespace here.
@ -18,7 +18,7 @@ tests/cases/conformance/internalModules/importDeclarations/invalidImportAliasIde
import c = C;
~
!!! error TS2503: Cannot find namespace 'C'.
!!! error TS2702: 'C' only refers to a type, but is being used as a namespace here.
enum E {
Red, Blue

View file

@ -1,15 +1,15 @@
tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(32,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 30:4, but here has type 'number'.
tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(33,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 30:4, but here has type 'string'.
tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(34,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 30:4, but here has type 'C'.
tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(35,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 30:4, but here has type 'D<string>'.
tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(36,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 30:4, but here has type 'typeof M'.
tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(39,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'b' has type 'I' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 37:4, but here has type 'C'.
tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(40,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'b' has type 'I' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 37:4, but here has type 'C2'.
tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(43,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'f' has type '(x: string) => number' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 41:4, but here has type '(x: number) => string'.
tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(46,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' has type 'string[]' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 44:4, but here has type 'number[]'.
tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(47,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' has type 'string[]' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 44:4, but here has type '(C | D<string>)[]'.
tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(50,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'arr2' has type 'D<string>[]' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 48:4, but here has type 'D<number>[]'.
tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(53,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'm' has type 'typeof M' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 51:4, but here has type 'typeof A'.
tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(32,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'number'.
tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(33,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'string'.
tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(34,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'C'.
tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(35,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'D<string>'.
tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(36,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'typeof M'.
tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(39,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'I', but here has type 'C'.
tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(40,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'I', but here has type 'C2'.
tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(43,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'f' must be of type '(x: string) => number', but here has type '(x: number) => string'.
tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(46,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' must be of type 'string[]', but here has type 'number[]'.
tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(47,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' must be of type 'string[]', but here has type '(C | D<string>)[]'.
tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(50,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'arr2' must be of type 'D<string>[]', but here has type 'D<number>[]'.
tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(53,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'm' must be of type 'typeof M', but here has type 'typeof A'.
==== tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts (12 errors) ====
@ -46,47 +46,47 @@ tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDec
var a: any;
var a = 1;
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 30:4, but here has type 'number'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'number'.
var a = 'a string';
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 30:4, but here has type 'string'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'string'.
var a = new C();
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 30:4, but here has type 'C'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'C'.
var a = new D<string>();
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 30:4, but here has type 'D<string>'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'D<string>'.
var a = M;
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 30:4, but here has type 'typeof M'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'typeof M'.
var b: I;
var b = new C();
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'b' has type 'I' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 37:4, but here has type 'C'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'I', but here has type 'C'.
var b = new C2();
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'b' has type 'I' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 37:4, but here has type 'C2'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'I', but here has type 'C2'.
var f = F;
var f = (x: number) => '';
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'f' has type '(x: string) => number' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 41:4, but here has type '(x: number) => string'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'f' must be of type '(x: string) => number', but here has type '(x: number) => string'.
var arr: string[];
var arr = [1, 2, 3, 4];
~~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' has type 'string[]' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 44:4, but here has type 'number[]'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' must be of type 'string[]', but here has type 'number[]'.
var arr = [new C(), new C2(), new D<string>()];
~~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' has type 'string[]' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 44:4, but here has type '(C | D<string>)[]'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' must be of type 'string[]', but here has type '(C | D<string>)[]'.
var arr2 = [new D<string>()];
var arr2 = new Array<D<number>>();
~~~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'arr2' has type 'D<string>[]' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 48:4, but here has type 'D<number>[]'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'arr2' must be of type 'D<string>[]', but here has type 'D<number>[]'.
var m: typeof M;
var m = M.A;
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'm' has type 'typeof M' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 51:4, but here has type 'typeof A'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'm' must be of type 'typeof M', but here has type 'typeof A'.

View file

@ -1,5 +1,5 @@
error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
tests/cases/compiler/a.ts(1,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'string' at tests/cases/compiler/b.js 0:4, but here has type 'number'.
tests/cases/compiler/a.ts(1,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'string', but here has type 'number'.
!!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
@ -9,4 +9,4 @@ tests/cases/compiler/a.ts(1,5): error TS2403: Subsequent variable declarations m
==== tests/cases/compiler/a.ts (1 errors) ====
var x = 10; // Error reported so no declaration file generated?
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'string' at tests/cases/compiler/b.js 0:4, but here has type 'number'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'string', but here has type 'number'.

View file

@ -1,76 +1,92 @@
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(3,1): error TS1128: Declaration or statement expected.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(3,3): error TS1109: Expression expected.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(3,4): error TS1109: Expression expected.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(4,3): error TS1003: Identifier expected.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(5,1): error TS1109: Expression expected.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(5,2): error TS1109: Expression expected.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(5,3): error TS2304: Cannot find name 'a'.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(5,6): error TS1109: Expression expected.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(5,7): error TS1109: Expression expected.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(6,1): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(6,6): error TS1005: '{' expected.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(6,6): error TS2304: Cannot find name 'd'.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(6,9): error TS1109: Expression expected.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(6,10): error TS1109: Expression expected.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(7,1): error TS1003: Identifier expected.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(8,4): error TS17002: Expected corresponding JSX closing tag for 'a'.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(9,13): error TS1002: Unterminated string literal.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(10,1): error TS1003: Identifier expected.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(10,6): error TS17002: Expected corresponding JSX closing tag for 'a'.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(10,10): error TS2657: JSX expressions must have one parent element.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(11,3): error TS1003: Identifier expected.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(11,5): error TS1003: Identifier expected.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(11,11): error TS1005: '>' expected.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(11,12): error TS2304: Cannot find name 'b'.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(11,16): error TS1109: Expression expected.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(12,2): error TS2304: Cannot find name 'a'.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(12,5): error TS1003: Identifier expected.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(12,10): error TS2304: Cannot find name 'a'.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(12,13): error TS1005: '>' expected.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(12,14): error TS2304: Cannot find name 'c'.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(12,16): error TS1109: Expression expected.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(13,2): error TS2304: Cannot find name 'a'.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(13,8): error TS17002: Expected corresponding JSX closing tag for 'a.b.c'.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(14,1): error TS1109: Expression expected.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(14,2): error TS1109: Expression expected.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(14,5): error TS1109: Expression expected.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(14,7): error TS1128: Declaration or statement expected.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(14,8): error TS2304: Cannot find name 'a'.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(14,10): error TS1109: Expression expected.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(15,2): error TS2304: Cannot find name 'a'.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(15,4): error TS1003: Identifier expected.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(15,7): error TS2304: Cannot find name 'a'.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(15,9): error TS1003: Identifier expected.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(16,3): error TS1003: Identifier expected.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(16,4): error TS2304: Cannot find name 'foo'.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(16,9): error TS1109: Expression expected.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(16,11): error TS2304: Cannot find name 'a'.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(16,13): error TS2304: Cannot find name 'foo'.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(16,18): error TS1109: Expression expected.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(17,3): error TS1003: Identifier expected.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(17,11): error TS1109: Expression expected.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(17,13): error TS2304: Cannot find name 'a'.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(17,22): error TS1109: Expression expected.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(18,2): error TS17008: JSX element 'a' has no corresponding closing tag.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(19,2): error TS17008: JSX element 'a' has no corresponding closing tag.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(22,10): error TS1005: '}' expected.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(23,20): error TS1003: Identifier expected.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(24,15): error TS1003: Identifier expected.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(25,7): error TS1005: '...' expected.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(25,7): error TS2304: Cannot find name 'props'.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(27,17): error TS1005: '>' expected.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(28,10): error TS2304: Cannot find name 'props'.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(28,28): error TS1005: '>' expected.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(32,2): error TS17008: JSX element 'a' has no corresponding closing tag.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(32,6): error TS1005: '{' expected.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(33,2): error TS17008: JSX element 'a' has no corresponding closing tag.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(33,6): error TS1005: '{' expected.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(33,7): error TS1109: Expression expected.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(35,4): error TS1003: Identifier expected.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(35,21): error TS1005: '</' expected.
tests/cases/conformance/jsx/1.tsx(3,1): error TS1128: Declaration or statement expected.
tests/cases/conformance/jsx/1.tsx(3,3): error TS1109: Expression expected.
tests/cases/conformance/jsx/1.tsx(3,4): error TS1109: Expression expected.
tests/cases/conformance/jsx/10.tsx(1,2): error TS2304: Cannot find name 'a'.
tests/cases/conformance/jsx/10.tsx(1,5): error TS1003: Identifier expected.
tests/cases/conformance/jsx/10.tsx(1,10): error TS2304: Cannot find name 'a'.
tests/cases/conformance/jsx/10.tsx(1,13): error TS1005: '>' expected.
tests/cases/conformance/jsx/10.tsx(1,14): error TS2304: Cannot find name 'c'.
tests/cases/conformance/jsx/10.tsx(1,16): error TS1109: Expression expected.
tests/cases/conformance/jsx/11.tsx(1,2): error TS2304: Cannot find name 'a'.
tests/cases/conformance/jsx/11.tsx(1,8): error TS17002: Expected corresponding JSX closing tag for 'a.b.c'.
tests/cases/conformance/jsx/12.tsx(1,1): error TS1109: Expression expected.
tests/cases/conformance/jsx/12.tsx(1,2): error TS1109: Expression expected.
tests/cases/conformance/jsx/12.tsx(1,5): error TS1109: Expression expected.
tests/cases/conformance/jsx/12.tsx(1,7): error TS1128: Declaration or statement expected.
tests/cases/conformance/jsx/12.tsx(1,8): error TS2304: Cannot find name 'a'.
tests/cases/conformance/jsx/12.tsx(1,10): error TS1109: Expression expected.
tests/cases/conformance/jsx/13.tsx(1,2): error TS2304: Cannot find name 'a'.
tests/cases/conformance/jsx/13.tsx(1,4): error TS1003: Identifier expected.
tests/cases/conformance/jsx/13.tsx(1,7): error TS2304: Cannot find name 'a'.
tests/cases/conformance/jsx/13.tsx(1,9): error TS1003: Identifier expected.
tests/cases/conformance/jsx/14.tsx(1,3): error TS1003: Identifier expected.
tests/cases/conformance/jsx/14.tsx(1,4): error TS2304: Cannot find name 'foo'.
tests/cases/conformance/jsx/14.tsx(1,9): error TS1109: Expression expected.
tests/cases/conformance/jsx/14.tsx(1,11): error TS2304: Cannot find name 'a'.
tests/cases/conformance/jsx/14.tsx(1,13): error TS2304: Cannot find name 'foo'.
tests/cases/conformance/jsx/14.tsx(1,18): error TS1109: Expression expected.
tests/cases/conformance/jsx/15.tsx(1,3): error TS1003: Identifier expected.
tests/cases/conformance/jsx/15.tsx(1,11): error TS1109: Expression expected.
tests/cases/conformance/jsx/15.tsx(1,13): error TS2304: Cannot find name 'a'.
tests/cases/conformance/jsx/15.tsx(1,22): error TS1109: Expression expected.
tests/cases/conformance/jsx/16.tsx(1,2): error TS17008: JSX element 'a' has no corresponding closing tag.
tests/cases/conformance/jsx/16.tsx(1,10): error TS1005: '</' expected.
tests/cases/conformance/jsx/17.tsx(1,2): error TS17008: JSX element 'a' has no corresponding closing tag.
tests/cases/conformance/jsx/17.tsx(1,10): error TS1005: '</' expected.
tests/cases/conformance/jsx/18.tsx(1,9): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/jsx/18.tsx(1,37): error TS2657: JSX expressions must have one parent element.
tests/cases/conformance/jsx/19.tsx(1,9): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/jsx/19.tsx(1,64): error TS2657: JSX expressions must have one parent element.
tests/cases/conformance/jsx/2.tsx(1,3): error TS1003: Identifier expected.
tests/cases/conformance/jsx/20.tsx(1,10): error TS1005: '}' expected.
tests/cases/conformance/jsx/21.tsx(1,20): error TS1003: Identifier expected.
tests/cases/conformance/jsx/22.tsx(1,15): error TS1003: Identifier expected.
tests/cases/conformance/jsx/22.tsx(1,21): error TS1109: Expression expected.
tests/cases/conformance/jsx/23.tsx(1,7): error TS1005: '...' expected.
tests/cases/conformance/jsx/23.tsx(1,7): error TS2304: Cannot find name 'props'.
tests/cases/conformance/jsx/24.tsx(1,17): error TS1005: '>' expected.
tests/cases/conformance/jsx/24.tsx(1,18): error TS1128: Declaration or statement expected.
tests/cases/conformance/jsx/24.tsx(1,21): error TS2304: Cannot find name 'props'.
tests/cases/conformance/jsx/24.tsx(1,27): error TS1109: Expression expected.
tests/cases/conformance/jsx/24.tsx(1,28): error TS1109: Expression expected.
tests/cases/conformance/jsx/25.tsx(1,10): error TS2304: Cannot find name 'props'.
tests/cases/conformance/jsx/25.tsx(1,28): error TS1005: '>' expected.
tests/cases/conformance/jsx/25.tsx(1,29): error TS1128: Declaration or statement expected.
tests/cases/conformance/jsx/25.tsx(1,32): error TS2304: Cannot find name 'props'.
tests/cases/conformance/jsx/25.tsx(1,38): error TS1109: Expression expected.
tests/cases/conformance/jsx/25.tsx(1,39): error TS1109: Expression expected.
tests/cases/conformance/jsx/28.tsx(1,2): error TS17008: JSX element 'a' has no corresponding closing tag.
tests/cases/conformance/jsx/28.tsx(1,6): error TS1005: '{' expected.
tests/cases/conformance/jsx/28.tsx(2,1): error TS1005: '</' expected.
tests/cases/conformance/jsx/29.tsx(1,2): error TS17008: JSX element 'a' has no corresponding closing tag.
tests/cases/conformance/jsx/29.tsx(1,6): error TS1005: '{' expected.
tests/cases/conformance/jsx/29.tsx(1,7): error TS1109: Expression expected.
tests/cases/conformance/jsx/29.tsx(2,1): error TS1005: '</' expected.
tests/cases/conformance/jsx/3.tsx(1,1): error TS1109: Expression expected.
tests/cases/conformance/jsx/3.tsx(1,2): error TS1109: Expression expected.
tests/cases/conformance/jsx/3.tsx(1,3): error TS2304: Cannot find name 'a'.
tests/cases/conformance/jsx/3.tsx(1,6): error TS1109: Expression expected.
tests/cases/conformance/jsx/3.tsx(1,7): error TS1109: Expression expected.
tests/cases/conformance/jsx/31.tsx(1,4): error TS1003: Identifier expected.
tests/cases/conformance/jsx/4.tsx(1,6): error TS1005: '{' expected.
tests/cases/conformance/jsx/4.tsx(1,6): error TS2304: Cannot find name 'd'.
tests/cases/conformance/jsx/4.tsx(1,9): error TS1109: Expression expected.
tests/cases/conformance/jsx/4.tsx(1,10): error TS1109: Expression expected.
tests/cases/conformance/jsx/4.tsx(1,11): error TS1005: '/' expected.
tests/cases/conformance/jsx/5.tsx(1,2): error TS17008: JSX element 'a' has no corresponding closing tag.
tests/cases/conformance/jsx/5.tsx(1,5): error TS1005: '</' expected.
tests/cases/conformance/jsx/6.tsx(1,4): error TS17002: Expected corresponding JSX closing tag for 'a'.
tests/cases/conformance/jsx/7.tsx(1,13): error TS1002: Unterminated string literal.
tests/cases/conformance/jsx/8.tsx(1,3): error TS1003: Identifier expected.
tests/cases/conformance/jsx/8.tsx(1,6): error TS17002: Expected corresponding JSX closing tag for 'a'.
tests/cases/conformance/jsx/9.tsx(1,3): error TS1003: Identifier expected.
tests/cases/conformance/jsx/9.tsx(1,5): error TS1003: Identifier expected.
tests/cases/conformance/jsx/9.tsx(1,11): error TS1005: '>' expected.
tests/cases/conformance/jsx/9.tsx(1,12): error TS2304: Cannot find name 'b'.
tests/cases/conformance/jsx/9.tsx(1,16): error TS1109: Expression expected.
==== tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx (70 errors) ====
==== tests/cases/conformance/jsx/1.tsx (3 errors) ====
declare var React: any;
</>;
@ -80,9 +96,11 @@ tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(35,21): error TS1005:
!!! error TS1109: Expression expected.
~
!!! error TS1109: Expression expected.
==== tests/cases/conformance/jsx/2.tsx (1 errors) ====
<a: />;
~
!!! error TS1003: Identifier expected.
==== tests/cases/conformance/jsx/3.tsx (5 errors) ====
<:a />;
~
!!! error TS1109: Expression expected.
@ -94,9 +112,8 @@ tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(35,21): error TS1005:
!!! error TS1109: Expression expected.
~
!!! error TS1109: Expression expected.
==== tests/cases/conformance/jsx/4.tsx (5 errors) ====
<a b=d />;
~~~~~~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
~
!!! error TS1005: '{' expected.
~
@ -105,22 +122,29 @@ tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(35,21): error TS1005:
!!! error TS1109: Expression expected.
~
!!! error TS1109: Expression expected.
!!! error TS1005: '/' expected.
==== tests/cases/conformance/jsx/5.tsx (2 errors) ====
<a>;
~
!!! error TS1003: Identifier expected.
~
!!! error TS17008: JSX element 'a' has no corresponding closing tag.
!!! error TS1005: '</' expected.
==== tests/cases/conformance/jsx/6.tsx (1 errors) ====
<a></b>;
~~~~
!!! error TS17002: Expected corresponding JSX closing tag for 'a'.
==== tests/cases/conformance/jsx/7.tsx (1 errors) ====
<a foo="bar;
!!! error TS1002: Unterminated string literal.
==== tests/cases/conformance/jsx/8.tsx (2 errors) ====
<a:b></b>;
~
~
!!! error TS1003: Identifier expected.
~~~~
!!! error TS17002: Expected corresponding JSX closing tag for 'a'.
~
!!! error TS2657: JSX expressions must have one parent element.
==== tests/cases/conformance/jsx/9.tsx (5 errors) ====
<a:b.c></a:b.c>;
~
!!! error TS1003: Identifier expected.
@ -132,6 +156,7 @@ tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(35,21): error TS1005:
!!! error TS2304: Cannot find name 'b'.
~
!!! error TS1109: Expression expected.
==== tests/cases/conformance/jsx/10.tsx (6 errors) ====
<a.b:c></a.b:c>;
~
!!! error TS2304: Cannot find name 'a'.
@ -145,11 +170,13 @@ tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(35,21): error TS1005:
!!! error TS2304: Cannot find name 'c'.
~
!!! error TS1109: Expression expected.
==== tests/cases/conformance/jsx/11.tsx (2 errors) ====
<a.b.c></a>;
~
!!! error TS2304: Cannot find name 'a'.
~~~~
!!! error TS17002: Expected corresponding JSX closing tag for 'a.b.c'.
==== tests/cases/conformance/jsx/12.tsx (6 errors) ====
<.a></.a>;
~
!!! error TS1109: Expression expected.
@ -163,6 +190,7 @@ tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(35,21): error TS1005:
!!! error TS2304: Cannot find name 'a'.
~
!!! error TS1109: Expression expected.
==== tests/cases/conformance/jsx/13.tsx (4 errors) ====
<a.></a.>;
~
!!! error TS2304: Cannot find name 'a'.
@ -172,6 +200,7 @@ tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(35,21): error TS1005:
!!! error TS2304: Cannot find name 'a'.
~
!!! error TS1003: Identifier expected.
==== tests/cases/conformance/jsx/14.tsx (6 errors) ====
<a[foo]></a[foo]>;
~
!!! error TS1003: Identifier expected.
@ -185,6 +214,7 @@ tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(35,21): error TS1005:
!!! error TS2304: Cannot find name 'foo'.
~
!!! error TS1109: Expression expected.
==== tests/cases/conformance/jsx/15.tsx (4 errors) ====
<a['foo']></a['foo']>;
~
!!! error TS1003: Identifier expected.
@ -194,45 +224,96 @@ tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(35,21): error TS1005:
!!! error TS2304: Cannot find name 'a'.
~
!!! error TS1109: Expression expected.
==== tests/cases/conformance/jsx/16.tsx (2 errors) ====
<a><a />;
~
!!! error TS17008: JSX element 'a' has no corresponding closing tag.
!!! error TS1005: '</' expected.
==== tests/cases/conformance/jsx/17.tsx (2 errors) ====
<a b={}>;
~
!!! error TS17008: JSX element 'a' has no corresponding closing tag.
!!! error TS1005: '</' expected.
==== tests/cases/conformance/jsx/18.tsx (2 errors) ====
var x = <div>one</div><div>two</div>;;
~~~~~~~~~~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
~
!!! error TS2657: JSX expressions must have one parent element.
==== tests/cases/conformance/jsx/19.tsx (2 errors) ====
var x = <div>one</div> /* intervening comment */ <div>two</div>;;
~~~~~~~~~~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
~
!!! error TS2657: JSX expressions must have one parent element.
==== tests/cases/conformance/jsx/20.tsx (1 errors) ====
<a>{"str";}</a>;
~
!!! error TS1005: '}' expected.
==== tests/cases/conformance/jsx/21.tsx (1 errors) ====
<span className="a", id="b" />;
~
!!! error TS1003: Identifier expected.
==== tests/cases/conformance/jsx/22.tsx (2 errors) ====
<div className"app">;
~~~~~
!!! error TS1003: Identifier expected.
~
!!! error TS1109: Expression expected.
==== tests/cases/conformance/jsx/23.tsx (2 errors) ====
<div {props} />;
~~~~~
!!! error TS1005: '...' expected.
~~~~~
!!! error TS2304: Cannot find name 'props'.
==== tests/cases/conformance/jsx/24.tsx (5 errors) ====
<div>stuff</div {...props}>;
~
!!! error TS1005: '>' expected.
~~~
!!! error TS1128: Declaration or statement expected.
~~~~~
!!! error TS2304: Cannot find name 'props'.
~
!!! error TS1109: Expression expected.
~
!!! error TS1109: Expression expected.
==== tests/cases/conformance/jsx/25.tsx (6 errors) ====
<div {...props}>stuff</div {...props}>;
~~~~~
!!! error TS2304: Cannot find name 'props'.
~
!!! error TS1005: '>' expected.
~~~
!!! error TS1128: Declaration or statement expected.
~~~~~
!!! error TS2304: Cannot find name 'props'.
~
!!! error TS1109: Expression expected.
~
!!! error TS1109: Expression expected.
==== tests/cases/conformance/jsx/26.tsx (0 errors) ====
<a>></a>;
==== tests/cases/conformance/jsx/27.tsx (0 errors) ====
<a> ></a>;
==== tests/cases/conformance/jsx/28.tsx (3 errors) ====
<a b=}>;
~
!!! error TS17008: JSX element 'a' has no corresponding closing tag.
~
!!! error TS1005: '{' expected.
!!! error TS1005: '</' expected.
==== tests/cases/conformance/jsx/29.tsx (4 errors) ====
<a b=<}>;
~
!!! error TS17008: JSX element 'a' has no corresponding closing tag.
@ -240,9 +321,13 @@ tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(35,21): error TS1005:
!!! error TS1005: '{' expected.
~
!!! error TS1109: Expression expected.
!!! error TS1005: '</' expected.
==== tests/cases/conformance/jsx/30.tsx (0 errors) ====
<a>}</a>;
==== tests/cases/conformance/jsx/31.tsx (1 errors) ====
<a .../*hai*/asdf/>;
~~~
!!! error TS1003: Identifier expected.
!!! error TS1005: '</' expected.
!!! error TS1003: Identifier expected.

View file

@ -1,79 +1,159 @@
//// [jsxInvalidEsprimaTestSuite.tsx]
//// [tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx] ////
//// [1.tsx]
declare var React: any;
</>;
<a: />;
<:a />;
<a b=d />;
<a>;
<a></b>;
<a foo="bar;
<a:b></b>;
<a:b.c></a:b.c>;
<a.b:c></a.b:c>;
<a.b.c></a>;
<.a></.a>;
<a.></a.>;
<a[foo]></a[foo]>;
<a['foo']></a['foo']>;
<a><a />;
<a b={}>;
var x = <div>one</div><div>two</div>;;
var x = <div>one</div> /* intervening comment */ <div>two</div>;;
<a>{"str";}</a>;
<span className="a", id="b" />;
<div className"app">;
</>;
//// [2.tsx]
<a: />;
//// [3.tsx]
<:a />;
//// [4.tsx]
<a b=d />;
//// [5.tsx]
<a>;
//// [6.tsx]
<a></b>;
//// [7.tsx]
<a foo="bar;
//// [8.tsx]
<a:b></b>;
//// [9.tsx]
<a:b.c></a:b.c>;
//// [10.tsx]
<a.b:c></a.b:c>;
//// [11.tsx]
<a.b.c></a>;
//// [12.tsx]
<.a></.a>;
//// [13.tsx]
<a.></a.>;
//// [14.tsx]
<a[foo]></a[foo]>;
//// [15.tsx]
<a['foo']></a['foo']>;
//// [16.tsx]
<a><a />;
//// [17.tsx]
<a b={}>;
//// [18.tsx]
var x = <div>one</div><div>two</div>;;
//// [19.tsx]
var x = <div>one</div> /* intervening comment */ <div>two</div>;;
//// [20.tsx]
<a>{"str";}</a>;
//// [21.tsx]
<span className="a", id="b" />;
//// [22.tsx]
<div className"app">;
//// [23.tsx]
<div {props} />;
//// [24.tsx]
<div>stuff</div {...props}>;
//// [25.tsx]
<div {...props}>stuff</div {...props}>;
//// [26.tsx]
<a>></a>;
//// [27.tsx]
<a> ></a>;
//// [28.tsx]
<a b=}>;
//// [29.tsx]
<a b=<}>;
//// [30.tsx]
<a>}</a>;
//// [31.tsx]
<a .../*hai*/asdf/>;
//// [jsxInvalidEsprimaTestSuite.jsx]
//// [1.jsx]
> ;
//// [2.jsx]
<a />;
< ;
//// [3.jsx]
< ;
a / > ;
<a b={d / > }/>
,
<a>;
<a></b>;
<a foo="bar;/>a:b></b>;
//// [4.jsx]
<a b={d / > }/>;
//// [5.jsx]
<a>;</>;
//// [6.jsx]
<a></b>;
//// [7.jsx]
<a foo="bar;/>;
//// [8.jsx]
<a b></b>;
//// [9.jsx]
<a b c></a>;
b.c > ;
//// [10.jsx]
<a.b c></a.b>;
c > ;
//// [11.jsx]
<a.b.c></a>;
< .a > ;
//// [12.jsx]
< .a > ;
a > ;
//// [13.jsx]
<a.></a.>;
//// [14.jsx]
<a />;
[foo] > ;
a[foo] > ;
//// [15.jsx]
<a />;
['foo'] > ;
a['foo'] > ;
<a><a />;
<a b=>;
var x = <div>one</div><div>two</div>;;
var x = <div>one</div> /* intervening comment */ /* intervening comment */ <div>two</div>;;
<a>{"str"}}</a>;
<span className="a"/> id="b" />;
<div className/>>;
<div {...props}/>;
<div>stuff</div>...props}>;
<div {...props}>stuff</div>...props}>;
<a>></a>;
<a> ></a>;
//// [16.jsx]
<a><a />;</>;
//// [17.jsx]
<a b=>;</>;
//// [18.jsx]
var x = <div>one</div>, <div>two</div>;
;
//// [19.jsx]
var x = <div>one</div> /* intervening comment */, /* intervening comment */ <div>two</div>;
;
//// [20.jsx]
<a>{"str"}}</a>;
//// [21.jsx]
<span className="a" id="b"/>;
//// [22.jsx]
<div className/>;
"app" > ;
//// [23.jsx]
<div {...props}/>;
//// [24.jsx]
<div>stuff</div>;
{
props;
}
> ;
//// [25.jsx]
<div {...props}>stuff</div>;
{
props;
}
> ;
//// [26.jsx]
<a>></a>;
//// [27.jsx]
<a> ></a>;
//// [28.jsx]
<a b=>;
</>;
//// [29.jsx]
<a b={ < }>;
<a>}</a>;
<a /> /*hai*//*hai*/asdf/>;</></></></>;
</>;
//// [30.jsx]
<a>}</a>;
//// [31.jsx]
<a asdf/>;

View file

@ -1,113 +1,150 @@
=== tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx ===
=== tests/cases/conformance/jsx/1.tsx ===
declare var React: any;
>React : Symbol(React, Decl(jsxInvalidEsprimaTestSuite.tsx, 0, 11))
>React : Symbol(React, Decl(1.tsx, 0, 11))
</>;
=== tests/cases/conformance/jsx/2.tsx ===
<a: />;
>a : Symbol(unknown)
=== tests/cases/conformance/jsx/3.tsx ===
<:a />;
No type information for this code.=== tests/cases/conformance/jsx/4.tsx ===
<a b=d />;
>a : Symbol(unknown)
>b : Symbol(b, Decl(jsxInvalidEsprimaTestSuite.tsx, 5, 2))
>b : Symbol(b, Decl(4.tsx, 0, 2))
=== tests/cases/conformance/jsx/5.tsx ===
<a>;
>a : Symbol(unknown)
=== tests/cases/conformance/jsx/6.tsx ===
<a></b>;
>a : Symbol(unknown)
>b : Symbol(unknown)
=== tests/cases/conformance/jsx/7.tsx ===
<a foo="bar;
>a : Symbol(unknown)
>foo : Symbol(foo, Decl(jsxInvalidEsprimaTestSuite.tsx, 8, 2))
>foo : Symbol(foo, Decl(7.tsx, 0, 2))
=== tests/cases/conformance/jsx/8.tsx ===
<a:b></b>;
>a : Symbol(unknown)
>b : Symbol(b, Decl(8.tsx, 0, 3))
>b : Symbol(unknown)
=== tests/cases/conformance/jsx/9.tsx ===
<a:b.c></a:b.c>;
>a : Symbol(unknown)
>b : Symbol(b, Decl(jsxInvalidEsprimaTestSuite.tsx, 10, 3))
>c : Symbol(c, Decl(jsxInvalidEsprimaTestSuite.tsx, 10, 5))
>b : Symbol(b, Decl(9.tsx, 0, 3))
>c : Symbol(c, Decl(9.tsx, 0, 5))
>a : Symbol(unknown)
=== tests/cases/conformance/jsx/10.tsx ===
<a.b:c></a.b:c>;
>c : Symbol(c, Decl(jsxInvalidEsprimaTestSuite.tsx, 11, 5))
>c : Symbol(c, Decl(10.tsx, 0, 5))
=== tests/cases/conformance/jsx/11.tsx ===
<a.b.c></a>;
>a : Symbol(unknown)
=== tests/cases/conformance/jsx/12.tsx ===
<.a></.a>;
No type information for this code.=== tests/cases/conformance/jsx/13.tsx ===
<a.></a.>;
No type information for this code.=== tests/cases/conformance/jsx/14.tsx ===
<a[foo]></a[foo]>;
>a : Symbol(unknown)
=== tests/cases/conformance/jsx/15.tsx ===
<a['foo']></a['foo']>;
>a : Symbol(unknown)
=== tests/cases/conformance/jsx/16.tsx ===
<a><a />;
>a : Symbol(unknown)
>a : Symbol(unknown)
=== tests/cases/conformance/jsx/17.tsx ===
<a b={}>;
>a : Symbol(unknown)
>b : Symbol(b, Decl(jsxInvalidEsprimaTestSuite.tsx, 18, 2))
>b : Symbol(b, Decl(17.tsx, 0, 2))
=== tests/cases/conformance/jsx/18.tsx ===
var x = <div>one</div><div>two</div>;;
>x : Symbol(x, Decl(18.tsx, 0, 3), Decl(19.tsx, 0, 3))
>div : Symbol(unknown)
>div : Symbol(unknown)
>div : Symbol(unknown)
>div : Symbol(unknown)
=== tests/cases/conformance/jsx/19.tsx ===
var x = <div>one</div> /* intervening comment */ <div>two</div>;;
>x : Symbol(x, Decl(18.tsx, 0, 3), Decl(19.tsx, 0, 3))
>div : Symbol(unknown)
>div : Symbol(unknown)
>div : Symbol(unknown)
>div : Symbol(unknown)
=== tests/cases/conformance/jsx/20.tsx ===
<a>{"str";}</a>;
>a : Symbol(unknown)
>a : Symbol(unknown)
=== tests/cases/conformance/jsx/21.tsx ===
<span className="a", id="b" />;
>span : Symbol(unknown)
>className : Symbol(className, Decl(jsxInvalidEsprimaTestSuite.tsx, 22, 5))
>className : Symbol(className, Decl(21.tsx, 0, 5))
>id : Symbol(id, Decl(21.tsx, 0, 20))
=== tests/cases/conformance/jsx/22.tsx ===
<div className"app">;
>div : Symbol(unknown)
>className : Symbol(className, Decl(jsxInvalidEsprimaTestSuite.tsx, 23, 4))
>className : Symbol(className, Decl(22.tsx, 0, 4))
=== tests/cases/conformance/jsx/23.tsx ===
<div {props} />;
>div : Symbol(unknown)
=== tests/cases/conformance/jsx/24.tsx ===
<div>stuff</div {...props}>;
>div : Symbol(unknown)
>div : Symbol(unknown)
=== tests/cases/conformance/jsx/25.tsx ===
<div {...props}>stuff</div {...props}>;
>div : Symbol(unknown)
>div : Symbol(unknown)
=== tests/cases/conformance/jsx/26.tsx ===
<a>></a>;
>a : Symbol(unknown)
>a : Symbol(unknown)
=== tests/cases/conformance/jsx/27.tsx ===
<a> ></a>;
>a : Symbol(unknown)
>a : Symbol(unknown)
=== tests/cases/conformance/jsx/28.tsx ===
<a b=}>;
>a : Symbol(unknown)
>b : Symbol(b, Decl(jsxInvalidEsprimaTestSuite.tsx, 31, 2))
>b : Symbol(b, Decl(28.tsx, 0, 2))
=== tests/cases/conformance/jsx/29.tsx ===
<a b=<}>;
>a : Symbol(unknown)
>b : Symbol(b, Decl(jsxInvalidEsprimaTestSuite.tsx, 32, 2))
>b : Symbol(b, Decl(29.tsx, 0, 2))
=== tests/cases/conformance/jsx/30.tsx ===
<a>}</a>;
>a : Symbol(unknown)
>a : Symbol(unknown)
=== tests/cases/conformance/jsx/31.tsx ===
<a .../*hai*/asdf/>;
>a : Symbol(unknown)
>asdf : Symbol(asdf, Decl(31.tsx, 0, 6))

View file

@ -1,4 +1,4 @@
=== tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx ===
=== tests/cases/conformance/jsx/1.tsx ===
declare var React: any;
>React : any
@ -7,10 +7,12 @@ declare var React: any;
> : any
> : any
=== tests/cases/conformance/jsx/2.tsx ===
<a: />;
><a: /> : any
>a : any
=== tests/cases/conformance/jsx/3.tsx ===
<:a />;
>< : boolean
> : any
@ -21,8 +23,8 @@ declare var React: any;
> : any
> : any
=== tests/cases/conformance/jsx/4.tsx ===
<a b=d />;
><a b=d />;<a>;<a></b>;<a foo="bar;<a:b></b> : any
><a b=d />; : any
>a : any
>b : boolean
@ -32,23 +34,32 @@ declare var React: any;
> : any
> : any
=== tests/cases/conformance/jsx/5.tsx ===
<a>;
><a>;<a></b>;<a foo="bar;<a:b></b> : any
><a>; : any
>a : any
> : any
=== tests/cases/conformance/jsx/6.tsx ===
<a></b>;
><a></b> : any
>a : any
>b : any
=== tests/cases/conformance/jsx/7.tsx ===
<a foo="bar;
><a foo="bar;< : any
><a foo="bar; : any
>a : any
>foo : string
=== tests/cases/conformance/jsx/8.tsx ===
<a:b></b>;
><a:b></b> : any
>a : any
>b : true
>b : any
=== tests/cases/conformance/jsx/9.tsx ===
<a:b.c></a:b.c>;
><a:b.c></a : any
>a : any
@ -61,6 +72,7 @@ declare var React: any;
>c : any
> : any
=== tests/cases/conformance/jsx/10.tsx ===
<a.b:c></a.b:c>;
><a.b:c></a.b : any
>a.b : any
@ -74,6 +86,7 @@ declare var React: any;
>c : any
> : any
=== tests/cases/conformance/jsx/11.tsx ===
<a.b.c></a>;
><a.b.c></a> : any
>a.b.c : any
@ -83,6 +96,7 @@ declare var React: any;
>c : any
>a : any
=== tests/cases/conformance/jsx/12.tsx ===
<.a></.a>;
><.a> : boolean
><.a : boolean
@ -95,6 +109,7 @@ declare var React: any;
>a : any
> : any
=== tests/cases/conformance/jsx/13.tsx ===
<a.></a.>;
><a.></a.> : any
>a. : any
@ -104,6 +119,7 @@ declare var React: any;
>a : any
> : any
=== tests/cases/conformance/jsx/14.tsx ===
<a[foo]></a[foo]>;
><a : any
>a : any
@ -117,6 +133,7 @@ declare var React: any;
>foo : any
> : any
=== tests/cases/conformance/jsx/15.tsx ===
<a['foo']></a['foo']>;
><a : any
>a : any
@ -130,18 +147,25 @@ declare var React: any;
>'foo' : "foo"
> : any
=== tests/cases/conformance/jsx/16.tsx ===
<a><a />;
><a><a />;<a b={}>;var x = <div>one</div><div>two</div>;;var x = <div>one</div> /* intervening comment */ <div>two</div>;;<a>{"str";}</a>;<span className="a", id="b" />;<div className"app">;<div {props} />;<div>stuff</div {...props}>;<div {...props}>stuff</div {...props}>;<a>></a>;<a> ></a>;<a b=}>;<a b=<}>;<a>}</a>;<a .../*hai*/asdf/>; : any
><a><a />; : any
>a : any
><a /> : any
>a : any
> : any
=== tests/cases/conformance/jsx/17.tsx ===
<a b={}>;
><a b={}>;var x = <div>one</div><div>two</div>;;var x = <div>one</div> /* intervening comment */ <div>two</div>;;<a>{"str";}</a>;<span className="a", id="b" />;<div className"app">;<div {props} />;<div>stuff</div {...props}>;<div {...props}>stuff</div {...props}>;<a>></a>;<a> ></a>;<a b=}>;<a b=<}>;<a>}</a>;<a .../*hai*/asdf/>; : any
><a b={}>; : any
>a : any
>b : any
> : any
=== tests/cases/conformance/jsx/18.tsx ===
var x = <div>one</div><div>two</div>;;
>x : any
><div>one</div><div>two</div> : any
><div>one</div> : any
>div : any
>div : any
@ -149,7 +173,10 @@ var x = <div>one</div><div>two</div>;;
>div : any
>div : any
=== tests/cases/conformance/jsx/19.tsx ===
var x = <div>one</div> /* intervening comment */ <div>two</div>;;
>x : any
><div>one</div> /* intervening comment */ <div>two</div> : any
><div>one</div> : any
>div : any
>div : any
@ -157,71 +184,97 @@ var x = <div>one</div> /* intervening comment */ <div>two</div>;;
>div : any
>div : any
=== tests/cases/conformance/jsx/20.tsx ===
<a>{"str";}</a>;
><a>{"str";}</a> : any
>a : any
>"str" : "str"
>a : any
=== tests/cases/conformance/jsx/21.tsx ===
<span className="a", id="b" />;
><span className="a", : any
><span className="a", id="b" /> : any
>span : any
>className : string
>id : string
=== tests/cases/conformance/jsx/22.tsx ===
<div className"app">;
><div className"app" : any
><div className : any
>div : any
>className : true
>"app"> : boolean
>"app" : "app"
> : any
=== tests/cases/conformance/jsx/23.tsx ===
<div {props} />;
><div {props} /> : any
>div : any
>props : any
=== tests/cases/conformance/jsx/24.tsx ===
<div>stuff</div {...props}>;
><div>stuff</div { : any
><div>stuff</div : any
>div : any
>div : any
>props : any
>> : boolean
> : any
> : any
=== tests/cases/conformance/jsx/25.tsx ===
<div {...props}>stuff</div {...props}>;
><div {...props}>stuff</div { : any
><div {...props}>stuff</div : any
>div : any
>props : any
>div : any
>props : any
>> : boolean
> : any
> : any
=== tests/cases/conformance/jsx/26.tsx ===
<a>></a>;
><a>></a> : any
>a : any
>a : any
=== tests/cases/conformance/jsx/27.tsx ===
<a> ></a>;
><a> ></a> : any
>a : any
>a : any
=== tests/cases/conformance/jsx/28.tsx ===
<a b=}>;
><a b=}>;<a b=<}>;<a>}</a>;<a .../*hai*/asdf/>; : any
><a b=}>; : any
>a : any
>b : any
> : any
=== tests/cases/conformance/jsx/29.tsx ===
<a b=<}>;
><a b=<}>;<a>}</a>;<a .../*hai*/asdf/>; : any
><a b=<}>; : any
>a : any
>b : boolean
>< : boolean
> : any
> : any
> : any
=== tests/cases/conformance/jsx/30.tsx ===
<a>}</a>;
><a>}</a> : any
>a : any
>a : any
=== tests/cases/conformance/jsx/31.tsx ===
<a .../*hai*/asdf/>;
><a ... : any
><a .../*hai*/asdf/> : any
>a : any
> : any
> : any
> : any
> : any
>asdf : true

View file

@ -0,0 +1,16 @@
//// [jsxMultilineAttributeStringValues.tsx]
const a = <input value="
foo: 23
"></input>;
const b = <input value='
foo: 23
'></input>;
//// [jsxMultilineAttributeStringValues.jsx]
var a = <input value="
foo: 23
"></input>;
var b = <input value='
foo: 23
'></input>;

View file

@ -0,0 +1,19 @@
=== tests/cases/compiler/jsxMultilineAttributeStringValues.tsx ===
const a = <input value="
>a : Symbol(a, Decl(jsxMultilineAttributeStringValues.tsx, 0, 5))
>input : Symbol(unknown)
>value : Symbol(value, Decl(jsxMultilineAttributeStringValues.tsx, 0, 16))
foo: 23
"></input>;
>input : Symbol(unknown)
const b = <input value='
>b : Symbol(b, Decl(jsxMultilineAttributeStringValues.tsx, 3, 5))
>input : Symbol(unknown)
>value : Symbol(value, Decl(jsxMultilineAttributeStringValues.tsx, 3, 16))
foo: 23
'></input>;
>input : Symbol(unknown)

View file

@ -0,0 +1,21 @@
=== tests/cases/compiler/jsxMultilineAttributeStringValues.tsx ===
const a = <input value="
>a : any
><input value=" foo: 23"></input> : any
>input : any
>value : string
foo: 23
"></input>;
>input : any
const b = <input value='
>b : any
><input value='foo: 23'></input> : any
>input : any
>value : string
foo: 23
'></input>;
>input : any

View file

@ -0,0 +1,17 @@
//// [jsxMultilineAttributeValuesReact.tsx]
declare var React: any;
const a = <input value="
foo: 23
"></input>;
const b = <input value='
foo: 23
'></input>;
const c = <input value='
foo: 23\n
'></input>;
//// [jsxMultilineAttributeValuesReact.js]
var a = React.createElement("input", { value: "\nfoo: 23\n" });
var b = React.createElement("input", { value: '\nfoo: 23\n' });
var c = React.createElement("input", { value: '\nfoo: 23\\n\n' });

View file

@ -0,0 +1,31 @@
=== tests/cases/compiler/jsxMultilineAttributeValuesReact.tsx ===
declare var React: any;
>React : Symbol(React, Decl(jsxMultilineAttributeValuesReact.tsx, 0, 11))
const a = <input value="
>a : Symbol(a, Decl(jsxMultilineAttributeValuesReact.tsx, 1, 5))
>input : Symbol(unknown)
>value : Symbol(value, Decl(jsxMultilineAttributeValuesReact.tsx, 1, 16))
foo: 23
"></input>;
>input : Symbol(unknown)
const b = <input value='
>b : Symbol(b, Decl(jsxMultilineAttributeValuesReact.tsx, 4, 5))
>input : Symbol(unknown)
>value : Symbol(value, Decl(jsxMultilineAttributeValuesReact.tsx, 4, 16))
foo: 23
'></input>;
>input : Symbol(unknown)
const c = <input value='
>c : Symbol(c, Decl(jsxMultilineAttributeValuesReact.tsx, 7, 5))
>input : Symbol(unknown)
>value : Symbol(value, Decl(jsxMultilineAttributeValuesReact.tsx, 7, 16))
foo: 23\n
'></input>;
>input : Symbol(unknown)

View file

@ -0,0 +1,34 @@
=== tests/cases/compiler/jsxMultilineAttributeValuesReact.tsx ===
declare var React: any;
>React : any
const a = <input value="
>a : any
><input value="foo: 23"></input> : any
>input : any
>value : string
foo: 23
"></input>;
>input : any
const b = <input value='
>b : any
><input value='foo: 23'></input> : any
>input : any
>value : string
foo: 23
'></input>;
>input : any
const c = <input value='
>c : any
><input value='foo: 23\n'></input> : any
>input : any
>value : string
foo: 23\n
'></input>;
>input : any

View file

@ -16,10 +16,10 @@ tests/cases/conformance/types/mapped/mappedTypeErrors.ts(37,24): error TS2344: T
Type 'T' is not assignable to type '"visible"'.
Type 'string | number' is not assignable to type '"visible"'.
Type 'string' is not assignable to type '"visible"'.
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(59,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type '{ [P in keyof T]: T[P]; }' at tests/cases/conformance/types/mapped/mappedTypeErrors.ts 57:8, but here has type '{ [P in keyof T]?: T[P] | undefined; }'.
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(60,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type '{ [P in keyof T]: T[P]; }' at tests/cases/conformance/types/mapped/mappedTypeErrors.ts 57:8, but here has type '{ readonly [P in keyof T]: T[P]; }'.
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(61,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type '{ [P in keyof T]: T[P]; }' at tests/cases/conformance/types/mapped/mappedTypeErrors.ts 57:8, but here has type '{ readonly [P in keyof T]?: T[P] | undefined; }'.
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(66,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type '{ [P in keyof T]: T[P]; }' at tests/cases/conformance/types/mapped/mappedTypeErrors.ts 64:8, but here has type '{ [P in keyof T]: T[P][]; }'.
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(59,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type '{ [P in keyof T]: T[P]; }', but here has type '{ [P in keyof T]?: T[P] | undefined; }'.
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(60,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type '{ [P in keyof T]: T[P]; }', but here has type '{ readonly [P in keyof T]: T[P]; }'.
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(61,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type '{ [P in keyof T]: T[P]; }', but here has type '{ readonly [P in keyof T]?: T[P] | undefined; }'.
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(66,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type '{ [P in keyof T]: T[P]; }', but here has type '{ [P in keyof T]: T[P][]; }'.
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(75,45): error TS2345: Argument of type '{ x: number; }' is not assignable to parameter of type 'Readonly<{ x: number; y: number; }>'.
Property 'y' is missing in type '{ x: number; }'.
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(77,59): error TS2345: Argument of type '{ x: number; y: number; z: number; }' is not assignable to parameter of type 'Readonly<{ x: number; y: number; }>'.
@ -138,20 +138,20 @@ tests/cases/conformance/types/mapped/mappedTypeErrors.ts(136,21): error TS2536:
var x: { [P in keyof T]: T[P] };
var x: { [P in keyof T]?: T[P] }; // Error
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type '{ [P in keyof T]: T[P]; }' at tests/cases/conformance/types/mapped/mappedTypeErrors.ts 57:8, but here has type '{ [P in keyof T]?: T[P] | undefined; }'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type '{ [P in keyof T]: T[P]; }', but here has type '{ [P in keyof T]?: T[P] | undefined; }'.
var x: { readonly [P in keyof T]: T[P] }; // Error
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type '{ [P in keyof T]: T[P]; }' at tests/cases/conformance/types/mapped/mappedTypeErrors.ts 57:8, but here has type '{ readonly [P in keyof T]: T[P]; }'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type '{ [P in keyof T]: T[P]; }', but here has type '{ readonly [P in keyof T]: T[P]; }'.
var x: { readonly [P in keyof T]?: T[P] }; // Error
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type '{ [P in keyof T]: T[P]; }' at tests/cases/conformance/types/mapped/mappedTypeErrors.ts 57:8, but here has type '{ readonly [P in keyof T]?: T[P] | undefined; }'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type '{ [P in keyof T]: T[P]; }', but here has type '{ readonly [P in keyof T]?: T[P] | undefined; }'.
}
function f12<T>() {
var x: { [P in keyof T]: T[P] };
var x: { [P in keyof T]: T[P][] }; // Error
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type '{ [P in keyof T]: T[P]; }' at tests/cases/conformance/types/mapped/mappedTypeErrors.ts 64:8, but here has type '{ [P in keyof T]: T[P][]; }'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type '{ [P in keyof T]: T[P]; }', but here has type '{ [P in keyof T]: T[P][]; }'.
}
// Check that inferences to mapped types are secondary

View file

@ -1,6 +1,6 @@
tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts(6,5): error TS2717: Subsequent property declarations must have the same type. Property 'x' has type 'string' at tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts 1:4, but here has type 'number'.
tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts(15,9): error TS2717: Subsequent property declarations must have the same type. Property 'x' has type 'T' at tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts 10:8, but here has type 'number'.
tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts(39,9): error TS2717: Subsequent property declarations must have the same type. Property 'x' has type 'T' at tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts 32:8, but here has type 'number'.
tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts(6,5): error TS2717: Subsequent property declarations must have the same type. Property 'x' must be of type 'string', but here has type 'number'.
tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts(15,9): error TS2717: Subsequent property declarations must have the same type. Property 'x' must be of type 'T', but here has type 'number'.
tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts(39,9): error TS2717: Subsequent property declarations must have the same type. Property 'x' must be of type 'T', but here has type 'number'.
==== tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts (3 errors) ====
@ -11,7 +11,7 @@ tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConfli
interface A {
x: number;
~
!!! error TS2717: Subsequent property declarations must have the same type. Property 'x' has type 'string' at tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts 1:4, but here has type 'number'.
!!! error TS2717: Subsequent property declarations must have the same type. Property 'x' must be of type 'string', but here has type 'number'.
}
module M {
@ -22,7 +22,7 @@ tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConfli
interface A<T> {
x: number; // error
~
!!! error TS2717: Subsequent property declarations must have the same type. Property 'x' has type 'T' at tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts 10:8, but here has type 'number'.
!!! error TS2717: Subsequent property declarations must have the same type. Property 'x' must be of type 'T', but here has type 'number'.
}
}
@ -48,6 +48,6 @@ tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConfli
export interface A<T> {
x: number; // error
~
!!! error TS2717: Subsequent property declarations must have the same type. Property 'x' has type 'T' at tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts 32:8, but here has type 'number'.
!!! error TS2717: Subsequent property declarations must have the same type. Property 'x' must be of type 'T', but here has type 'number'.
}
}

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