mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge branch 'master' into ownJsonParsing
This commit is contained in:
+1
-6
@@ -268,7 +268,6 @@ var builtLocalCompiler = path.join(builtLocalDirectory, compilerFilename);
|
||||
* @param {boolean} opts.preserveConstEnums: true if compiler should keep const enums in code
|
||||
* @param {boolean} opts.noResolve: true if compiler should not include non-rooted files in compilation
|
||||
* @param {boolean} opts.stripInternal: true if compiler should remove declarations marked as @internal
|
||||
* @param {boolean} opts.noMapRoot: true if compiler omit mapRoot option
|
||||
* @param {boolean} opts.inlineSourceMap: true if compiler should inline sourceMap
|
||||
* @param {Array} opts.types: array of types to include in compilation
|
||||
* @param callback: a function to execute after the compilation process ends
|
||||
@@ -321,9 +320,6 @@ function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, opts
|
||||
}
|
||||
else {
|
||||
options += " -sourcemap";
|
||||
if (!opts.noMapRoot) {
|
||||
options += " -mapRoot file:///" + path.resolve(path.dirname(outFile));
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -527,7 +523,7 @@ task("importDefinitelyTypedTests", [importDefinitelyTypedTestsJs], function () {
|
||||
|
||||
// Local target to build the compiler and services
|
||||
var tscFile = path.join(builtLocalDirectory, compilerFilename);
|
||||
compileFile(tscFile, compilerSources, [builtLocalDirectory, copyright].concat(compilerSources), [copyright], /*useBuiltCompiler:*/ false, { noMapRoot: true });
|
||||
compileFile(tscFile, compilerSources, [builtLocalDirectory, copyright].concat(compilerSources), [copyright], /*useBuiltCompiler:*/ false);
|
||||
|
||||
var servicesFile = path.join(builtLocalDirectory, "typescriptServices.js");
|
||||
var servicesFileInBrowserTest = path.join(builtLocalDirectory, "typescriptServicesInBrowserTest.js");
|
||||
@@ -582,7 +578,6 @@ compileFile(
|
||||
keepComments: true,
|
||||
noResolve: false,
|
||||
stripInternal: true,
|
||||
noMapRoot: true,
|
||||
inlineSourceMap: true
|
||||
});
|
||||
|
||||
|
||||
@@ -2333,7 +2333,7 @@ namespace ts {
|
||||
// A common practice in node modules is to set 'export = module.exports = {}', this ensures that 'exports'
|
||||
// is still pointing to 'module.exports'.
|
||||
// We do not want to consider this as 'export=' since a module can have only one of these.
|
||||
// Similarlly we do not want to treat 'module.exports = exports' as an 'export='.
|
||||
// Similarly we do not want to treat 'module.exports = exports' as an 'export='.
|
||||
const assignedExpression = getRightMostAssignedExpression(node.right);
|
||||
if (isEmptyObjectLiteral(assignedExpression) || isExportsOrModuleExportsOrAlias(assignedExpression)) {
|
||||
// Mark it as a module in case there are no other exports in the file
|
||||
@@ -2741,6 +2741,10 @@ namespace ts {
|
||||
transformFlags |= TransformFlags.AssertES2015;
|
||||
}
|
||||
|
||||
if (expression.kind === SyntaxKind.ImportKeyword) {
|
||||
transformFlags |= TransformFlags.ContainsDynamicImport;
|
||||
}
|
||||
|
||||
node.transformFlags = transformFlags | TransformFlags.HasComputedFlags;
|
||||
return transformFlags & ~TransformFlags.ArrayLiteralOrCallOrNewExcludes;
|
||||
}
|
||||
|
||||
+136
-37
@@ -2291,7 +2291,7 @@ namespace ts {
|
||||
Debug.assert(typeNode !== undefined, "should always get typenode?");
|
||||
const options = { removeComments: true };
|
||||
const writer = createTextWriter("");
|
||||
const printer = createPrinter(options, writer);
|
||||
const printer = createPrinter(options);
|
||||
const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
|
||||
printer.writeNode(EmitHint.Unspecified, typeNode, /*sourceFile*/ sourceFile, writer);
|
||||
const result = writer.getText();
|
||||
@@ -8362,6 +8362,12 @@ namespace ts {
|
||||
/**
|
||||
* This is *not* a bi-directional relationship.
|
||||
* If one needs to check both directions for comparability, use a second call to this function or 'checkTypeComparableTo'.
|
||||
*
|
||||
* A type S is comparable to a type T if some (but not necessarily all) of the possible values of S are also possible values of T.
|
||||
* It is used to check following cases:
|
||||
* - the types of the left and right sides of equality/inequality operators (`===`, `!==`, `==`, `!=`).
|
||||
* - the types of `case` clause expressions and their respective `switch` expressions.
|
||||
* - the type of an expression in a type assertion with the type being asserted.
|
||||
*/
|
||||
function isTypeComparableTo(source: Type, target: Type): boolean {
|
||||
return isTypeRelatedTo(source, target, comparableRelation);
|
||||
@@ -8708,6 +8714,7 @@ namespace ts {
|
||||
let expandingFlags: number;
|
||||
let depth = 0;
|
||||
let overflow = false;
|
||||
let isIntersectionConstituent = false;
|
||||
|
||||
Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking");
|
||||
|
||||
@@ -8790,7 +8797,6 @@ namespace ts {
|
||||
* * Ternary.False if they are not related.
|
||||
*/
|
||||
function isRelatedTo(source: Type, target: Type, reportErrors?: boolean, headMessage?: DiagnosticMessage): Ternary {
|
||||
let result: Ternary;
|
||||
if (source.flags & TypeFlags.StringOrNumberLiteral && source.flags & TypeFlags.FreshLiteral) {
|
||||
source = (<LiteralType>source).regularType;
|
||||
}
|
||||
@@ -8822,32 +8828,40 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
if (relation !== comparableRelation &&
|
||||
!(source.flags & TypeFlags.UnionOrIntersection) &&
|
||||
!(target.flags & TypeFlags.Union) &&
|
||||
!isIntersectionConstituent &&
|
||||
source !== globalObjectType &&
|
||||
getPropertiesOfType(source).length > 0 &&
|
||||
isWeakType(target) &&
|
||||
!hasCommonProperties(source, target)) {
|
||||
if (reportErrors) {
|
||||
reportError(Diagnostics.Type_0_has_no_properties_in_common_with_type_1, typeToString(source), typeToString(target));
|
||||
}
|
||||
return Ternary.False;
|
||||
}
|
||||
|
||||
let result = Ternary.False;
|
||||
const saveErrorInfo = errorInfo;
|
||||
const saveIsIntersectionConstituent = isIntersectionConstituent;
|
||||
isIntersectionConstituent = false;
|
||||
|
||||
// Note that these checks are specifically ordered to produce correct results. In particular,
|
||||
// we need to deconstruct unions before intersections (because unions are always at the top),
|
||||
// and we need to handle "each" relations before "some" relations for the same kind of type.
|
||||
if (source.flags & TypeFlags.Union) {
|
||||
if (relation === comparableRelation) {
|
||||
result = someTypeRelatedToType(source as UnionType, target, reportErrors && !(source.flags & TypeFlags.Primitive));
|
||||
}
|
||||
else {
|
||||
result = eachTypeRelatedToType(source as UnionType, target, reportErrors && !(source.flags & TypeFlags.Primitive));
|
||||
}
|
||||
if (result) {
|
||||
return result;
|
||||
}
|
||||
result = relation === comparableRelation ?
|
||||
someTypeRelatedToType(source as UnionType, target, reportErrors && !(source.flags & TypeFlags.Primitive)) :
|
||||
eachTypeRelatedToType(source as UnionType, target, reportErrors && !(source.flags & TypeFlags.Primitive));
|
||||
}
|
||||
else {
|
||||
if (target.flags & TypeFlags.Union) {
|
||||
if (result = typeRelatedToSomeType(source, <UnionType>target, reportErrors && !(source.flags & TypeFlags.Primitive) && !(target.flags & TypeFlags.Primitive))) {
|
||||
return result;
|
||||
}
|
||||
result = typeRelatedToSomeType(source, <UnionType>target, reportErrors && !(source.flags & TypeFlags.Primitive) && !(target.flags & TypeFlags.Primitive));
|
||||
}
|
||||
else if (target.flags & TypeFlags.Intersection) {
|
||||
if (result = typeRelatedToEachType(source, target as IntersectionType, reportErrors)) {
|
||||
return result;
|
||||
}
|
||||
isIntersectionConstituent = true;
|
||||
result = typeRelatedToEachType(source, target as IntersectionType, reportErrors);
|
||||
}
|
||||
else if (source.flags & TypeFlags.Intersection) {
|
||||
// Check to see if any constituents of the intersection are immediately related to the target.
|
||||
@@ -8863,20 +8877,18 @@ namespace ts {
|
||||
//
|
||||
// - For a primitive type or type parameter (such as 'number = A & B') there is no point in
|
||||
// breaking the intersection apart.
|
||||
if (result = someTypeRelatedToType(<IntersectionType>source, target, /*reportErrors*/ false)) {
|
||||
return result;
|
||||
}
|
||||
result = someTypeRelatedToType(<IntersectionType>source, target, /*reportErrors*/ false);
|
||||
}
|
||||
|
||||
if (source.flags & TypeFlags.StructuredOrTypeVariable || target.flags & TypeFlags.StructuredOrTypeVariable) {
|
||||
if (!result && (source.flags & TypeFlags.StructuredOrTypeVariable || target.flags & TypeFlags.StructuredOrTypeVariable)) {
|
||||
if (result = recursiveTypeRelatedTo(source, target, reportErrors)) {
|
||||
errorInfo = saveErrorInfo;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (reportErrors) {
|
||||
isIntersectionConstituent = saveIsIntersectionConstituent;
|
||||
|
||||
if (!result && reportErrors) {
|
||||
if (source.flags & TypeFlags.Object && target.flags & TypeFlags.Primitive) {
|
||||
tryElaborateErrorsForPrimitivesAndObjects(source, target);
|
||||
}
|
||||
@@ -8885,7 +8897,7 @@ namespace ts {
|
||||
}
|
||||
reportRelationError(headMessage, source, target);
|
||||
}
|
||||
return Ternary.False;
|
||||
return result;
|
||||
}
|
||||
|
||||
function isIdenticalTo(source: Type, target: Type): Ternary {
|
||||
@@ -8984,7 +8996,7 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
function typeRelatedToEachType(source: Type, target: UnionOrIntersectionType, reportErrors: boolean): Ternary {
|
||||
function typeRelatedToEachType(source: Type, target: IntersectionType, reportErrors: boolean): Ternary {
|
||||
let result = Ternary.True;
|
||||
const targetTypes = target.types;
|
||||
for (const targetType of targetTypes) {
|
||||
@@ -9286,7 +9298,6 @@ namespace ts {
|
||||
const requireOptionalProperties = relation === subtypeRelation && !(getObjectFlags(source) & ObjectFlags.ObjectLiteral);
|
||||
for (const targetProp of properties) {
|
||||
const sourceProp = getPropertyOfType(source, targetProp.name);
|
||||
|
||||
if (sourceProp !== targetProp) {
|
||||
if (!sourceProp) {
|
||||
if (!(targetProp.flags & SymbolFlags.Optional) || requireOptionalProperties) {
|
||||
@@ -9365,6 +9376,34 @@ namespace ts {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* A type is 'weak' if it is an object type with at least one optional property
|
||||
* and no required properties, call/construct signatures or index signatures
|
||||
*/
|
||||
function isWeakType(type: Type): boolean {
|
||||
if (type.flags & TypeFlags.Object) {
|
||||
const resolved = resolveStructuredTypeMembers(<ObjectType>type);
|
||||
return resolved.callSignatures.length === 0 && resolved.constructSignatures.length === 0 &&
|
||||
!resolved.stringIndexInfo && !resolved.numberIndexInfo &&
|
||||
resolved.properties.length > 0 &&
|
||||
every(resolved.properties, p => !!(p.flags & SymbolFlags.Optional));
|
||||
}
|
||||
if (type.flags & TypeFlags.Intersection) {
|
||||
return every((<IntersectionType>type).types, isWeakType);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function hasCommonProperties(source: Type, target: Type) {
|
||||
const isComparingJsxAttributes = !!(source.flags & TypeFlags.JsxAttributes);
|
||||
for (const prop of getPropertiesOfType(source)) {
|
||||
if (isKnownProperty(target, prop.name, isComparingJsxAttributes)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function propertiesIdenticalTo(source: Type, target: Type): Ternary {
|
||||
if (!(source.flags & TypeFlags.Object && target.flags & TypeFlags.Object)) {
|
||||
return Ternary.False;
|
||||
@@ -14153,8 +14192,10 @@ namespace ts {
|
||||
function isKnownProperty(targetType: Type, name: string, isComparingJsxAttributes: boolean): boolean {
|
||||
if (targetType.flags & TypeFlags.Object) {
|
||||
const resolved = resolveStructuredTypeMembers(<ObjectType>targetType);
|
||||
if (resolved.stringIndexInfo || resolved.numberIndexInfo && isNumericLiteralName(name) ||
|
||||
getPropertyOfType(targetType, name) || isComparingJsxAttributes && !isUnhyphenatedJsxName(name)) {
|
||||
if (resolved.stringIndexInfo ||
|
||||
resolved.numberIndexInfo && isNumericLiteralName(name) ||
|
||||
getPropertyOfType(targetType, name) ||
|
||||
isComparingJsxAttributes && !isUnhyphenatedJsxName(name)) {
|
||||
// For JSXAttributes, if the attribute has a hyphenated name, consider that the attribute to be known.
|
||||
return true;
|
||||
}
|
||||
@@ -16129,6 +16170,35 @@ namespace ts {
|
||||
return getReturnTypeOfSignature(signature);
|
||||
}
|
||||
|
||||
function checkImportCallExpression(node: ImportCall): Type {
|
||||
// Check grammar of dynamic import
|
||||
checkGrammarArguments(node, node.arguments) || checkGrammarImportCallExpression(node);
|
||||
|
||||
if (node.arguments.length === 0) {
|
||||
return createPromiseReturnType(node, anyType);
|
||||
}
|
||||
const specifier = node.arguments[0];
|
||||
const specifierType = checkExpressionCached(specifier);
|
||||
// Even though multiple arugments is grammatically incorrect, type-check extra arguments for completion
|
||||
for (let i = 1; i < node.arguments.length; ++i) {
|
||||
checkExpressionCached(node.arguments[i]);
|
||||
}
|
||||
|
||||
if (specifierType.flags & TypeFlags.Undefined || specifierType.flags & TypeFlags.Null || !isTypeAssignableTo(specifierType, stringType)) {
|
||||
error(specifier, Diagnostics.Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0, typeToString(specifierType));
|
||||
}
|
||||
|
||||
// resolveExternalModuleName will return undefined if the moduleReferenceExpression is not a string literal
|
||||
const moduleSymbol = resolveExternalModuleName(node, specifier);
|
||||
if (moduleSymbol) {
|
||||
const esModuleSymbol = resolveESModuleSymbol(moduleSymbol, specifier, /*dontRecursivelyResolve*/ true);
|
||||
if (esModuleSymbol) {
|
||||
return createPromiseReturnType(node, getTypeOfSymbol(esModuleSymbol));
|
||||
}
|
||||
}
|
||||
return createPromiseReturnType(node, anyType);
|
||||
}
|
||||
|
||||
function isCommonJsRequire(node: Node) {
|
||||
if (!isRequireCall(node, /*checkArgumentIsStringLiteral*/ true)) {
|
||||
return false;
|
||||
@@ -16335,14 +16405,18 @@ namespace ts {
|
||||
return emptyObjectType;
|
||||
}
|
||||
|
||||
function createPromiseReturnType(func: FunctionLikeDeclaration, promisedType: Type) {
|
||||
function createPromiseReturnType(func: FunctionLikeDeclaration | ImportCall, promisedType: Type) {
|
||||
const promiseType = createPromiseType(promisedType);
|
||||
if (promiseType === emptyObjectType) {
|
||||
error(func, Diagnostics.An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option);
|
||||
error(func, isImportCall(func) ?
|
||||
Diagnostics.A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option :
|
||||
Diagnostics.An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option);
|
||||
return unknownType;
|
||||
}
|
||||
else if (!getGlobalPromiseConstructorSymbol(/*reportErrors*/ true)) {
|
||||
error(func, Diagnostics.An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option);
|
||||
error(func, isImportCall(func) ?
|
||||
Diagnostics.A_dynamic_import_call_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option :
|
||||
Diagnostics.An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option);
|
||||
}
|
||||
|
||||
return promiseType;
|
||||
@@ -17701,6 +17775,10 @@ namespace ts {
|
||||
case SyntaxKind.ElementAccessExpression:
|
||||
return checkIndexedAccess(<ElementAccessExpression>node);
|
||||
case SyntaxKind.CallExpression:
|
||||
if ((<CallExpression>node).expression.kind === SyntaxKind.ImportKeyword) {
|
||||
return checkImportCallExpression(<ImportCall>node);
|
||||
}
|
||||
/* falls through */
|
||||
case SyntaxKind.NewExpression:
|
||||
return checkCallExpression(<CallExpression>node);
|
||||
case SyntaxKind.TaggedTemplateExpression:
|
||||
@@ -22710,12 +22788,12 @@ namespace ts {
|
||||
return symbols;
|
||||
}
|
||||
else if (symbol.flags & SymbolFlags.Transient) {
|
||||
if ((symbol as SymbolLinks).leftSpread) {
|
||||
const links = symbol as SymbolLinks;
|
||||
return [...getRootSymbols(links.leftSpread), ...getRootSymbols(links.rightSpread)];
|
||||
const transient = symbol as TransientSymbol;
|
||||
if (transient.leftSpread) {
|
||||
return [...getRootSymbols(transient.leftSpread), ...getRootSymbols(transient.rightSpread)];
|
||||
}
|
||||
if ((symbol as SymbolLinks).syntheticOrigin) {
|
||||
return getRootSymbols((symbol as SymbolLinks).syntheticOrigin);
|
||||
if (transient.syntheticOrigin) {
|
||||
return getRootSymbols(transient.syntheticOrigin);
|
||||
}
|
||||
|
||||
let target: Symbol;
|
||||
@@ -24626,6 +24704,27 @@ namespace ts {
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
function checkGrammarImportCallExpression(node: ImportCall): boolean {
|
||||
if (modulekind === ModuleKind.ES2015) {
|
||||
return grammarErrorOnNode(node, Diagnostics.Dynamic_import_cannot_be_used_when_targeting_ECMAScript_2015_modules);
|
||||
}
|
||||
|
||||
if (node.typeArguments) {
|
||||
return grammarErrorOnNode(node, Diagnostics.Dynamic_import_cannot_have_type_arguments);
|
||||
}
|
||||
|
||||
const arguments = node.arguments;
|
||||
if (arguments.length !== 1) {
|
||||
return grammarErrorOnNode(node, Diagnostics.Dynamic_import_must_have_one_specifier_as_an_argument);
|
||||
}
|
||||
|
||||
// see: parseArgumentOrArrayLiteralElement...we use this function which parse arguments of callExpression to parse specifier for dynamic import.
|
||||
// parseArgumentOrArrayLiteralElement allows spread element to be in an argument list which is not allowed as specifier in dynamic import.
|
||||
if (isSpreadElement(arguments[0])) {
|
||||
return grammarErrorOnNode(arguments[0], Diagnostics.Specifier_of_dynamic_import_cannot_be_spread_element);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Like 'isDeclarationName', but returns true for LHS of `import { x as y }` or `export { x as y }`. */
|
||||
|
||||
@@ -100,11 +100,12 @@ namespace ts {
|
||||
"umd": ModuleKind.UMD,
|
||||
"es6": ModuleKind.ES2015,
|
||||
"es2015": ModuleKind.ES2015,
|
||||
"esnext": ModuleKind.ESNext
|
||||
}),
|
||||
paramType: Diagnostics.KIND,
|
||||
showInSimplifiedHelpView: true,
|
||||
category: Diagnostics.Basic_Options,
|
||||
description: Diagnostics.Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015,
|
||||
description: Diagnostics.Specify_module_code_generation_Colon_commonjs_amd_system_umd_es2015_or_ESNext,
|
||||
},
|
||||
{
|
||||
name: "lib",
|
||||
@@ -1339,7 +1340,7 @@ namespace ts {
|
||||
for (let i = 0; i < nameColumn.length; i++) {
|
||||
const optionName = nameColumn[i];
|
||||
const description = descriptionColumn[i];
|
||||
result.push(tab + tab + optionName + makePadding(marginLength - optionName.length + 2) + description);
|
||||
result.push(optionName && `${tab}${tab}${optionName}${ description && (makePadding(marginLength - optionName.length + 2) + description)}`);
|
||||
}
|
||||
if (configurations.files && configurations.files.length) {
|
||||
result.push(`${tab}},`);
|
||||
|
||||
@@ -883,14 +883,31 @@
|
||||
"category": "Error",
|
||||
"code": 1322
|
||||
},
|
||||
"String literal with double quotes expected.": {
|
||||
"Dynamic import cannot be used when targeting ECMAScript 2015 modules.": {
|
||||
"category": "Error",
|
||||
"code": 1323
|
||||
},
|
||||
"Property value can only be string literal, numeric literal, 'true', 'false', 'null', object literal or array literal.": {
|
||||
"Dynamic import must have one specifier as an argument.": {
|
||||
"category": "Error",
|
||||
"code": 1324
|
||||
},
|
||||
"Specifier of dynamic import cannot be spread element.": {
|
||||
"category": "Error",
|
||||
"code": 1325
|
||||
},
|
||||
"Dynamic import cannot have type arguments": {
|
||||
"category": "Error",
|
||||
"code": 1326
|
||||
},
|
||||
"String literal with double quotes expected.": {
|
||||
"category": "Error",
|
||||
"code": 1327
|
||||
},
|
||||
"Property value can only be string literal, numeric literal, 'true', 'false', 'null', object literal or array literal.": {
|
||||
"category": "Error",
|
||||
"code": 1328
|
||||
},
|
||||
|
||||
"Duplicate identifier '{0}'.": {
|
||||
"category": "Error",
|
||||
"code": 2300
|
||||
@@ -1887,6 +1904,10 @@
|
||||
"category": "Error",
|
||||
"code": 2558
|
||||
},
|
||||
"Type '{0}' has no properties in common with type '{1}'.": {
|
||||
"category": "Error",
|
||||
"code": 2559
|
||||
},
|
||||
"JSX element attributes type '{0}' may not be a union type.": {
|
||||
"category": "Error",
|
||||
"code": 2600
|
||||
@@ -1931,10 +1952,6 @@
|
||||
"category": "Error",
|
||||
"code": 2649
|
||||
},
|
||||
"Cannot emit namespaced JSX elements in React.": {
|
||||
"category": "Error",
|
||||
"code": 2650
|
||||
},
|
||||
"A member initializer in a enum declaration cannot reference members declared after it, including members defined in other enums.": {
|
||||
"category": "Error",
|
||||
"code": 2651
|
||||
@@ -2167,6 +2184,14 @@
|
||||
"category": "Error",
|
||||
"code": 2710
|
||||
},
|
||||
"A dynamic import call returns a 'Promise'. Make sure you have a declaration for 'Promise' or include 'ES2015' in your `--lib` option.": {
|
||||
"category": "Error",
|
||||
"code": 2711
|
||||
},
|
||||
"A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option.": {
|
||||
"category": "Error",
|
||||
"code": 2712
|
||||
},
|
||||
|
||||
"Import declaration '{0}' is using private name '{1}'.": {
|
||||
"category": "Error",
|
||||
@@ -2633,7 +2658,7 @@
|
||||
"category": "Message",
|
||||
"code": 6015
|
||||
},
|
||||
"Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'.": {
|
||||
"Specify module code generation: 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'.": {
|
||||
"category": "Message",
|
||||
"code": 6016
|
||||
},
|
||||
@@ -3369,6 +3394,11 @@
|
||||
"category": "Error",
|
||||
"code": 7035
|
||||
},
|
||||
"Dynamic import's specifier must be of type 'string', but here has type '{0}'.": {
|
||||
"category": "Error",
|
||||
"code": 7036
|
||||
},
|
||||
|
||||
"You cannot rename this element.": {
|
||||
"category": "Error",
|
||||
"code": 8000
|
||||
|
||||
@@ -740,6 +740,7 @@ namespace ts {
|
||||
case SyntaxKind.SuperKeyword:
|
||||
case SyntaxKind.TrueKeyword:
|
||||
case SyntaxKind.ThisKeyword:
|
||||
case SyntaxKind.ImportKeyword:
|
||||
writeTokenNode(node);
|
||||
return;
|
||||
|
||||
|
||||
+42
-25
@@ -45,10 +45,16 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
// Invokes a callback for each child of the given node. The 'cbNode' callback is invoked for all child nodes
|
||||
// stored in properties. If a 'cbNodes' callback is specified, it is invoked for embedded arrays; otherwise,
|
||||
// embedded arrays are flattened and the 'cbNode' callback is invoked for each element. If a callback returns
|
||||
// a truthy value, iteration stops and that value is returned. Otherwise, undefined is returned.
|
||||
/**
|
||||
* Invokes a callback for each child of the given node. The 'cbNode' callback is invoked for all child nodes
|
||||
* stored in properties. If a 'cbNodes' callback is specified, it is invoked for embedded arrays; otherwise,
|
||||
* embedded arrays are flattened and the 'cbNode' callback is invoked for each element. If a callback returns
|
||||
* a truthy value, iteration stops and that value is returned. Otherwise, undefined is returned.
|
||||
*
|
||||
* @param node a given node to visit its children
|
||||
* @param cbNode a callback to be invoked for all child nodes
|
||||
* @param cbNodeArray a callback to be invoked for embedded array
|
||||
*/
|
||||
export function forEachChild<T>(node: Node, cbNode: (node: Node) => T | undefined, cbNodeArray?: (nodes: NodeArray<Node>) => T | undefined): T | undefined {
|
||||
if (!node) {
|
||||
return;
|
||||
@@ -2442,7 +2448,7 @@ namespace ts {
|
||||
if (token() === SyntaxKind.OpenParenToken || token() === SyntaxKind.LessThanToken) {
|
||||
return parseSignatureMember(SyntaxKind.CallSignature);
|
||||
}
|
||||
if (token() === SyntaxKind.NewKeyword && lookAhead(isStartOfConstructSignature)) {
|
||||
if (token() === SyntaxKind.NewKeyword && lookAhead(nextTokenIsOpenParenOrLessThan)) {
|
||||
return parseSignatureMember(SyntaxKind.ConstructSignature);
|
||||
}
|
||||
const fullStart = getNodePos();
|
||||
@@ -2453,7 +2459,7 @@ namespace ts {
|
||||
return parsePropertyOrMethodSignature(fullStart, modifiers);
|
||||
}
|
||||
|
||||
function isStartOfConstructSignature() {
|
||||
function nextTokenIsOpenParenOrLessThan() {
|
||||
nextToken();
|
||||
return token() === SyntaxKind.OpenParenToken || token() === SyntaxKind.LessThanToken;
|
||||
}
|
||||
@@ -2809,6 +2815,7 @@ namespace ts {
|
||||
case SyntaxKind.SlashToken:
|
||||
case SyntaxKind.SlashEqualsToken:
|
||||
case SyntaxKind.Identifier:
|
||||
case SyntaxKind.ImportKeyword:
|
||||
return true;
|
||||
default:
|
||||
return isIdentifier();
|
||||
@@ -3542,10 +3549,10 @@ namespace ts {
|
||||
* 5) --UnaryExpression[?Yield]
|
||||
*/
|
||||
if (isUpdateExpression()) {
|
||||
const incrementExpression = parseIncrementExpression();
|
||||
const updateExpression = parseUpdateExpression();
|
||||
return token() === SyntaxKind.AsteriskAsteriskToken ?
|
||||
<BinaryExpression>parseBinaryExpressionRest(getBinaryOperatorPrecedence(), incrementExpression) :
|
||||
incrementExpression;
|
||||
<BinaryExpression>parseBinaryExpressionRest(getBinaryOperatorPrecedence(), updateExpression) :
|
||||
updateExpression;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3611,7 +3618,7 @@ namespace ts {
|
||||
}
|
||||
// falls through
|
||||
default:
|
||||
return parseIncrementExpression();
|
||||
return parseUpdateExpression();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3627,7 +3634,7 @@ namespace ts {
|
||||
*/
|
||||
function isUpdateExpression(): boolean {
|
||||
// This function is called inside parseUnaryExpression to decide
|
||||
// whether to call parseSimpleUnaryExpression or call parseIncrementExpression directly
|
||||
// whether to call parseSimpleUnaryExpression or call parseUpdateExpression directly
|
||||
switch (token()) {
|
||||
case SyntaxKind.PlusToken:
|
||||
case SyntaxKind.MinusToken:
|
||||
@@ -3651,9 +3658,9 @@ namespace ts {
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse ES7 IncrementExpression. IncrementExpression is used instead of ES6's PostFixExpression.
|
||||
* Parse ES7 UpdateExpression. UpdateExpression is used instead of ES6's PostFixExpression.
|
||||
*
|
||||
* ES7 IncrementExpression[yield]:
|
||||
* ES7 UpdateExpression[yield]:
|
||||
* 1) LeftHandSideExpression[?yield]
|
||||
* 2) LeftHandSideExpression[?yield] [[no LineTerminator here]]++
|
||||
* 3) LeftHandSideExpression[?yield] [[no LineTerminator here]]--
|
||||
@@ -3661,7 +3668,7 @@ namespace ts {
|
||||
* 5) --LeftHandSideExpression[?yield]
|
||||
* In TypeScript (2), (3) are parsed as PostfixUnaryExpression. (4), (5) are parsed as PrefixUnaryExpression
|
||||
*/
|
||||
function parseIncrementExpression(): IncrementExpression {
|
||||
function parseUpdateExpression(): UpdateExpression {
|
||||
if (token() === SyntaxKind.PlusPlusToken || token() === SyntaxKind.MinusMinusToken) {
|
||||
const node = <PrefixUnaryExpression>createNode(SyntaxKind.PrefixUnaryExpression);
|
||||
node.operator = <PrefixUnaryOperator>token();
|
||||
@@ -3711,17 +3718,27 @@ namespace ts {
|
||||
// CallExpression Arguments
|
||||
// CallExpression[Expression]
|
||||
// CallExpression.IdentifierName
|
||||
// super ( ArgumentListopt )
|
||||
// import (AssignmentExpression)
|
||||
// super Arguments
|
||||
// super.IdentifierName
|
||||
//
|
||||
// Because of the recursion in these calls, we need to bottom out first. There are two
|
||||
// bottom out states we can run into. Either we see 'super' which must start either of
|
||||
// the last two CallExpression productions. Or we have a MemberExpression which either
|
||||
// completes the LeftHandSideExpression, or starts the beginning of the first four
|
||||
// CallExpression productions.
|
||||
const expression = token() === SyntaxKind.SuperKeyword
|
||||
? parseSuperExpression()
|
||||
: parseMemberExpressionOrHigher();
|
||||
// Because of the recursion in these calls, we need to bottom out first. There are three
|
||||
// bottom out states we can run into: 1) We see 'super' which must start either of
|
||||
// the last two CallExpression productions. 2) We see 'import' which must start import call.
|
||||
// 3)we have a MemberExpression which either completes the LeftHandSideExpression,
|
||||
// or starts the beginning of the first four CallExpression productions.
|
||||
let expression: MemberExpression;
|
||||
if (token() === SyntaxKind.ImportKeyword && lookAhead(nextTokenIsOpenParenOrLessThan)) {
|
||||
// We don't want to eagerly consume all import keyword as import call expression so we look a head to find "("
|
||||
// For example:
|
||||
// var foo3 = require("subfolder
|
||||
// import * as foo1 from "module-from-node -> we want this import to be a statement rather than import call expression
|
||||
sourceFile.flags |= NodeFlags.PossiblyContainDynamicImport;
|
||||
expression = parseTokenNode<PrimaryExpression>();
|
||||
}
|
||||
else {
|
||||
expression = token() === SyntaxKind.SuperKeyword ? parseSuperExpression() : parseMemberExpressionOrHigher();
|
||||
}
|
||||
|
||||
// Now, we *may* be complete. However, we might have consumed the start of a
|
||||
// CallExpression. As such, we need to consume the rest of it here to be complete.
|
||||
@@ -3729,7 +3746,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
function parseMemberExpressionOrHigher(): MemberExpression {
|
||||
// Note: to make our lives simpler, we decompose the the NewExpression productions and
|
||||
// Note: to make our lives simpler, we decompose the NewExpression productions and
|
||||
// place ObjectCreationExpression and FunctionExpression into PrimaryExpression.
|
||||
// like so:
|
||||
//
|
||||
@@ -4823,11 +4840,11 @@ namespace ts {
|
||||
// however, we say they are here so that we may gracefully parse them and error later.
|
||||
case SyntaxKind.CatchKeyword:
|
||||
case SyntaxKind.FinallyKeyword:
|
||||
case SyntaxKind.ImportKeyword:
|
||||
return true;
|
||||
|
||||
case SyntaxKind.ConstKeyword:
|
||||
case SyntaxKind.ExportKeyword:
|
||||
case SyntaxKind.ImportKeyword:
|
||||
return isStartOfDeclaration();
|
||||
|
||||
case SyntaxKind.AsyncKeyword:
|
||||
|
||||
+12
-7
@@ -1070,10 +1070,10 @@ namespace ts {
|
||||
const typeChecker = getDiagnosticsProducingTypeChecker();
|
||||
|
||||
Debug.assert(!!sourceFile.bindDiagnostics);
|
||||
const bindDiagnostics = sourceFile.bindDiagnostics;
|
||||
// For JavaScript files, we don't want to report semantic errors unless explicitly requested.
|
||||
const includeCheckDiagnostics = !isSourceFileJavaScript(sourceFile) || isCheckJsEnabledForFile(sourceFile, options);
|
||||
const checkDiagnostics = includeCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : [];
|
||||
const includeBindAndCheckDiagnostics = !isSourceFileJavaScript(sourceFile) || isCheckJsEnabledForFile(sourceFile, options);
|
||||
const bindDiagnostics = includeBindAndCheckDiagnostics ? sourceFile.bindDiagnostics : emptyArray;
|
||||
const checkDiagnostics = includeBindAndCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : emptyArray;
|
||||
const fileProcessingDiagnosticsInFile = fileProcessingDiagnostics.getDiagnostics(sourceFile.fileName);
|
||||
const programDiagnosticsInFile = programDiagnostics.getDiagnostics(sourceFile.fileName);
|
||||
|
||||
@@ -1370,6 +1370,7 @@ namespace ts {
|
||||
const isJavaScriptFile = isSourceFileJavaScript(file);
|
||||
const isExternalModuleFile = isExternalModule(file);
|
||||
|
||||
// file.imports may not be undefined if there exists dynamic import
|
||||
let imports: LiteralExpression[];
|
||||
let moduleAugmentations: LiteralExpression[];
|
||||
let ambientModules: string[];
|
||||
@@ -1389,8 +1390,8 @@ namespace ts {
|
||||
|
||||
for (const node of file.statements) {
|
||||
collectModuleReferences(node, /*inAmbientModule*/ false);
|
||||
if (isJavaScriptFile) {
|
||||
collectRequireCalls(node);
|
||||
if ((file.flags & NodeFlags.PossiblyContainDynamicImport) || isJavaScriptFile) {
|
||||
collectDynamicImportOrRequireCalls(node);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1453,12 +1454,16 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
function collectRequireCalls(node: Node): void {
|
||||
function collectDynamicImportOrRequireCalls(node: Node): void {
|
||||
if (isRequireCall(node, /*checkArgumentIsStringLiteral*/ true)) {
|
||||
(imports || (imports = [])).push(<StringLiteral>(<CallExpression>node).arguments[0]);
|
||||
}
|
||||
// we have to check the argument list has length of 1. We will still have to process these even though we have parsing error.
|
||||
else if (isImportCall(node) && node.arguments.length === 1 && node.arguments[0].kind === SyntaxKind.StringLiteral) {
|
||||
(imports || (imports = [])).push(<StringLiteral>(<CallExpression>node).arguments[0]);
|
||||
}
|
||||
else {
|
||||
forEachChild(node, collectRequireCalls);
|
||||
forEachChild(node, collectDynamicImportOrRequireCalls);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -286,7 +286,7 @@ namespace ts {
|
||||
|
||||
const tokenStrings = makeReverseMap(textToToken);
|
||||
|
||||
export function tokenToString(t: SyntaxKind): string {
|
||||
export function tokenToString(t: SyntaxKind): string | undefined {
|
||||
return tokenStrings[t];
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
namespace ts {
|
||||
function getModuleTransformer(moduleKind: ModuleKind): TransformerFactory<SourceFile> {
|
||||
switch (moduleKind) {
|
||||
case ModuleKind.ESNext:
|
||||
case ModuleKind.ES2015:
|
||||
return transformES2015Module;
|
||||
case ModuleKind.System:
|
||||
|
||||
@@ -46,6 +46,7 @@ namespace ts {
|
||||
let currentSourceFile: SourceFile; // The current file.
|
||||
let currentModuleInfo: ExternalModuleInfo; // The ExternalModuleInfo for the current file.
|
||||
let noSubstitution: boolean[]; // Set of nodes for which substitution rules should be ignored.
|
||||
let needUMDDynamicImportHelper: boolean;
|
||||
|
||||
return transformSourceFile;
|
||||
|
||||
@@ -55,7 +56,7 @@ namespace ts {
|
||||
* @param node The SourceFile node.
|
||||
*/
|
||||
function transformSourceFile(node: SourceFile) {
|
||||
if (node.isDeclarationFile || !(isExternalModule(node) || compilerOptions.isolatedModules)) {
|
||||
if (node.isDeclarationFile || !(isExternalModule(node) || compilerOptions.isolatedModules || node.transformFlags & TransformFlags.ContainsDynamicImport)) {
|
||||
return node;
|
||||
}
|
||||
|
||||
@@ -66,9 +67,9 @@ namespace ts {
|
||||
// Perform the transformation.
|
||||
const transformModule = getTransformModuleDelegate(moduleKind);
|
||||
const updated = transformModule(node);
|
||||
|
||||
currentSourceFile = undefined;
|
||||
currentModuleInfo = undefined;
|
||||
needUMDDynamicImportHelper = false;
|
||||
return aggregateTransformFlags(updated);
|
||||
}
|
||||
|
||||
@@ -107,6 +108,7 @@ namespace ts {
|
||||
// we need to inform the emitter to add the __export helper.
|
||||
addEmitHelper(updated, exportStarHelper);
|
||||
}
|
||||
addEmitHelpers(updated, context.readEmitHelpers());
|
||||
return updated;
|
||||
}
|
||||
|
||||
@@ -411,6 +413,9 @@ namespace ts {
|
||||
// we need to inform the emitter to add the __export helper.
|
||||
addEmitHelper(body, exportStarHelper);
|
||||
}
|
||||
if (needUMDDynamicImportHelper) {
|
||||
addEmitHelper(body, dynamicImportUMDHelper);
|
||||
}
|
||||
|
||||
return body;
|
||||
}
|
||||
@@ -488,12 +493,110 @@ namespace ts {
|
||||
return visitEndOfDeclarationMarker(<EndOfDeclarationMarker>node);
|
||||
|
||||
default:
|
||||
// This visitor does not descend into the tree, as export/import statements
|
||||
// are only transformed at the top level of a file.
|
||||
return node;
|
||||
return visitEachChild(node, importCallExpressionVisitor, context);
|
||||
}
|
||||
}
|
||||
|
||||
function importCallExpressionVisitor(node: Node): VisitResult<Node> {
|
||||
// This visitor does not need to descend into the tree if there is no dynamic import,
|
||||
// as export/import statements are only transformed at the top level of a file.
|
||||
if (!(node.transformFlags & TransformFlags.ContainsDynamicImport)) {
|
||||
return node;
|
||||
}
|
||||
|
||||
if (isImportCall(node)) {
|
||||
return visitImportCallExpression(<ImportCall>node);
|
||||
}
|
||||
else {
|
||||
return visitEachChild(node, importCallExpressionVisitor, context);
|
||||
}
|
||||
}
|
||||
|
||||
function visitImportCallExpression(node: ImportCall): Expression {
|
||||
switch (compilerOptions.module) {
|
||||
case ModuleKind.CommonJS:
|
||||
return transformImportCallExpressionCommonJS(node);
|
||||
case ModuleKind.AMD:
|
||||
return transformImportCallExpressionAMD(node);
|
||||
case ModuleKind.UMD:
|
||||
return transformImportCallExpressionUMD(node);
|
||||
}
|
||||
Debug.fail("All supported module kind in this transformation step should have been handled");
|
||||
}
|
||||
|
||||
function transformImportCallExpressionUMD(node: ImportCall): Expression {
|
||||
// (function (factory) {
|
||||
// ... (regular UMD)
|
||||
// }
|
||||
// })(function (require, exports, useSyncRequire) {
|
||||
// "use strict";
|
||||
// Object.defineProperty(exports, "__esModule", { value: true });
|
||||
// var __syncRequire = typeof module === "object" && typeof module.exports === "object";
|
||||
// var __resolved = new Promise(function (resolve) { resolve(); });
|
||||
// .....
|
||||
// __syncRequire
|
||||
// ? __resolved.then(function () { return require(x); }) /*CommonJs Require*/
|
||||
// : new Promise(function (_a, _b) { require([x], _a, _b); }); /*Amd Require*/
|
||||
// });
|
||||
needUMDDynamicImportHelper = true;
|
||||
return createConditional(
|
||||
/*condition*/ createIdentifier("__syncRequire"),
|
||||
/*whenTrue*/ transformImportCallExpressionCommonJS(node),
|
||||
/*whenFalse*/ transformImportCallExpressionAMD(node)
|
||||
);
|
||||
}
|
||||
|
||||
function transformImportCallExpressionAMD(node: ImportCall): Expression {
|
||||
// improt("./blah")
|
||||
// emit as
|
||||
// define(["require", "exports", "blah"], function (require, exports) {
|
||||
// ...
|
||||
// new Promise(function (_a, _b) { require([x], _a, _b); }); /*Amd Require*/
|
||||
// });
|
||||
const resolve = createUniqueName("resolve");
|
||||
const reject = createUniqueName("reject");
|
||||
return createNew(
|
||||
createIdentifier("Promise"),
|
||||
/*typeArguments*/ undefined,
|
||||
[createFunctionExpression(
|
||||
/*modifiers*/ undefined,
|
||||
/*asteriskToken*/ undefined,
|
||||
/*name*/ undefined,
|
||||
/*typeParameters*/ undefined,
|
||||
[createParameter(/*decorator*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, /*name*/ resolve),
|
||||
createParameter(/*decorator*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, /*name*/ reject)],
|
||||
/*type*/ undefined,
|
||||
createBlock([createStatement(
|
||||
createCall(
|
||||
createIdentifier("require"),
|
||||
/*typeArguments*/ undefined,
|
||||
[createArrayLiteral([firstOrUndefined(node.arguments) || createOmittedExpression()]), resolve, reject]
|
||||
))])
|
||||
)]);
|
||||
}
|
||||
|
||||
function transformImportCallExpressionCommonJS(node: ImportCall): Expression {
|
||||
// import("./blah")
|
||||
// emit as
|
||||
// Promise.resolve().then(function () { return require(x); }) /*CommonJs Require*/
|
||||
// We have to wrap require in then callback so that require is done in asynchronously
|
||||
// if we simply do require in resolve callback in Promise constructor. We will execute the loading immediately
|
||||
return createCall(
|
||||
createPropertyAccess(
|
||||
createCall(createPropertyAccess(createIdentifier("Promise"), "resolve"), /*typeArguments*/ undefined, /*argumentsArray*/ []),
|
||||
"then"),
|
||||
/*typeArguments*/ undefined,
|
||||
[createFunctionExpression(
|
||||
/*modifiers*/ undefined,
|
||||
/*asteriskToken*/ undefined,
|
||||
/*name*/ undefined,
|
||||
/*typeParameters*/ undefined,
|
||||
/*parameters*/ undefined,
|
||||
/*type*/ undefined,
|
||||
createBlock([createReturn(createCall(createIdentifier("require"), /*typeArguments*/ undefined, node.arguments))])
|
||||
)]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Visits an ImportDeclaration node.
|
||||
*
|
||||
@@ -786,9 +889,9 @@ namespace ts {
|
||||
node.asteriskToken,
|
||||
getDeclarationName(node, /*allowComments*/ true, /*allowSourceMaps*/ true),
|
||||
/*typeParameters*/ undefined,
|
||||
node.parameters,
|
||||
visitNodes(node.parameters, importCallExpressionVisitor),
|
||||
/*type*/ undefined,
|
||||
node.body
|
||||
visitEachChild(node.body, importCallExpressionVisitor, context)
|
||||
),
|
||||
/*location*/ node
|
||||
),
|
||||
@@ -797,7 +900,7 @@ namespace ts {
|
||||
);
|
||||
}
|
||||
else {
|
||||
statements = append(statements, node);
|
||||
statements = append(statements, visitEachChild(node, importCallExpressionVisitor, context));
|
||||
}
|
||||
|
||||
if (hasAssociatedEndOfDeclarationMarker(node)) {
|
||||
@@ -828,7 +931,7 @@ namespace ts {
|
||||
visitNodes(node.modifiers, modifierVisitor, isModifier),
|
||||
getDeclarationName(node, /*allowComments*/ true, /*allowSourceMaps*/ true),
|
||||
/*typeParameters*/ undefined,
|
||||
node.heritageClauses,
|
||||
visitNodes(node.heritageClauses, importCallExpressionVisitor),
|
||||
node.members
|
||||
),
|
||||
node
|
||||
@@ -838,7 +941,7 @@ namespace ts {
|
||||
);
|
||||
}
|
||||
else {
|
||||
statements = append(statements, node);
|
||||
statements = append(statements, visitEachChild(node, importCallExpressionVisitor, context));
|
||||
}
|
||||
|
||||
if (hasAssociatedEndOfDeclarationMarker(node)) {
|
||||
@@ -890,7 +993,7 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
else {
|
||||
statements = append(statements, node);
|
||||
statements = append(statements, visitEachChild(node, importCallExpressionVisitor, context));
|
||||
}
|
||||
|
||||
if (hasAssociatedEndOfDeclarationMarker(node)) {
|
||||
@@ -913,7 +1016,7 @@ namespace ts {
|
||||
function transformInitializedVariable(node: VariableDeclaration): Expression {
|
||||
if (isBindingPattern(node.name)) {
|
||||
return flattenDestructuringAssignment(
|
||||
node,
|
||||
visitNode(node, importCallExpressionVisitor),
|
||||
/*visitor*/ undefined,
|
||||
context,
|
||||
FlattenLevel.All,
|
||||
@@ -930,7 +1033,7 @@ namespace ts {
|
||||
),
|
||||
/*location*/ node.name
|
||||
),
|
||||
node.initializer
|
||||
visitNode(node.initializer, importCallExpressionVisitor)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1497,4 +1600,12 @@ namespace ts {
|
||||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
||||
}`
|
||||
};
|
||||
|
||||
// emit helper for dynamic import
|
||||
const dynamicImportUMDHelper: EmitHelper = {
|
||||
name: "typescript:dynamicimport-sync-require",
|
||||
scoped: true,
|
||||
text: `
|
||||
var __syncRequire = typeof module === "object" && typeof module.exports === "object";`
|
||||
};
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace ts {
|
||||
* @param node The SourceFile node.
|
||||
*/
|
||||
function transformSourceFile(node: SourceFile) {
|
||||
if (node.isDeclarationFile || !(isExternalModule(node) || compilerOptions.isolatedModules)) {
|
||||
if (node.isDeclarationFile || !(isEffectiveExternalModule(node, compilerOptions) || node.transformFlags & TransformFlags.ContainsDynamicImport)) {
|
||||
return node;
|
||||
}
|
||||
|
||||
@@ -646,7 +646,7 @@ namespace ts {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const expression = visitNode(node.expression, destructuringVisitor, isExpression);
|
||||
const expression = visitNode(node.expression, destructuringAndImportCallVisitor, isExpression);
|
||||
const original = node.original;
|
||||
if (original && hasAssociatedEndOfDeclarationMarker(original)) {
|
||||
// Defer exports until we encounter an EndOfDeclarationMarker node
|
||||
@@ -673,12 +673,12 @@ namespace ts {
|
||||
node.asteriskToken,
|
||||
getDeclarationName(node, /*allowComments*/ true, /*allowSourceMaps*/ true),
|
||||
/*typeParameters*/ undefined,
|
||||
visitNodes(node.parameters, destructuringVisitor, isParameterDeclaration),
|
||||
visitNodes(node.parameters, destructuringAndImportCallVisitor, isParameterDeclaration),
|
||||
/*type*/ undefined,
|
||||
visitNode(node.body, destructuringVisitor, isBlock)));
|
||||
visitNode(node.body, destructuringAndImportCallVisitor, isBlock)));
|
||||
}
|
||||
else {
|
||||
hoistedStatements = append(hoistedStatements, node);
|
||||
hoistedStatements = append(hoistedStatements, visitEachChild(node, destructuringAndImportCallVisitor, context));
|
||||
}
|
||||
|
||||
if (hasAssociatedEndOfDeclarationMarker(node)) {
|
||||
@@ -716,8 +716,8 @@ namespace ts {
|
||||
/*modifiers*/ undefined,
|
||||
node.name,
|
||||
/*typeParameters*/ undefined,
|
||||
visitNodes(node.heritageClauses, destructuringVisitor, isHeritageClause),
|
||||
visitNodes(node.members, destructuringVisitor, isClassElement)
|
||||
visitNodes(node.heritageClauses, destructuringAndImportCallVisitor, isHeritageClause),
|
||||
visitNodes(node.members, destructuringAndImportCallVisitor, isClassElement)
|
||||
),
|
||||
node
|
||||
)
|
||||
@@ -747,7 +747,7 @@ namespace ts {
|
||||
*/
|
||||
function visitVariableStatement(node: VariableStatement): VisitResult<Statement> {
|
||||
if (!shouldHoistVariableDeclarationList(node.declarationList)) {
|
||||
return visitNode(node, destructuringVisitor, isStatement);
|
||||
return visitNode(node, destructuringAndImportCallVisitor, isStatement);
|
||||
}
|
||||
|
||||
let expressions: Expression[];
|
||||
@@ -820,13 +820,13 @@ namespace ts {
|
||||
return isBindingPattern(node.name)
|
||||
? flattenDestructuringAssignment(
|
||||
node,
|
||||
destructuringVisitor,
|
||||
destructuringAndImportCallVisitor,
|
||||
context,
|
||||
FlattenLevel.All,
|
||||
/*needsValue*/ false,
|
||||
createAssignment
|
||||
)
|
||||
: createAssignment(node.name, visitNode(node.initializer, destructuringVisitor, isExpression));
|
||||
: createAssignment(node.name, visitNode(node.initializer, destructuringAndImportCallVisitor, isExpression));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1204,7 +1204,7 @@ namespace ts {
|
||||
return visitEndOfDeclarationMarker(<EndOfDeclarationMarker>node);
|
||||
|
||||
default:
|
||||
return destructuringVisitor(node);
|
||||
return destructuringAndImportCallVisitor(node);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1220,8 +1220,8 @@ namespace ts {
|
||||
node = updateFor(
|
||||
node,
|
||||
visitForInitializer(node.initializer),
|
||||
visitNode(node.condition, destructuringVisitor, isExpression),
|
||||
visitNode(node.incrementor, destructuringVisitor, isExpression),
|
||||
visitNode(node.condition, destructuringAndImportCallVisitor, isExpression),
|
||||
visitNode(node.incrementor, destructuringAndImportCallVisitor, isExpression),
|
||||
visitNode(node.statement, nestedElementVisitor, isStatement)
|
||||
);
|
||||
|
||||
@@ -1241,7 +1241,7 @@ namespace ts {
|
||||
node = updateForIn(
|
||||
node,
|
||||
visitForInitializer(node.initializer),
|
||||
visitNode(node.expression, destructuringVisitor, isExpression),
|
||||
visitNode(node.expression, destructuringAndImportCallVisitor, isExpression),
|
||||
visitNode(node.statement, nestedElementVisitor, isStatement, liftToBlock)
|
||||
);
|
||||
|
||||
@@ -1262,7 +1262,7 @@ namespace ts {
|
||||
node,
|
||||
node.awaitModifier,
|
||||
visitForInitializer(node.initializer),
|
||||
visitNode(node.expression, destructuringVisitor, isExpression),
|
||||
visitNode(node.expression, destructuringAndImportCallVisitor, isExpression),
|
||||
visitNode(node.statement, nestedElementVisitor, isStatement, liftToBlock)
|
||||
);
|
||||
|
||||
@@ -1313,7 +1313,7 @@ namespace ts {
|
||||
return updateDo(
|
||||
node,
|
||||
visitNode(node.statement, nestedElementVisitor, isStatement, liftToBlock),
|
||||
visitNode(node.expression, destructuringVisitor, isExpression)
|
||||
visitNode(node.expression, destructuringAndImportCallVisitor, isExpression)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1325,7 +1325,7 @@ namespace ts {
|
||||
function visitWhileStatement(node: WhileStatement): VisitResult<Statement> {
|
||||
return updateWhile(
|
||||
node,
|
||||
visitNode(node.expression, destructuringVisitor, isExpression),
|
||||
visitNode(node.expression, destructuringAndImportCallVisitor, isExpression),
|
||||
visitNode(node.statement, nestedElementVisitor, isStatement, liftToBlock)
|
||||
);
|
||||
}
|
||||
@@ -1351,7 +1351,7 @@ namespace ts {
|
||||
function visitWithStatement(node: WithStatement): VisitResult<Statement> {
|
||||
return updateWith(
|
||||
node,
|
||||
visitNode(node.expression, destructuringVisitor, isExpression),
|
||||
visitNode(node.expression, destructuringAndImportCallVisitor, isExpression),
|
||||
visitNode(node.statement, nestedElementVisitor, isStatement, liftToBlock)
|
||||
);
|
||||
}
|
||||
@@ -1364,7 +1364,7 @@ namespace ts {
|
||||
function visitSwitchStatement(node: SwitchStatement): VisitResult<Statement> {
|
||||
return updateSwitch(
|
||||
node,
|
||||
visitNode(node.expression, destructuringVisitor, isExpression),
|
||||
visitNode(node.expression, destructuringAndImportCallVisitor, isExpression),
|
||||
visitNode(node.caseBlock, nestedElementVisitor, isCaseBlock)
|
||||
);
|
||||
}
|
||||
@@ -1395,7 +1395,7 @@ namespace ts {
|
||||
function visitCaseClause(node: CaseClause): VisitResult<CaseOrDefaultClause> {
|
||||
return updateCaseClause(
|
||||
node,
|
||||
visitNode(node.expression, destructuringVisitor, isExpression),
|
||||
visitNode(node.expression, destructuringAndImportCallVisitor, isExpression),
|
||||
visitNodes(node.statements, nestedElementVisitor, isStatement)
|
||||
);
|
||||
}
|
||||
@@ -1461,19 +1461,43 @@ namespace ts {
|
||||
*
|
||||
* @param node The node to visit.
|
||||
*/
|
||||
function destructuringVisitor(node: Node): VisitResult<Node> {
|
||||
function destructuringAndImportCallVisitor(node: Node): VisitResult<Node> {
|
||||
if (node.transformFlags & TransformFlags.DestructuringAssignment
|
||||
&& node.kind === SyntaxKind.BinaryExpression) {
|
||||
return visitDestructuringAssignment(<DestructuringAssignment>node);
|
||||
}
|
||||
else if (node.transformFlags & TransformFlags.ContainsDestructuringAssignment) {
|
||||
return visitEachChild(node, destructuringVisitor, context);
|
||||
else if (isImportCall(node)) {
|
||||
return visitImportCallExpression(node);
|
||||
}
|
||||
else if ((node.transformFlags & TransformFlags.ContainsDestructuringAssignment) || (node.transformFlags & TransformFlags.ContainsDynamicImport)) {
|
||||
return visitEachChild(node, destructuringAndImportCallVisitor, context);
|
||||
}
|
||||
else {
|
||||
return node;
|
||||
}
|
||||
}
|
||||
|
||||
function visitImportCallExpression(node: ImportCall): Expression {
|
||||
// import("./blah")
|
||||
// emit as
|
||||
// System.register([], function (_export, _context) {
|
||||
// return {
|
||||
// setters: [],
|
||||
// execute: () => {
|
||||
// _context.import('./blah');
|
||||
// }
|
||||
// };
|
||||
// });
|
||||
return createCall(
|
||||
createPropertyAccess(
|
||||
contextObject,
|
||||
createIdentifier("import")
|
||||
),
|
||||
/*typeArguments*/ undefined,
|
||||
node.arguments
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Visits a DestructuringAssignment to flatten destructuring to exported symbols.
|
||||
*
|
||||
@@ -1483,14 +1507,14 @@ namespace ts {
|
||||
if (hasExportedReferenceInDestructuringTarget(node.left)) {
|
||||
return flattenDestructuringAssignment(
|
||||
node,
|
||||
destructuringVisitor,
|
||||
destructuringAndImportCallVisitor,
|
||||
context,
|
||||
FlattenLevel.All,
|
||||
/*needsValue*/ true
|
||||
);
|
||||
}
|
||||
|
||||
return visitEachChild(node, destructuringVisitor, context);
|
||||
return visitEachChild(node, destructuringAndImportCallVisitor, context);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+32
-11
@@ -395,6 +395,7 @@ namespace ts {
|
||||
|
||||
// Enum value count
|
||||
Count,
|
||||
|
||||
// Markers
|
||||
FirstAssignment = EqualsToken,
|
||||
LastAssignment = CaretEqualsToken,
|
||||
@@ -449,6 +450,14 @@ namespace ts {
|
||||
ThisNodeOrAnySubNodesHasError = 1 << 17, // If this node or any of its children had an error
|
||||
HasAggregatedChildData = 1 << 18, // If we've computed data from children and cached it in this node
|
||||
|
||||
// This flag will be set to true when the parse encounter dynamic import so that post-parsing process of module resolution
|
||||
// will not walk the tree if the flag is not set. However, this flag is just a approximation because once it is set, the flag never get reset.
|
||||
// (hence it is named "possiblyContainDynamicImport").
|
||||
// During editing, if dynamic import is remove, incremental parsing will *NOT* update this flag. This will then causes walking of the tree during module resolution.
|
||||
// However, the removal operation should not occur often and in the case of the removal, it is likely that users will add back the import anyway.
|
||||
// The advantage of this approach is its simplicity. For the case of batch compilation, we garuntee that users won't have to pay the price of walking the tree if dynamic import isn't used.
|
||||
PossiblyContainDynamicImport = 1 << 19,
|
||||
|
||||
BlockScoped = Let | Const,
|
||||
|
||||
ReachabilityCheckFlags = HasImplicitReturn | HasExplicitReturn,
|
||||
@@ -1001,8 +1010,10 @@ namespace ts {
|
||||
_unaryExpressionBrand: any;
|
||||
}
|
||||
|
||||
export interface IncrementExpression extends UnaryExpression {
|
||||
_incrementExpressionBrand: any;
|
||||
/** Deprecated, please use UpdateExpression */
|
||||
export type IncrementExpression = UpdateExpression;
|
||||
export interface UpdateExpression extends UnaryExpression {
|
||||
_updateExpressionBrand: any;
|
||||
}
|
||||
|
||||
// see: https://tc39.github.io/ecma262/#prod-UpdateExpression
|
||||
@@ -1013,10 +1024,9 @@ namespace ts {
|
||||
| SyntaxKind.PlusToken
|
||||
| SyntaxKind.MinusToken
|
||||
| SyntaxKind.TildeToken
|
||||
| SyntaxKind.ExclamationToken
|
||||
;
|
||||
| SyntaxKind.ExclamationToken;
|
||||
|
||||
export interface PrefixUnaryExpression extends IncrementExpression {
|
||||
export interface PrefixUnaryExpression extends UpdateExpression {
|
||||
kind: SyntaxKind.PrefixUnaryExpression;
|
||||
operator: PrefixUnaryOperator;
|
||||
operand: UnaryExpression;
|
||||
@@ -1028,13 +1038,13 @@ namespace ts {
|
||||
| SyntaxKind.MinusMinusToken
|
||||
;
|
||||
|
||||
export interface PostfixUnaryExpression extends IncrementExpression {
|
||||
export interface PostfixUnaryExpression extends UpdateExpression {
|
||||
kind: SyntaxKind.PostfixUnaryExpression;
|
||||
operand: LeftHandSideExpression;
|
||||
operator: PostfixUnaryOperator;
|
||||
}
|
||||
|
||||
export interface LeftHandSideExpression extends IncrementExpression {
|
||||
export interface LeftHandSideExpression extends UpdateExpression {
|
||||
_leftHandSideExpressionBrand: any;
|
||||
}
|
||||
|
||||
@@ -1062,6 +1072,10 @@ namespace ts {
|
||||
kind: SyntaxKind.SuperKeyword;
|
||||
}
|
||||
|
||||
export interface ImportExpression extends PrimaryExpression {
|
||||
kind: SyntaxKind.ImportKeyword;
|
||||
}
|
||||
|
||||
export interface DeleteExpression extends UnaryExpression {
|
||||
kind: SyntaxKind.DeleteExpression;
|
||||
expression: UnaryExpression;
|
||||
@@ -1454,10 +1468,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
// see: https://tc39.github.io/ecma262/#prod-SuperProperty
|
||||
export type SuperProperty
|
||||
= SuperPropertyAccessExpression
|
||||
| SuperElementAccessExpression
|
||||
;
|
||||
export type SuperProperty = SuperPropertyAccessExpression | SuperElementAccessExpression;
|
||||
|
||||
export interface CallExpression extends LeftHandSideExpression, Declaration {
|
||||
kind: SyntaxKind.CallExpression;
|
||||
@@ -1471,6 +1482,10 @@ namespace ts {
|
||||
expression: SuperExpression;
|
||||
}
|
||||
|
||||
export interface ImportCall extends CallExpression {
|
||||
expression: ImportExpression;
|
||||
}
|
||||
|
||||
export interface ExpressionWithTypeArguments extends TypeNode {
|
||||
kind: SyntaxKind.ExpressionWithTypeArguments;
|
||||
parent?: HeritageClause;
|
||||
@@ -3570,6 +3585,7 @@ namespace ts {
|
||||
UMD = 3,
|
||||
System = 4,
|
||||
ES2015 = 5,
|
||||
ESNext = 6
|
||||
}
|
||||
|
||||
export const enum JsxEmit {
|
||||
@@ -3957,6 +3973,11 @@ namespace ts {
|
||||
ContainsYield = 1 << 24,
|
||||
ContainsHoistedDeclarationOrCompletion = 1 << 25,
|
||||
|
||||
ContainsDynamicImport = 1 << 26,
|
||||
|
||||
// Please leave this as 1 << 29.
|
||||
// It is the maximum bit we can set before we outgrow the size of a v8 small integer (SMI) on an x86 system.
|
||||
// It is a good reminder of how much room we have left
|
||||
HasComputedFlags = 1 << 29, // Transform flags have been computed.
|
||||
|
||||
// Assertions
|
||||
|
||||
@@ -604,6 +604,10 @@ namespace ts {
|
||||
return n.kind === SyntaxKind.CallExpression && (<CallExpression>n).expression.kind === SyntaxKind.SuperKeyword;
|
||||
}
|
||||
|
||||
export function isImportCall(n: Node): n is ImportCall {
|
||||
return n.kind === SyntaxKind.CallExpression && (<CallExpression>n).expression.kind === SyntaxKind.ImportKeyword;
|
||||
}
|
||||
|
||||
export function isPrologueDirective(node: Node): node is PrologueDirective {
|
||||
return node.kind === SyntaxKind.ExpressionStatement
|
||||
&& (<ExpressionStatement>node).expression.kind === SyntaxKind.StringLiteral;
|
||||
|
||||
@@ -857,6 +857,7 @@ namespace Harness {
|
||||
|
||||
export function getDefaultLibFileName(options: ts.CompilerOptions): string {
|
||||
switch (options.target) {
|
||||
case ts.ScriptTarget.ESNext:
|
||||
case ts.ScriptTarget.ES2017:
|
||||
return "lib.es2017.d.ts";
|
||||
case ts.ScriptTarget.ES2016:
|
||||
|
||||
@@ -113,7 +113,7 @@ namespace ts {
|
||||
start: undefined,
|
||||
length: undefined,
|
||||
}, {
|
||||
messageText: "Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015'.",
|
||||
messageText: "Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'esnext'.",
|
||||
category: ts.Diagnostics.Argument_for_0_option_must_be_Colon_1.category,
|
||||
code: ts.Diagnostics.Argument_for_0_option_must_be_Colon_1.code,
|
||||
|
||||
|
||||
@@ -155,7 +155,7 @@ namespace ts {
|
||||
file: undefined,
|
||||
start: 0,
|
||||
length: 0,
|
||||
messageText: "Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015'.",
|
||||
messageText: "Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'esnext'.",
|
||||
code: Diagnostics.Argument_for_0_option_must_be_Colon_1.code,
|
||||
category: Diagnostics.Argument_for_0_option_must_be_Colon_1.category
|
||||
}]
|
||||
|
||||
Vendored
+146
-351
File diff suppressed because it is too large
Load Diff
@@ -683,7 +683,7 @@ namespace ts.server {
|
||||
|
||||
const added: string[] = [];
|
||||
const removed: string[] = [];
|
||||
const updated: string[] = arrayFrom(updatedFileNames.keys());
|
||||
const updated: string[] = updatedFileNames ? arrayFrom(updatedFileNames.keys()) : [];
|
||||
|
||||
forEachKey(currentFiles, id => {
|
||||
if (!lastReportedFileNames.has(id)) {
|
||||
|
||||
@@ -45,6 +45,8 @@ namespace ts.server {
|
||||
os.tmpdir();
|
||||
return combinePaths(normalizeSlashes(basePath), "Microsoft/TypeScript");
|
||||
}
|
||||
case "openbsd":
|
||||
case "freebsd":
|
||||
case "darwin":
|
||||
case "linux":
|
||||
case "android": {
|
||||
|
||||
@@ -368,7 +368,7 @@ namespace ts {
|
||||
_primaryExpressionBrand: any;
|
||||
_memberExpressionBrand: any;
|
||||
_leftHandSideExpressionBrand: any;
|
||||
_incrementExpressionBrand: any;
|
||||
_updateExpressionBrand: any;
|
||||
_unaryExpressionBrand: any;
|
||||
_expressionBrand: any;
|
||||
/*@internal*/typeArguments: NodeArray<TypeNode>;
|
||||
@@ -521,6 +521,7 @@ namespace ts {
|
||||
private namedDeclarations: Map<Declaration[]>;
|
||||
public ambientModuleNames: string[];
|
||||
public checkJsDirective: CheckJsDirective | undefined;
|
||||
public possiblyContainDynamicImport: boolean;
|
||||
|
||||
constructor(kind: SyntaxKind, pos: number, end: number) {
|
||||
super(kind, pos, end);
|
||||
|
||||
@@ -25,11 +25,11 @@ class Board {
|
||||
>allShipsSunk : Symbol(Board.allShipsSunk, Decl(2dArrays.ts, 9, 18))
|
||||
|
||||
return this.ships.every(function (val) { return val.isSunk; });
|
||||
>this.ships.every : Symbol(Array.every, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>this.ships.every : Symbol(Array.every, Decl(lib.d.ts, --, --))
|
||||
>this.ships : Symbol(Board.ships, Decl(2dArrays.ts, 7, 13))
|
||||
>this : Symbol(Board, Decl(2dArrays.ts, 5, 1))
|
||||
>ships : Symbol(Board.ships, Decl(2dArrays.ts, 7, 13))
|
||||
>every : Symbol(Array.every, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>every : Symbol(Array.every, Decl(lib.d.ts, --, --))
|
||||
>val : Symbol(val, Decl(2dArrays.ts, 12, 42))
|
||||
>val.isSunk : Symbol(Ship.isSunk, Decl(2dArrays.ts, 3, 12))
|
||||
>val : Symbol(val, Decl(2dArrays.ts, 12, 42))
|
||||
|
||||
@@ -26,12 +26,12 @@ class Board {
|
||||
|
||||
return this.ships.every(function (val) { return val.isSunk; });
|
||||
>this.ships.every(function (val) { return val.isSunk; }) : boolean
|
||||
>this.ships.every : { (callbackfn: (this: void, value: Ship, index: number, array: Ship[]) => boolean): boolean; (callbackfn: (this: void, value: Ship, index: number, array: Ship[]) => boolean, thisArg: undefined): boolean; <Z>(callbackfn: (this: Z, value: Ship, index: number, array: Ship[]) => boolean, thisArg: Z): boolean; }
|
||||
>this.ships.every : (callbackfn: (value: Ship, index: number, array: Ship[]) => boolean, thisArg?: any) => boolean
|
||||
>this.ships : Ship[]
|
||||
>this : this
|
||||
>ships : Ship[]
|
||||
>every : { (callbackfn: (this: void, value: Ship, index: number, array: Ship[]) => boolean): boolean; (callbackfn: (this: void, value: Ship, index: number, array: Ship[]) => boolean, thisArg: undefined): boolean; <Z>(callbackfn: (this: Z, value: Ship, index: number, array: Ship[]) => boolean, thisArg: Z): boolean; }
|
||||
>function (val) { return val.isSunk; } : (this: void, val: Ship) => boolean
|
||||
>every : (callbackfn: (value: Ship, index: number, array: Ship[]) => boolean, thisArg?: any) => boolean
|
||||
>function (val) { return val.isSunk; } : (val: Ship) => boolean
|
||||
>val : Ship
|
||||
>val.isSunk : boolean
|
||||
>val : Ship
|
||||
|
||||
@@ -11,7 +11,7 @@ declare var fs: {
|
||||
existsSync(path: string): boolean;
|
||||
readdirSync(path: string): string[];
|
||||
readFileSync(filename: string, encoding?: string): string;
|
||||
writeFileSync(filename: string, data: any, options?: { encoding?: string; mode?: number; flag?: string; }): void;
|
||||
writeFileSync(filename: string, data: any, options?: { encoding?: string; mode?: number; flag?: string; } | string): void;
|
||||
watchFile(filename: string, options: { persistent?: boolean; interval?: number; }, listener: (curr: { mtime: Date }, prev: { mtime: Date }) => void): void;
|
||||
};
|
||||
declare var path: any;
|
||||
|
||||
@@ -35,16 +35,16 @@ paired.reduce((b3, b4) => b3.concat({}), []);
|
||||
>b3 : Symbol(b3, Decl(anyInferenceAnonymousFunctions.ts, 13, 15))
|
||||
|
||||
paired.map((c1) => c1.count);
|
||||
>paired.map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>paired.map : Symbol(Array.map, Decl(lib.d.ts, --, --))
|
||||
>paired : Symbol(paired, Decl(anyInferenceAnonymousFunctions.ts, 0, 3))
|
||||
>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>map : Symbol(Array.map, Decl(lib.d.ts, --, --))
|
||||
>c1 : Symbol(c1, Decl(anyInferenceAnonymousFunctions.ts, 15, 12))
|
||||
>c1 : Symbol(c1, Decl(anyInferenceAnonymousFunctions.ts, 15, 12))
|
||||
|
||||
paired.map(function (c2) { return c2.count; });
|
||||
>paired.map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>paired.map : Symbol(Array.map, Decl(lib.d.ts, --, --))
|
||||
>paired : Symbol(paired, Decl(anyInferenceAnonymousFunctions.ts, 0, 3))
|
||||
>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>map : Symbol(Array.map, Decl(lib.d.ts, --, --))
|
||||
>c2 : Symbol(c2, Decl(anyInferenceAnonymousFunctions.ts, 16, 21))
|
||||
>c2 : Symbol(c2, Decl(anyInferenceAnonymousFunctions.ts, 16, 21))
|
||||
|
||||
|
||||
@@ -57,10 +57,10 @@ paired.reduce((b3, b4) => b3.concat({}), []);
|
||||
|
||||
paired.map((c1) => c1.count);
|
||||
>paired.map((c1) => c1.count) : any[]
|
||||
>paired.map : { <U>(this: [any, any, any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U): [U, U, U, U, U]; <U>(this: [any, any, any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [any, any, any, any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [any, any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U): [U, U, U, U]; <U>(this: [any, any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [any, any, any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U): [U, U, U]; <U>(this: [any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [any, any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U, U]; <U>(this: [any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U): [U, U]; <U>(this: [any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: any, index: number, array: any[]) => U): U[]; <U>(callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): U[]; }
|
||||
>paired.map : <U>(callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any) => U[]
|
||||
>paired : any[]
|
||||
>map : { <U>(this: [any, any, any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U): [U, U, U, U, U]; <U>(this: [any, any, any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [any, any, any, any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [any, any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U): [U, U, U, U]; <U>(this: [any, any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [any, any, any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U): [U, U, U]; <U>(this: [any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [any, any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U, U]; <U>(this: [any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U): [U, U]; <U>(this: [any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: any, index: number, array: any[]) => U): U[]; <U>(callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): U[]; }
|
||||
>(c1) => c1.count : (this: void, c1: any) => any
|
||||
>map : <U>(callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any) => U[]
|
||||
>(c1) => c1.count : (c1: any) => any
|
||||
>c1 : any
|
||||
>c1.count : any
|
||||
>c1 : any
|
||||
@@ -68,10 +68,10 @@ paired.map((c1) => c1.count);
|
||||
|
||||
paired.map(function (c2) { return c2.count; });
|
||||
>paired.map(function (c2) { return c2.count; }) : any[]
|
||||
>paired.map : { <U>(this: [any, any, any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U): [U, U, U, U, U]; <U>(this: [any, any, any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [any, any, any, any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [any, any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U): [U, U, U, U]; <U>(this: [any, any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [any, any, any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U): [U, U, U]; <U>(this: [any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [any, any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U, U]; <U>(this: [any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U): [U, U]; <U>(this: [any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: any, index: number, array: any[]) => U): U[]; <U>(callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): U[]; }
|
||||
>paired.map : <U>(callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any) => U[]
|
||||
>paired : any[]
|
||||
>map : { <U>(this: [any, any, any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U): [U, U, U, U, U]; <U>(this: [any, any, any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [any, any, any, any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [any, any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U): [U, U, U, U]; <U>(this: [any, any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [any, any, any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U): [U, U, U]; <U>(this: [any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [any, any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U, U]; <U>(this: [any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U): [U, U]; <U>(this: [any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: any, index: number, array: any[]) => U): U[]; <U>(callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): U[]; }
|
||||
>function (c2) { return c2.count; } : (this: void, c2: any) => any
|
||||
>map : <U>(callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any) => U[]
|
||||
>function (c2) { return c2.count; } : (c2: any) => any
|
||||
>c2 : any
|
||||
>c2.count : any
|
||||
>c2 : any
|
||||
|
||||
@@ -34,8 +34,8 @@ function myFunction(myType: MyType) {
|
||||
>x : Symbol(x, Decl(argumentsAsPropertyName.ts, 11, 13))
|
||||
|
||||
[1, 2, 3].forEach(function(j) { use(x); })
|
||||
>[1, 2, 3].forEach : Symbol(Array.forEach, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>forEach : Symbol(Array.forEach, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>[1, 2, 3].forEach : Symbol(Array.forEach, Decl(lib.d.ts, --, --))
|
||||
>forEach : Symbol(Array.forEach, Decl(lib.d.ts, --, --))
|
||||
>j : Symbol(j, Decl(argumentsAsPropertyName.ts, 12, 35))
|
||||
>use : Symbol(use, Decl(argumentsAsPropertyName.ts, 3, 1))
|
||||
>x : Symbol(x, Decl(argumentsAsPropertyName.ts, 11, 13))
|
||||
|
||||
@@ -42,13 +42,13 @@ function myFunction(myType: MyType) {
|
||||
|
||||
[1, 2, 3].forEach(function(j) { use(x); })
|
||||
>[1, 2, 3].forEach(function(j) { use(x); }) : void
|
||||
>[1, 2, 3].forEach : { (callbackfn: (this: void, value: number, index: number, array: number[]) => void): void; (callbackfn: (this: void, value: number, index: number, array: number[]) => void, thisArg: undefined): void; <Z>(callbackfn: (this: Z, value: number, index: number, array: number[]) => void, thisArg: Z): void; }
|
||||
>[1, 2, 3].forEach : (callbackfn: (value: number, index: number, array: number[]) => void, thisArg?: any) => void
|
||||
>[1, 2, 3] : number[]
|
||||
>1 : 1
|
||||
>2 : 2
|
||||
>3 : 3
|
||||
>forEach : { (callbackfn: (this: void, value: number, index: number, array: number[]) => void): void; (callbackfn: (this: void, value: number, index: number, array: number[]) => void, thisArg: undefined): void; <Z>(callbackfn: (this: Z, value: number, index: number, array: number[]) => void, thisArg: Z): void; }
|
||||
>function(j) { use(x); } : (this: void, j: number) => void
|
||||
>forEach : (callbackfn: (value: number, index: number, array: number[]) => void, thisArg?: any) => void
|
||||
>function(j) { use(x); } : (j: number) => void
|
||||
>j : number
|
||||
>use(x) : any
|
||||
>use : (s: any) => any
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
=== tests/cases/compiler/arrayConcatMap.ts ===
|
||||
var x = [].concat([{ a: 1 }], [{ a: 2 }])
|
||||
>x : Symbol(x, Decl(arrayConcatMap.ts, 0, 3))
|
||||
>[].concat([{ a: 1 }], [{ a: 2 }]) .map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>[].concat([{ a: 1 }], [{ a: 2 }]) .map : Symbol(Array.map, Decl(lib.d.ts, --, --))
|
||||
>[].concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>a : Symbol(a, Decl(arrayConcatMap.ts, 0, 20))
|
||||
>a : Symbol(a, Decl(arrayConcatMap.ts, 0, 32))
|
||||
|
||||
.map(b => b.a);
|
||||
>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>map : Symbol(Array.map, Decl(lib.d.ts, --, --))
|
||||
>b : Symbol(b, Decl(arrayConcatMap.ts, 1, 15))
|
||||
>b : Symbol(b, Decl(arrayConcatMap.ts, 1, 15))
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
var x = [].concat([{ a: 1 }], [{ a: 2 }])
|
||||
>x : any[]
|
||||
>[].concat([{ a: 1 }], [{ a: 2 }]) .map(b => b.a) : any[]
|
||||
>[].concat([{ a: 1 }], [{ a: 2 }]) .map : { <U>(this: [any, any, any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U): [U, U, U, U, U]; <U>(this: [any, any, any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [any, any, any, any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [any, any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U): [U, U, U, U]; <U>(this: [any, any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [any, any, any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U): [U, U, U]; <U>(this: [any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [any, any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U, U]; <U>(this: [any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U): [U, U]; <U>(this: [any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: any, index: number, array: any[]) => U): U[]; <U>(callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): U[]; }
|
||||
>[].concat([{ a: 1 }], [{ a: 2 }]) .map : <U>(callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any) => U[]
|
||||
>[].concat([{ a: 1 }], [{ a: 2 }]) : any[]
|
||||
>[].concat : { (...items: any[][]): any[]; (...items: any[]): any[]; }
|
||||
>[] : undefined[]
|
||||
@@ -17,8 +17,8 @@ var x = [].concat([{ a: 1 }], [{ a: 2 }])
|
||||
>2 : 2
|
||||
|
||||
.map(b => b.a);
|
||||
>map : { <U>(this: [any, any, any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U): [U, U, U, U, U]; <U>(this: [any, any, any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [any, any, any, any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [any, any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U): [U, U, U, U]; <U>(this: [any, any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [any, any, any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U): [U, U, U]; <U>(this: [any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [any, any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U, U]; <U>(this: [any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U): [U, U]; <U>(this: [any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: any, index: number, array: any[]) => U): U[]; <U>(callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): U[]; }
|
||||
>b => b.a : (this: void, b: any) => any
|
||||
>map : <U>(callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any) => U[]
|
||||
>b => b.a : (b: any) => any
|
||||
>b : any
|
||||
>b.a : any
|
||||
>b : any
|
||||
|
||||
@@ -14,9 +14,9 @@ var foo = [
|
||||
]
|
||||
|
||||
foo.filter(x => x.name); //should accepted all possible types not only boolean!
|
||||
>foo.filter : Symbol(Array.filter, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>foo.filter : Symbol(Array.filter, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>foo : Symbol(foo, Decl(arrayFilter.ts, 0, 3))
|
||||
>filter : Symbol(Array.filter, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>filter : Symbol(Array.filter, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>x : Symbol(x, Decl(arrayFilter.ts, 6, 11))
|
||||
>x.name : Symbol(name, Decl(arrayFilter.ts, 1, 5))
|
||||
>x : Symbol(x, Decl(arrayFilter.ts, 6, 11))
|
||||
|
||||
@@ -22,10 +22,10 @@ var foo = [
|
||||
|
||||
foo.filter(x => x.name); //should accepted all possible types not only boolean!
|
||||
>foo.filter(x => x.name) : { name: string; }[]
|
||||
>foo.filter : { (callbackfn: (this: void, value: { name: string; }, index: number, array: { name: string; }[]) => any): { name: string; }[]; (callbackfn: (this: void, value: { name: string; }, index: number, array: { name: string; }[]) => any, thisArg: undefined): { name: string; }[]; <Z>(callbackfn: (this: Z, value: { name: string; }, index: number, array: { name: string; }[]) => any, thisArg: Z): { name: string; }[]; }
|
||||
>foo.filter : { <S extends { name: string; }>(callbackfn: (value: { name: string; }, index: number, array: { name: string; }[]) => value is S, thisArg?: any): S[]; (callbackfn: (value: { name: string; }, index: number, array: { name: string; }[]) => any, thisArg?: any): { name: string; }[]; }
|
||||
>foo : { name: string; }[]
|
||||
>filter : { (callbackfn: (this: void, value: { name: string; }, index: number, array: { name: string; }[]) => any): { name: string; }[]; (callbackfn: (this: void, value: { name: string; }, index: number, array: { name: string; }[]) => any, thisArg: undefined): { name: string; }[]; <Z>(callbackfn: (this: Z, value: { name: string; }, index: number, array: { name: string; }[]) => any, thisArg: Z): { name: string; }[]; }
|
||||
>x => x.name : (this: void, x: { name: string; }) => string
|
||||
>filter : { <S extends { name: string; }>(callbackfn: (value: { name: string; }, index: number, array: { name: string; }[]) => value is S, thisArg?: any): S[]; (callbackfn: (value: { name: string; }, index: number, array: { name: string; }[]) => any, thisArg?: any): { name: string; }[]; }
|
||||
>x => x.name : (x: { name: string; }) => string
|
||||
>x : { name: string; }
|
||||
>x.name : string
|
||||
>x : { name: string; }
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
tests/cases/compiler/arrayOfSubtypeIsAssignableToReadonlyArray.ts(13,1): error TS2322: Type 'A[]' is not assignable to type 'ReadonlyArray<B>'.
|
||||
Types of property 'concat' are incompatible.
|
||||
Type '{ (...items: A[][]): A[]; (...items: (A | A[])[]): A[]; }' is not assignable to type '{ <U extends ReadonlyArray<B>>(...items: U[]): B[]; (...items: B[][]): B[]; (...items: (B | B[])[]): B[]; }'.
|
||||
Type '{ (...items: A[][]): A[]; (...items: (A | A[])[]): A[]; }' is not assignable to type '{ (...items: B[][]): B[]; (...items: (B | B[])[]): B[]; }'.
|
||||
Type 'A[]' is not assignable to type 'B[]'.
|
||||
Type 'A' is not assignable to type 'B'.
|
||||
Property 'b' is missing in type 'A'.
|
||||
tests/cases/compiler/arrayOfSubtypeIsAssignableToReadonlyArray.ts(18,1): error TS2322: Type 'C<A>' is not assignable to type 'ReadonlyArray<B>'.
|
||||
Types of property 'concat' are incompatible.
|
||||
Type '{ (...items: A[][]): A[]; (...items: (A | A[])[]): A[]; }' is not assignable to type '{ <U extends ReadonlyArray<B>>(...items: U[]): B[]; (...items: B[][]): B[]; (...items: (B | B[])[]): B[]; }'.
|
||||
Type '{ (...items: A[][]): A[]; (...items: (A | A[])[]): A[]; }' is not assignable to type '{ (...items: B[][]): B[]; (...items: (B | B[])[]): B[]; }'.
|
||||
Type 'A[]' is not assignable to type 'B[]'.
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ tests/cases/compiler/arrayOfSubtypeIsAssignableToReadonlyArray.ts(18,1): error T
|
||||
~~~
|
||||
!!! error TS2322: Type 'A[]' is not assignable to type 'ReadonlyArray<B>'.
|
||||
!!! error TS2322: Types of property 'concat' are incompatible.
|
||||
!!! error TS2322: Type '{ (...items: A[][]): A[]; (...items: (A | A[])[]): A[]; }' is not assignable to type '{ <U extends ReadonlyArray<B>>(...items: U[]): B[]; (...items: B[][]): B[]; (...items: (B | B[])[]): B[]; }'.
|
||||
!!! error TS2322: Type '{ (...items: A[][]): A[]; (...items: (A | A[])[]): A[]; }' is not assignable to type '{ (...items: B[][]): B[]; (...items: (B | B[])[]): B[]; }'.
|
||||
!!! error TS2322: Type 'A[]' is not assignable to type 'B[]'.
|
||||
!!! error TS2322: Type 'A' is not assignable to type 'B'.
|
||||
!!! error TS2322: Property 'b' is missing in type 'A'.
|
||||
@@ -39,6 +39,6 @@ tests/cases/compiler/arrayOfSubtypeIsAssignableToReadonlyArray.ts(18,1): error T
|
||||
~~~
|
||||
!!! error TS2322: Type 'C<A>' is not assignable to type 'ReadonlyArray<B>'.
|
||||
!!! error TS2322: Types of property 'concat' are incompatible.
|
||||
!!! error TS2322: Type '{ (...items: A[][]): A[]; (...items: (A | A[])[]): A[]; }' is not assignable to type '{ <U extends ReadonlyArray<B>>(...items: U[]): B[]; (...items: B[][]): B[]; (...items: (B | B[])[]): B[]; }'.
|
||||
!!! error TS2322: Type '{ (...items: A[][]): A[]; (...items: (A | A[])[]): A[]; }' is not assignable to type '{ (...items: B[][]): B[]; (...items: (B | B[])[]): B[]; }'.
|
||||
!!! error TS2322: Type 'A[]' is not assignable to type 'B[]'.
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(33,5): error TS2559: Type 'D' has no properties in common with type 'C'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(34,5): error TS2559: Type 'E' has no properties in common with type 'C'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(35,5): error TS2559: Type 'F' has no properties in common with type 'C'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(36,5): error TS2559: Type 'D' has no properties in common with type '{ opt?: Base; }'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(37,5): error TS2559: Type 'E' has no properties in common with type '{ opt?: Base; }'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(38,5): error TS2559: Type 'F' has no properties in common with type '{ opt?: Base; }'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(39,5): error TS2559: Type 'D' has no properties in common with type '{ opt?: Base; }'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(40,5): error TS2559: Type 'E' has no properties in common with type '{ opt?: Base; }'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(41,5): error TS2559: Type 'F' has no properties in common with type '{ opt?: Base; }'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(74,5): error TS2322: Type 'D' is not assignable to type 'C'.
|
||||
Property 'opt' is missing in type 'D'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(75,5): error TS2322: Type 'E' is not assignable to type 'C'.
|
||||
@@ -18,7 +27,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
Property 'opt' is missing in type 'F'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts (9 errors) ====
|
||||
==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts (18 errors) ====
|
||||
// M is optional and S contains no property with the same name as M
|
||||
// N is optional and T contains no property with the same name as N
|
||||
|
||||
@@ -50,20 +59,38 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
var e: E;
|
||||
var f: F;
|
||||
|
||||
// all ok
|
||||
// disallowed by weak type checking
|
||||
c = d;
|
||||
~
|
||||
!!! error TS2559: Type 'D' has no properties in common with type 'C'.
|
||||
c = e;
|
||||
~
|
||||
!!! error TS2559: Type 'E' has no properties in common with type 'C'.
|
||||
c = f;
|
||||
c = a;
|
||||
|
||||
~
|
||||
!!! error TS2559: Type 'F' has no properties in common with type 'C'.
|
||||
a = d;
|
||||
~
|
||||
!!! error TS2559: Type 'D' has no properties in common with type '{ opt?: Base; }'.
|
||||
a = e;
|
||||
~
|
||||
!!! error TS2559: Type 'E' has no properties in common with type '{ opt?: Base; }'.
|
||||
a = f;
|
||||
a = c;
|
||||
|
||||
~
|
||||
!!! error TS2559: Type 'F' has no properties in common with type '{ opt?: Base; }'.
|
||||
b = d;
|
||||
~
|
||||
!!! error TS2559: Type 'D' has no properties in common with type '{ opt?: Base; }'.
|
||||
b = e;
|
||||
~
|
||||
!!! error TS2559: Type 'E' has no properties in common with type '{ opt?: Base; }'.
|
||||
b = f;
|
||||
~
|
||||
!!! error TS2559: Type 'F' has no properties in common with type '{ opt?: Base; }'.
|
||||
|
||||
// ok
|
||||
c = a;
|
||||
a = c;
|
||||
b = a;
|
||||
b = c;
|
||||
}
|
||||
@@ -134,4 +161,5 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
!!! error TS2322: Property 'opt' is missing in type 'F'.
|
||||
b = a; // ok
|
||||
b = c; // ok
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,20 +30,20 @@ module TargetHasOptional {
|
||||
var e: E;
|
||||
var f: F;
|
||||
|
||||
// all ok
|
||||
// disallowed by weak type checking
|
||||
c = d;
|
||||
c = e;
|
||||
c = f;
|
||||
c = a;
|
||||
|
||||
a = d;
|
||||
a = e;
|
||||
a = f;
|
||||
a = c;
|
||||
|
||||
b = d;
|
||||
b = e;
|
||||
b = f;
|
||||
|
||||
// ok
|
||||
c = a;
|
||||
a = c;
|
||||
b = a;
|
||||
b = c;
|
||||
}
|
||||
@@ -87,7 +87,8 @@ module SourceHasOptional {
|
||||
b = f; // error
|
||||
b = a; // ok
|
||||
b = c; // ok
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//// [assignmentCompatWithObjectMembersOptionality2.js]
|
||||
// M is optional and S contains no property with the same name as M
|
||||
@@ -129,18 +130,19 @@ var TargetHasOptional;
|
||||
var d;
|
||||
var e;
|
||||
var f;
|
||||
// all ok
|
||||
// disallowed by weak type checking
|
||||
c = d;
|
||||
c = e;
|
||||
c = f;
|
||||
c = a;
|
||||
a = d;
|
||||
a = e;
|
||||
a = f;
|
||||
a = c;
|
||||
b = d;
|
||||
b = e;
|
||||
b = f;
|
||||
// ok
|
||||
c = a;
|
||||
a = c;
|
||||
b = a;
|
||||
b = c;
|
||||
})(TargetHasOptional || (TargetHasOptional = {}));
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
// Repro from #10041
|
||||
|
||||
(''.match(/ /) || []).map(s => s.toLowerCase());
|
||||
>(''.match(/ /) || []).map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>(''.match(/ /) || []).map : Symbol(Array.map, Decl(lib.d.ts, --, --))
|
||||
>''.match : Symbol(String.match, Decl(lib.d.ts, --, --))
|
||||
>match : Symbol(String.match, Decl(lib.d.ts, --, --))
|
||||
>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>map : Symbol(Array.map, Decl(lib.d.ts, --, --))
|
||||
>s : Symbol(s, Decl(bestChoiceType.ts, 2, 26))
|
||||
>s.toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, --, --))
|
||||
>s : Symbol(s, Decl(bestChoiceType.ts, 2, 26))
|
||||
@@ -27,9 +27,9 @@ function f1() {
|
||||
|
||||
let z = y.map(s => s.toLowerCase());
|
||||
>z : Symbol(z, Decl(bestChoiceType.ts, 9, 7))
|
||||
>y.map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>y.map : Symbol(Array.map, Decl(lib.d.ts, --, --))
|
||||
>y : Symbol(y, Decl(bestChoiceType.ts, 8, 7))
|
||||
>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>map : Symbol(Array.map, Decl(lib.d.ts, --, --))
|
||||
>s : Symbol(s, Decl(bestChoiceType.ts, 9, 18))
|
||||
>s.toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, --, --))
|
||||
>s : Symbol(s, Decl(bestChoiceType.ts, 9, 18))
|
||||
@@ -51,9 +51,9 @@ function f2() {
|
||||
|
||||
let z = y.map(s => s.toLowerCase());
|
||||
>z : Symbol(z, Decl(bestChoiceType.ts, 15, 7))
|
||||
>y.map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>y.map : Symbol(Array.map, Decl(lib.d.ts, --, --))
|
||||
>y : Symbol(y, Decl(bestChoiceType.ts, 14, 7))
|
||||
>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>map : Symbol(Array.map, Decl(lib.d.ts, --, --))
|
||||
>s : Symbol(s, Decl(bestChoiceType.ts, 15, 18))
|
||||
>s.toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, --, --))
|
||||
>s : Symbol(s, Decl(bestChoiceType.ts, 15, 18))
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
(''.match(/ /) || []).map(s => s.toLowerCase());
|
||||
>(''.match(/ /) || []).map(s => s.toLowerCase()) : string[]
|
||||
>(''.match(/ /) || []).map : { <U>(this: [string, string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U, U, U]; <U>(this: [string, string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [string, string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U]; <U>(this: [string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U]; <U>(this: [string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U]; <U>(this: [string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: string, index: number, array: string[]) => U): U[]; <U>(callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): U[]; }
|
||||
>(''.match(/ /) || []).map : <U>(callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[]
|
||||
>(''.match(/ /) || []) : RegExpMatchArray
|
||||
>''.match(/ /) || [] : RegExpMatchArray
|
||||
>''.match(/ /) : RegExpMatchArray | null
|
||||
@@ -12,8 +12,8 @@
|
||||
>match : (regexp: string | RegExp) => RegExpMatchArray | null
|
||||
>/ / : RegExp
|
||||
>[] : never[]
|
||||
>map : { <U>(this: [string, string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U, U, U]; <U>(this: [string, string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [string, string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U]; <U>(this: [string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U]; <U>(this: [string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U]; <U>(this: [string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: string, index: number, array: string[]) => U): U[]; <U>(callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): U[]; }
|
||||
>s => s.toLowerCase() : (this: void, s: string) => string
|
||||
>map : <U>(callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[]
|
||||
>s => s.toLowerCase() : (s: string) => string
|
||||
>s : string
|
||||
>s.toLowerCase() : string
|
||||
>s.toLowerCase : () => string
|
||||
@@ -42,10 +42,10 @@ function f1() {
|
||||
let z = y.map(s => s.toLowerCase());
|
||||
>z : string[]
|
||||
>y.map(s => s.toLowerCase()) : string[]
|
||||
>y.map : { <U>(this: [string, string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U, U, U]; <U>(this: [string, string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [string, string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U]; <U>(this: [string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U]; <U>(this: [string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U]; <U>(this: [string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: string, index: number, array: string[]) => U): U[]; <U>(callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): U[]; }
|
||||
>y.map : <U>(callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[]
|
||||
>y : RegExpMatchArray
|
||||
>map : { <U>(this: [string, string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U, U, U]; <U>(this: [string, string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [string, string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U]; <U>(this: [string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U]; <U>(this: [string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U]; <U>(this: [string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: string, index: number, array: string[]) => U): U[]; <U>(callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): U[]; }
|
||||
>s => s.toLowerCase() : (this: void, s: string) => string
|
||||
>map : <U>(callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[]
|
||||
>s => s.toLowerCase() : (s: string) => string
|
||||
>s : string
|
||||
>s.toLowerCase() : string
|
||||
>s.toLowerCase : () => string
|
||||
@@ -74,10 +74,10 @@ function f2() {
|
||||
let z = y.map(s => s.toLowerCase());
|
||||
>z : string[]
|
||||
>y.map(s => s.toLowerCase()) : string[]
|
||||
>y.map : { <U>(this: [string, string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U, U, U]; <U>(this: [string, string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [string, string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U]; <U>(this: [string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U]; <U>(this: [string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U]; <U>(this: [string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: string, index: number, array: string[]) => U): U[]; <U>(callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): U[]; }
|
||||
>y.map : <U>(callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[]
|
||||
>y : RegExpMatchArray
|
||||
>map : { <U>(this: [string, string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U, U, U]; <U>(this: [string, string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [string, string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U]; <U>(this: [string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U]; <U>(this: [string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U]; <U>(this: [string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: string, index: number, array: string[]) => U): U[]; <U>(callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): U[]; }
|
||||
>s => s.toLowerCase() : (this: void, s: string) => string
|
||||
>map : <U>(callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[]
|
||||
>s => s.toLowerCase() : (s: string) => string
|
||||
>s : string
|
||||
>s.toLowerCase() : string
|
||||
>s.toLowerCase : () => string
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
//// [0.js]
|
||||
// @ts-check
|
||||
/**
|
||||
* @param {number=} n
|
||||
* @param {string} [s]
|
||||
*/
|
||||
function foo(n, s) {}
|
||||
|
||||
foo();
|
||||
foo(1);
|
||||
foo(1, "hi");
|
||||
|
||||
//// [0.js]
|
||||
// @ts-check
|
||||
/**
|
||||
* @param {number=} n
|
||||
* @param {string} [s]
|
||||
*/
|
||||
function foo(n, s) { }
|
||||
foo();
|
||||
foo(1);
|
||||
foo(1, "hi");
|
||||
@@ -0,0 +1,20 @@
|
||||
=== tests/cases/conformance/jsdoc/0.js ===
|
||||
// @ts-check
|
||||
/**
|
||||
* @param {number=} n
|
||||
* @param {string} [s]
|
||||
*/
|
||||
function foo(n, s) {}
|
||||
>foo : Symbol(foo, Decl(0.js, 0, 0))
|
||||
>n : Symbol(n, Decl(0.js, 5, 13))
|
||||
>s : Symbol(s, Decl(0.js, 5, 15))
|
||||
|
||||
foo();
|
||||
>foo : Symbol(foo, Decl(0.js, 0, 0))
|
||||
|
||||
foo(1);
|
||||
>foo : Symbol(foo, Decl(0.js, 0, 0))
|
||||
|
||||
foo(1, "hi");
|
||||
>foo : Symbol(foo, Decl(0.js, 0, 0))
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
=== tests/cases/conformance/jsdoc/0.js ===
|
||||
// @ts-check
|
||||
/**
|
||||
* @param {number=} n
|
||||
* @param {string} [s]
|
||||
*/
|
||||
function foo(n, s) {}
|
||||
>foo : (n?: number, s?: string) => void
|
||||
>n : number
|
||||
>s : string
|
||||
|
||||
foo();
|
||||
>foo() : void
|
||||
>foo : (n?: number, s?: string) => void
|
||||
|
||||
foo(1);
|
||||
>foo(1) : void
|
||||
>foo : (n?: number, s?: string) => void
|
||||
>1 : 1
|
||||
|
||||
foo(1, "hi");
|
||||
>foo(1, "hi") : void
|
||||
>foo : (n?: number, s?: string) => void
|
||||
>1 : 1
|
||||
>"hi" : "hi"
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
//// [returns.js]
|
||||
// @ts-check
|
||||
/**
|
||||
* @returns {string} This comment is not currently exposed
|
||||
*/
|
||||
function f() {
|
||||
return "hello";
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {string=} This comment is not currently exposed
|
||||
*/
|
||||
function f1() {
|
||||
return "hello world";
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {string|number} This comment is not currently exposed
|
||||
*/
|
||||
function f2() {
|
||||
return 5 || "hello";
|
||||
}
|
||||
|
||||
//// [dummy.js]
|
||||
// @ts-check
|
||||
/**
|
||||
* @returns {string} This comment is not currently exposed
|
||||
*/
|
||||
function f() {
|
||||
return "hello";
|
||||
}
|
||||
/**
|
||||
* @returns {string=} This comment is not currently exposed
|
||||
*/
|
||||
function f1() {
|
||||
return "hello world";
|
||||
}
|
||||
/**
|
||||
* @returns {string|number} This comment is not currently exposed
|
||||
*/
|
||||
function f2() {
|
||||
return 5 || "hello";
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
=== tests/cases/conformance/jsdoc/returns.js ===
|
||||
// @ts-check
|
||||
/**
|
||||
* @returns {string} This comment is not currently exposed
|
||||
*/
|
||||
function f() {
|
||||
>f : Symbol(f, Decl(returns.js, 0, 0))
|
||||
|
||||
return "hello";
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {string=} This comment is not currently exposed
|
||||
*/
|
||||
function f1() {
|
||||
>f1 : Symbol(f1, Decl(returns.js, 6, 1))
|
||||
|
||||
return "hello world";
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {string|number} This comment is not currently exposed
|
||||
*/
|
||||
function f2() {
|
||||
>f2 : Symbol(f2, Decl(returns.js, 13, 1))
|
||||
|
||||
return 5 || "hello";
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
=== tests/cases/conformance/jsdoc/returns.js ===
|
||||
// @ts-check
|
||||
/**
|
||||
* @returns {string} This comment is not currently exposed
|
||||
*/
|
||||
function f() {
|
||||
>f : () => string
|
||||
|
||||
return "hello";
|
||||
>"hello" : "hello"
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {string=} This comment is not currently exposed
|
||||
*/
|
||||
function f1() {
|
||||
>f1 : () => string
|
||||
|
||||
return "hello world";
|
||||
>"hello world" : "hello world"
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {string|number} This comment is not currently exposed
|
||||
*/
|
||||
function f2() {
|
||||
>f2 : () => string | number
|
||||
|
||||
return 5 || "hello";
|
||||
>5 || "hello" : "hello" | 5
|
||||
>5 : 5
|
||||
>"hello" : "hello"
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
//// [returns.js]
|
||||
// @ts-check
|
||||
/**
|
||||
* @returns {string} This comment is not currently exposed
|
||||
*/
|
||||
function f() {
|
||||
return 5;
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {string | number} This comment is not currently exposed
|
||||
*/
|
||||
function f1() {
|
||||
return 5 || true;
|
||||
}
|
||||
|
||||
//// [dummy.js]
|
||||
// @ts-check
|
||||
/**
|
||||
* @returns {string} This comment is not currently exposed
|
||||
*/
|
||||
function f() {
|
||||
return 5;
|
||||
}
|
||||
/**
|
||||
* @returns {string | number} This comment is not currently exposed
|
||||
*/
|
||||
function f1() {
|
||||
return 5 || true;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
=== tests/cases/conformance/jsdoc/returns.js ===
|
||||
// @ts-check
|
||||
/**
|
||||
* @returns {string} This comment is not currently exposed
|
||||
*/
|
||||
function f() {
|
||||
>f : Symbol(f, Decl(returns.js, 0, 0))
|
||||
|
||||
return 5;
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {string | number} This comment is not currently exposed
|
||||
*/
|
||||
function f1() {
|
||||
>f1 : Symbol(f1, Decl(returns.js, 6, 1))
|
||||
|
||||
return 5 || true;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
=== tests/cases/conformance/jsdoc/returns.js ===
|
||||
// @ts-check
|
||||
/**
|
||||
* @returns {string} This comment is not currently exposed
|
||||
*/
|
||||
function f() {
|
||||
>f : () => string
|
||||
|
||||
return 5;
|
||||
>5 : 5
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {string | number} This comment is not currently exposed
|
||||
*/
|
||||
function f1() {
|
||||
>f1 : () => string | number
|
||||
|
||||
return 5 || true;
|
||||
>5 || true : true | 5
|
||||
>5 : 5
|
||||
>true : true
|
||||
}
|
||||
+12
@@ -1,7 +1,14 @@
|
||||
//// [0.js]
|
||||
// @ts-check
|
||||
/** @type {String} */
|
||||
var S = "hello world";
|
||||
|
||||
/** @type {number} */
|
||||
var n = 10;
|
||||
|
||||
/** @type {*} */
|
||||
var anyT = 2;
|
||||
anyT = "hello";
|
||||
|
||||
/** @type {?} */
|
||||
var anyT1 = 2;
|
||||
@@ -25,8 +32,13 @@ x2(0);
|
||||
|
||||
//// [0.js]
|
||||
// @ts-check
|
||||
/** @type {String} */
|
||||
var S = "hello world";
|
||||
/** @type {number} */
|
||||
var n = 10;
|
||||
/** @type {*} */
|
||||
var anyT = 2;
|
||||
anyT = "hello";
|
||||
/** @type {?} */
|
||||
var anyT1 = 2;
|
||||
anyT1 = "hi";
|
||||
@@ -0,0 +1,60 @@
|
||||
=== tests/cases/conformance/jsdoc/0.js ===
|
||||
// @ts-check
|
||||
/** @type {String} */
|
||||
var S = "hello world";
|
||||
>S : Symbol(S, Decl(0.js, 2, 3))
|
||||
|
||||
/** @type {number} */
|
||||
var n = 10;
|
||||
>n : Symbol(n, Decl(0.js, 5, 3))
|
||||
|
||||
/** @type {*} */
|
||||
var anyT = 2;
|
||||
>anyT : Symbol(anyT, Decl(0.js, 8, 3))
|
||||
|
||||
anyT = "hello";
|
||||
>anyT : Symbol(anyT, Decl(0.js, 8, 3))
|
||||
|
||||
/** @type {?} */
|
||||
var anyT1 = 2;
|
||||
>anyT1 : Symbol(anyT1, Decl(0.js, 12, 3))
|
||||
|
||||
anyT1 = "hi";
|
||||
>anyT1 : Symbol(anyT1, Decl(0.js, 12, 3))
|
||||
|
||||
/** @type {Function} */
|
||||
const x = (a) => a + 1;
|
||||
>x : Symbol(x, Decl(0.js, 16, 5))
|
||||
>a : Symbol(a, Decl(0.js, 16, 11))
|
||||
>a : Symbol(a, Decl(0.js, 16, 11))
|
||||
|
||||
x(1);
|
||||
>x : Symbol(x, Decl(0.js, 16, 5))
|
||||
|
||||
/** @type {function} */
|
||||
const y = (a) => a + 1;
|
||||
>y : Symbol(y, Decl(0.js, 20, 5))
|
||||
>a : Symbol(a, Decl(0.js, 20, 11))
|
||||
>a : Symbol(a, Decl(0.js, 20, 11))
|
||||
|
||||
x(1);
|
||||
>x : Symbol(x, Decl(0.js, 16, 5))
|
||||
|
||||
/** @type {function (number)} */
|
||||
const x1 = (a) => a + 1;
|
||||
>x1 : Symbol(x1, Decl(0.js, 24, 5))
|
||||
>a : Symbol(a, Decl(0.js, 24, 12))
|
||||
>a : Symbol(a, Decl(0.js, 24, 12))
|
||||
|
||||
x1(0);
|
||||
>x1 : Symbol(x1, Decl(0.js, 24, 5))
|
||||
|
||||
/** @type {function (number): number} */
|
||||
const x2 = (a) => a + 1;
|
||||
>x2 : Symbol(x2, Decl(0.js, 28, 5))
|
||||
>a : Symbol(a, Decl(0.js, 28, 12))
|
||||
>a : Symbol(a, Decl(0.js, 28, 12))
|
||||
|
||||
x2(0);
|
||||
>x2 : Symbol(x2, Decl(0.js, 28, 5))
|
||||
|
||||
+16
-1
@@ -1,10 +1,25 @@
|
||||
=== tests/cases/conformance/salsa/0.js ===
|
||||
=== tests/cases/conformance/jsdoc/0.js ===
|
||||
// @ts-check
|
||||
/** @type {String} */
|
||||
var S = "hello world";
|
||||
>S : string
|
||||
>"hello world" : "hello world"
|
||||
|
||||
/** @type {number} */
|
||||
var n = 10;
|
||||
>n : number
|
||||
>10 : 10
|
||||
|
||||
/** @type {*} */
|
||||
var anyT = 2;
|
||||
>anyT : any
|
||||
>2 : 2
|
||||
|
||||
anyT = "hello";
|
||||
>anyT = "hello" : "hello"
|
||||
>anyT : any
|
||||
>"hello" : "hello"
|
||||
|
||||
/** @type {?} */
|
||||
var anyT1 = 2;
|
||||
>anyT1 : any
|
||||
@@ -0,0 +1,42 @@
|
||||
tests/cases/conformance/jsdoc/0.js(3,5): error TS2322: Type 'true' is not assignable to type 'string'.
|
||||
tests/cases/conformance/jsdoc/0.js(6,5): error TS2322: Type '"hello"' is not assignable to type 'number'.
|
||||
tests/cases/conformance/jsdoc/0.js(10,4): error TS2345: Argument of type '"string"' is not assignable to parameter of type 'number'.
|
||||
tests/cases/conformance/jsdoc/0.js(13,7): error TS2451: Cannot redeclare block-scoped variable 'x2'.
|
||||
tests/cases/conformance/jsdoc/0.js(17,1): error TS2322: Type 'number' is not assignable to type 'string'.
|
||||
tests/cases/conformance/jsdoc/0.js(20,7): error TS2451: Cannot redeclare block-scoped variable 'x2'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/jsdoc/0.js (6 errors) ====
|
||||
// @ts-check
|
||||
/** @type {String} */
|
||||
var S = true;
|
||||
~
|
||||
!!! error TS2322: Type 'true' is not assignable to type 'string'.
|
||||
|
||||
/** @type {number} */
|
||||
var n = "hello";
|
||||
~
|
||||
!!! error TS2322: Type '"hello"' is not assignable to type 'number'.
|
||||
|
||||
/** @type {function (number)} */
|
||||
const x1 = (a) => a + 1;
|
||||
x1("string");
|
||||
~~~~~~~~
|
||||
!!! error TS2345: Argument of type '"string"' is not assignable to parameter of type 'number'.
|
||||
|
||||
/** @type {function (number): number} */
|
||||
const x2 = (a) => a + 1;
|
||||
~~
|
||||
!!! error TS2451: Cannot redeclare block-scoped variable 'x2'.
|
||||
|
||||
/** @type {string} */
|
||||
var a;
|
||||
a = x2(0);
|
||||
~
|
||||
!!! error TS2322: Type 'number' is not assignable to type 'string'.
|
||||
|
||||
/** @type {function (number): number} */
|
||||
const x2 = (a) => a.concat("hi");
|
||||
~~
|
||||
!!! error TS2451: Cannot redeclare block-scoped variable 'x2'.
|
||||
x2(0);
|
||||
@@ -0,0 +1,40 @@
|
||||
//// [0.js]
|
||||
// @ts-check
|
||||
/** @type {String} */
|
||||
var S = true;
|
||||
|
||||
/** @type {number} */
|
||||
var n = "hello";
|
||||
|
||||
/** @type {function (number)} */
|
||||
const x1 = (a) => a + 1;
|
||||
x1("string");
|
||||
|
||||
/** @type {function (number): number} */
|
||||
const x2 = (a) => a + 1;
|
||||
|
||||
/** @type {string} */
|
||||
var a;
|
||||
a = x2(0);
|
||||
|
||||
/** @type {function (number): number} */
|
||||
const x2 = (a) => a.concat("hi");
|
||||
x2(0);
|
||||
|
||||
//// [0.js]
|
||||
// @ts-check
|
||||
/** @type {String} */
|
||||
var S = true;
|
||||
/** @type {number} */
|
||||
var n = "hello";
|
||||
/** @type {function (number)} */
|
||||
var x1 = function (a) { return a + 1; };
|
||||
x1("string");
|
||||
/** @type {function (number): number} */
|
||||
var x2 = function (a) { return a + 1; };
|
||||
/** @type {string} */
|
||||
var a;
|
||||
a = x2(0);
|
||||
/** @type {function (number): number} */
|
||||
var x2 = function (a) { return a.concat("hi"); };
|
||||
x2(0);
|
||||
+3
-3
@@ -1,8 +1,8 @@
|
||||
tests/cases/conformance/salsa/0.js(5,4): error TS2345: Argument of type '"string"' is not assignable to parameter of type 'number'.
|
||||
tests/cases/conformance/salsa/0.js(12,1): error TS2322: Type 'number' is not assignable to type 'string'.
|
||||
tests/cases/conformance/jsdoc/0.js(5,4): error TS2345: Argument of type '"string"' is not assignable to parameter of type 'number'.
|
||||
tests/cases/conformance/jsdoc/0.js(12,1): error TS2322: Type 'number' is not assignable to type 'string'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/salsa/0.js (2 errors) ====
|
||||
==== tests/cases/conformance/jsdoc/0.js (2 errors) ====
|
||||
// @ts-check
|
||||
|
||||
/** @type {function (number)} */
|
||||
@@ -13,8 +13,8 @@ interface Prop {
|
||||
|
||||
children: string | JSX.Element
|
||||
>children : Symbol(Prop.children, Decl(file.tsx, 4, 14))
|
||||
>JSX : Symbol(JSX, Decl(react.d.ts, 2352, 1))
|
||||
>Element : Symbol(JSX.Element, Decl(react.d.ts, 2355, 27))
|
||||
>JSX : Symbol(JSX, Decl(react.d.ts, 2353, 1))
|
||||
>Element : Symbol(JSX.Element, Decl(react.d.ts, 2356, 27))
|
||||
}
|
||||
|
||||
function Comp(p: Prop) {
|
||||
@@ -23,11 +23,11 @@ function Comp(p: Prop) {
|
||||
>Prop : Symbol(Prop, Decl(file.tsx, 0, 32))
|
||||
|
||||
return <div>{p.b}</div>;
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2399, 45))
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2400, 45))
|
||||
>p.b : Symbol(Prop.b, Decl(file.tsx, 3, 14))
|
||||
>p : Symbol(p, Decl(file.tsx, 8, 14))
|
||||
>b : Symbol(Prop.b, Decl(file.tsx, 3, 14))
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2399, 45))
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2400, 45))
|
||||
}
|
||||
|
||||
// OK
|
||||
@@ -59,8 +59,8 @@ let k2 =
|
||||
>b : Symbol(b, Decl(file.tsx, 19, 16))
|
||||
|
||||
<div>hi hi hi!</div>
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2399, 45))
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2399, 45))
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2400, 45))
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2400, 45))
|
||||
|
||||
</Comp>;
|
||||
>Comp : Symbol(Comp, Decl(file.tsx, 6, 1))
|
||||
|
||||
@@ -18,9 +18,9 @@ interface ButtonProp {
|
||||
|
||||
class Button extends React.Component<ButtonProp, any> {
|
||||
>Button : Symbol(Button, Decl(file.tsx, 6, 1))
|
||||
>React.Component : Symbol(React.Component, Decl(react.d.ts, 158, 55))
|
||||
>React.Component : Symbol(React.Component, Decl(react.d.ts, 158, 55), Decl(react.d.ts, 161, 66))
|
||||
>React : Symbol(React, Decl(file.tsx, 0, 0))
|
||||
>Component : Symbol(React.Component, Decl(react.d.ts, 158, 55))
|
||||
>Component : Symbol(React.Component, Decl(react.d.ts, 158, 55), Decl(react.d.ts, 161, 66))
|
||||
>ButtonProp : Symbol(ButtonProp, Decl(file.tsx, 0, 32))
|
||||
|
||||
render() {
|
||||
@@ -34,20 +34,20 @@ class Button extends React.Component<ButtonProp, any> {
|
||||
|
||||
return <InnerButton {...this.props} />
|
||||
>InnerButton : Symbol(InnerButton, Decl(file.tsx, 24, 1))
|
||||
>this.props : Symbol(React.Component.props, Decl(react.d.ts, 166, 37))
|
||||
>this.props : Symbol(React.Component.props, Decl(react.d.ts, 167, 37))
|
||||
>this : Symbol(Button, Decl(file.tsx, 6, 1))
|
||||
>props : Symbol(React.Component.props, Decl(react.d.ts, 166, 37))
|
||||
>props : Symbol(React.Component.props, Decl(react.d.ts, 167, 37))
|
||||
}
|
||||
else {
|
||||
return (<InnerButton {...this.props} >
|
||||
>InnerButton : Symbol(InnerButton, Decl(file.tsx, 24, 1))
|
||||
>this.props : Symbol(React.Component.props, Decl(react.d.ts, 166, 37))
|
||||
>this.props : Symbol(React.Component.props, Decl(react.d.ts, 167, 37))
|
||||
>this : Symbol(Button, Decl(file.tsx, 6, 1))
|
||||
>props : Symbol(React.Component.props, Decl(react.d.ts, 166, 37))
|
||||
>props : Symbol(React.Component.props, Decl(react.d.ts, 167, 37))
|
||||
|
||||
<div>Hello World</div>
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2399, 45))
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2399, 45))
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2400, 45))
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2400, 45))
|
||||
|
||||
</InnerButton>);
|
||||
>InnerButton : Symbol(InnerButton, Decl(file.tsx, 24, 1))
|
||||
@@ -64,17 +64,17 @@ interface InnerButtonProp {
|
||||
|
||||
class InnerButton extends React.Component<InnerButtonProp, any> {
|
||||
>InnerButton : Symbol(InnerButton, Decl(file.tsx, 24, 1))
|
||||
>React.Component : Symbol(React.Component, Decl(react.d.ts, 158, 55))
|
||||
>React.Component : Symbol(React.Component, Decl(react.d.ts, 158, 55), Decl(react.d.ts, 161, 66))
|
||||
>React : Symbol(React, Decl(file.tsx, 0, 0))
|
||||
>Component : Symbol(React.Component, Decl(react.d.ts, 158, 55))
|
||||
>Component : Symbol(React.Component, Decl(react.d.ts, 158, 55), Decl(react.d.ts, 161, 66))
|
||||
>InnerButtonProp : Symbol(InnerButtonProp, Decl(file.tsx, 20, 1))
|
||||
|
||||
render() {
|
||||
>render : Symbol(InnerButton.render, Decl(file.tsx, 26, 65))
|
||||
|
||||
return (<button>Hello</button>);
|
||||
>button : Symbol(JSX.IntrinsicElements.button, Decl(react.d.ts, 2385, 43))
|
||||
>button : Symbol(JSX.IntrinsicElements.button, Decl(react.d.ts, 2385, 43))
|
||||
>button : Symbol(JSX.IntrinsicElements.button, Decl(react.d.ts, 2386, 43))
|
||||
>button : Symbol(JSX.IntrinsicElements.button, Decl(react.d.ts, 2386, 43))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,34 +16,34 @@ interface IFetchUserProps {
|
||||
>children : Symbol(IFetchUserProps.children, Decl(file.tsx, 6, 27))
|
||||
>user : Symbol(user, Decl(file.tsx, 7, 15))
|
||||
>IUser : Symbol(IUser, Decl(file.tsx, 0, 32))
|
||||
>JSX : Symbol(JSX, Decl(react.d.ts, 2352, 1))
|
||||
>Element : Symbol(JSX.Element, Decl(react.d.ts, 2355, 27))
|
||||
>JSX : Symbol(JSX, Decl(react.d.ts, 2353, 1))
|
||||
>Element : Symbol(JSX.Element, Decl(react.d.ts, 2356, 27))
|
||||
}
|
||||
|
||||
class FetchUser extends React.Component<IFetchUserProps, any> {
|
||||
>FetchUser : Symbol(FetchUser, Decl(file.tsx, 8, 1))
|
||||
>React.Component : Symbol(React.Component, Decl(react.d.ts, 158, 55))
|
||||
>React.Component : Symbol(React.Component, Decl(react.d.ts, 158, 55), Decl(react.d.ts, 161, 66))
|
||||
>React : Symbol(React, Decl(file.tsx, 0, 0))
|
||||
>Component : Symbol(React.Component, Decl(react.d.ts, 158, 55))
|
||||
>Component : Symbol(React.Component, Decl(react.d.ts, 158, 55), Decl(react.d.ts, 161, 66))
|
||||
>IFetchUserProps : Symbol(IFetchUserProps, Decl(file.tsx, 4, 1))
|
||||
|
||||
render() {
|
||||
>render : Symbol(FetchUser.render, Decl(file.tsx, 10, 63))
|
||||
|
||||
return this.state
|
||||
>this.state : Symbol(React.Component.state, Decl(react.d.ts, 173, 44))
|
||||
>this.state : Symbol(React.Component.state, Decl(react.d.ts, 174, 44))
|
||||
>this : Symbol(FetchUser, Decl(file.tsx, 8, 1))
|
||||
>state : Symbol(React.Component.state, Decl(react.d.ts, 173, 44))
|
||||
>state : Symbol(React.Component.state, Decl(react.d.ts, 174, 44))
|
||||
|
||||
? this.props.children(this.state.result)
|
||||
>this.props.children : Symbol(children, Decl(file.tsx, 6, 27), Decl(react.d.ts, 173, 20))
|
||||
>this.props : Symbol(React.Component.props, Decl(react.d.ts, 166, 37))
|
||||
>this.props.children : Symbol(children, Decl(file.tsx, 6, 27), Decl(react.d.ts, 174, 20))
|
||||
>this.props : Symbol(React.Component.props, Decl(react.d.ts, 167, 37))
|
||||
>this : Symbol(FetchUser, Decl(file.tsx, 8, 1))
|
||||
>props : Symbol(React.Component.props, Decl(react.d.ts, 166, 37))
|
||||
>children : Symbol(children, Decl(file.tsx, 6, 27), Decl(react.d.ts, 173, 20))
|
||||
>this.state : Symbol(React.Component.state, Decl(react.d.ts, 173, 44))
|
||||
>props : Symbol(React.Component.props, Decl(react.d.ts, 167, 37))
|
||||
>children : Symbol(children, Decl(file.tsx, 6, 27), Decl(react.d.ts, 174, 20))
|
||||
>this.state : Symbol(React.Component.state, Decl(react.d.ts, 174, 44))
|
||||
>this : Symbol(FetchUser, Decl(file.tsx, 8, 1))
|
||||
>state : Symbol(React.Component.state, Decl(react.d.ts, 173, 44))
|
||||
>state : Symbol(React.Component.state, Decl(react.d.ts, 174, 44))
|
||||
|
||||
: null;
|
||||
}
|
||||
@@ -61,11 +61,11 @@ function UserName0() {
|
||||
>user : Symbol(user, Decl(file.tsx, 22, 13))
|
||||
|
||||
<h1>{ user.Name }</h1>
|
||||
>h1 : Symbol(JSX.IntrinsicElements.h1, Decl(react.d.ts, 2409, 47))
|
||||
>h1 : Symbol(JSX.IntrinsicElements.h1, Decl(react.d.ts, 2410, 47))
|
||||
>user.Name : Symbol(IUser.Name, Decl(file.tsx, 2, 17))
|
||||
>user : Symbol(user, Decl(file.tsx, 22, 13))
|
||||
>Name : Symbol(IUser.Name, Decl(file.tsx, 2, 17))
|
||||
>h1 : Symbol(JSX.IntrinsicElements.h1, Decl(react.d.ts, 2409, 47))
|
||||
>h1 : Symbol(JSX.IntrinsicElements.h1, Decl(react.d.ts, 2410, 47))
|
||||
|
||||
) }
|
||||
</FetchUser>
|
||||
@@ -85,11 +85,11 @@ function UserName1() {
|
||||
>user : Symbol(user, Decl(file.tsx, 33, 13))
|
||||
|
||||
<h1>{ user.Name }</h1>
|
||||
>h1 : Symbol(JSX.IntrinsicElements.h1, Decl(react.d.ts, 2409, 47))
|
||||
>h1 : Symbol(JSX.IntrinsicElements.h1, Decl(react.d.ts, 2410, 47))
|
||||
>user.Name : Symbol(IUser.Name, Decl(file.tsx, 2, 17))
|
||||
>user : Symbol(user, Decl(file.tsx, 33, 13))
|
||||
>Name : Symbol(IUser.Name, Decl(file.tsx, 2, 17))
|
||||
>h1 : Symbol(JSX.IntrinsicElements.h1, Decl(react.d.ts, 2409, 47))
|
||||
>h1 : Symbol(JSX.IntrinsicElements.h1, Decl(react.d.ts, 2410, 47))
|
||||
|
||||
) }
|
||||
</FetchUser>
|
||||
|
||||
@@ -13,24 +13,24 @@ interface Prop {
|
||||
|
||||
children: JSX.Element | JSX.Element[];
|
||||
>children : Symbol(Prop.children, Decl(file.tsx, 4, 14))
|
||||
>JSX : Symbol(JSX, Decl(react.d.ts, 2352, 1))
|
||||
>Element : Symbol(JSX.Element, Decl(react.d.ts, 2355, 27))
|
||||
>JSX : Symbol(JSX, Decl(react.d.ts, 2352, 1))
|
||||
>Element : Symbol(JSX.Element, Decl(react.d.ts, 2355, 27))
|
||||
>JSX : Symbol(JSX, Decl(react.d.ts, 2353, 1))
|
||||
>Element : Symbol(JSX.Element, Decl(react.d.ts, 2356, 27))
|
||||
>JSX : Symbol(JSX, Decl(react.d.ts, 2353, 1))
|
||||
>Element : Symbol(JSX.Element, Decl(react.d.ts, 2356, 27))
|
||||
}
|
||||
|
||||
class Button extends React.Component<any, any> {
|
||||
>Button : Symbol(Button, Decl(file.tsx, 6, 1))
|
||||
>React.Component : Symbol(React.Component, Decl(react.d.ts, 158, 55))
|
||||
>React.Component : Symbol(React.Component, Decl(react.d.ts, 158, 55), Decl(react.d.ts, 161, 66))
|
||||
>React : Symbol(React, Decl(file.tsx, 0, 0))
|
||||
>Component : Symbol(React.Component, Decl(react.d.ts, 158, 55))
|
||||
>Component : Symbol(React.Component, Decl(react.d.ts, 158, 55), Decl(react.d.ts, 161, 66))
|
||||
|
||||
render() {
|
||||
>render : Symbol(Button.render, Decl(file.tsx, 8, 48))
|
||||
|
||||
return (<div>My Button</div>)
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2399, 45))
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2399, 45))
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2400, 45))
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2400, 45))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,8 +39,8 @@ function AnotherButton(p: any) {
|
||||
>p : Symbol(p, Decl(file.tsx, 14, 23))
|
||||
|
||||
return <h1>Just Another Button</h1>;
|
||||
>h1 : Symbol(JSX.IntrinsicElements.h1, Decl(react.d.ts, 2409, 47))
|
||||
>h1 : Symbol(JSX.IntrinsicElements.h1, Decl(react.d.ts, 2409, 47))
|
||||
>h1 : Symbol(JSX.IntrinsicElements.h1, Decl(react.d.ts, 2410, 47))
|
||||
>h1 : Symbol(JSX.IntrinsicElements.h1, Decl(react.d.ts, 2410, 47))
|
||||
}
|
||||
|
||||
function Comp(p: Prop) {
|
||||
@@ -49,11 +49,11 @@ function Comp(p: Prop) {
|
||||
>Prop : Symbol(Prop, Decl(file.tsx, 0, 32))
|
||||
|
||||
return <div>{p.b}</div>;
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2399, 45))
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2400, 45))
|
||||
>p.b : Symbol(Prop.b, Decl(file.tsx, 3, 14))
|
||||
>p : Symbol(p, Decl(file.tsx, 18, 14))
|
||||
>b : Symbol(Prop.b, Decl(file.tsx, 3, 14))
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2399, 45))
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2400, 45))
|
||||
}
|
||||
|
||||
// Ok
|
||||
|
||||
@@ -13,24 +13,24 @@ interface Prop {
|
||||
|
||||
children: string | JSX.Element | (string | JSX.Element)[];
|
||||
>children : Symbol(Prop.children, Decl(file.tsx, 4, 14))
|
||||
>JSX : Symbol(JSX, Decl(react.d.ts, 2352, 1))
|
||||
>Element : Symbol(JSX.Element, Decl(react.d.ts, 2355, 27))
|
||||
>JSX : Symbol(JSX, Decl(react.d.ts, 2352, 1))
|
||||
>Element : Symbol(JSX.Element, Decl(react.d.ts, 2355, 27))
|
||||
>JSX : Symbol(JSX, Decl(react.d.ts, 2353, 1))
|
||||
>Element : Symbol(JSX.Element, Decl(react.d.ts, 2356, 27))
|
||||
>JSX : Symbol(JSX, Decl(react.d.ts, 2353, 1))
|
||||
>Element : Symbol(JSX.Element, Decl(react.d.ts, 2356, 27))
|
||||
}
|
||||
|
||||
class Button extends React.Component<any, any> {
|
||||
>Button : Symbol(Button, Decl(file.tsx, 6, 1))
|
||||
>React.Component : Symbol(React.Component, Decl(react.d.ts, 158, 55))
|
||||
>React.Component : Symbol(React.Component, Decl(react.d.ts, 158, 55), Decl(react.d.ts, 161, 66))
|
||||
>React : Symbol(React, Decl(file.tsx, 0, 0))
|
||||
>Component : Symbol(React.Component, Decl(react.d.ts, 158, 55))
|
||||
>Component : Symbol(React.Component, Decl(react.d.ts, 158, 55), Decl(react.d.ts, 161, 66))
|
||||
|
||||
render() {
|
||||
>render : Symbol(Button.render, Decl(file.tsx, 8, 48))
|
||||
|
||||
return (<div>My Button</div>)
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2399, 45))
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2399, 45))
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2400, 45))
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2400, 45))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,8 +39,8 @@ function AnotherButton(p: any) {
|
||||
>p : Symbol(p, Decl(file.tsx, 14, 23))
|
||||
|
||||
return <h1>Just Another Button</h1>;
|
||||
>h1 : Symbol(JSX.IntrinsicElements.h1, Decl(react.d.ts, 2409, 47))
|
||||
>h1 : Symbol(JSX.IntrinsicElements.h1, Decl(react.d.ts, 2409, 47))
|
||||
>h1 : Symbol(JSX.IntrinsicElements.h1, Decl(react.d.ts, 2410, 47))
|
||||
>h1 : Symbol(JSX.IntrinsicElements.h1, Decl(react.d.ts, 2410, 47))
|
||||
}
|
||||
|
||||
function Comp(p: Prop) {
|
||||
@@ -49,11 +49,11 @@ function Comp(p: Prop) {
|
||||
>Prop : Symbol(Prop, Decl(file.tsx, 0, 32))
|
||||
|
||||
return <div>{p.b}</div>;
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2399, 45))
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2400, 45))
|
||||
>p.b : Symbol(Prop.b, Decl(file.tsx, 3, 14))
|
||||
>p : Symbol(p, Decl(file.tsx, 18, 14))
|
||||
>b : Symbol(Prop.b, Decl(file.tsx, 3, 14))
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2399, 45))
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2400, 45))
|
||||
}
|
||||
|
||||
// OK
|
||||
|
||||
@@ -5,26 +5,26 @@ import React = require('react');
|
||||
// OK
|
||||
let k1 = <div> <h2> Hello </h2> <h1> world </h1></div>;
|
||||
>k1 : Symbol(k1, Decl(file.tsx, 3, 3))
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2399, 45))
|
||||
>h2 : Symbol(JSX.IntrinsicElements.h2, Decl(react.d.ts, 2410, 48))
|
||||
>h2 : Symbol(JSX.IntrinsicElements.h2, Decl(react.d.ts, 2410, 48))
|
||||
>h1 : Symbol(JSX.IntrinsicElements.h1, Decl(react.d.ts, 2409, 47))
|
||||
>h1 : Symbol(JSX.IntrinsicElements.h1, Decl(react.d.ts, 2409, 47))
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2399, 45))
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2400, 45))
|
||||
>h2 : Symbol(JSX.IntrinsicElements.h2, Decl(react.d.ts, 2411, 48))
|
||||
>h2 : Symbol(JSX.IntrinsicElements.h2, Decl(react.d.ts, 2411, 48))
|
||||
>h1 : Symbol(JSX.IntrinsicElements.h1, Decl(react.d.ts, 2410, 47))
|
||||
>h1 : Symbol(JSX.IntrinsicElements.h1, Decl(react.d.ts, 2410, 47))
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2400, 45))
|
||||
|
||||
let k2 = <div> <h2> Hello </h2> {(user: any) => <h2>{user.name}</h2>}</div>;
|
||||
>k2 : Symbol(k2, Decl(file.tsx, 4, 3))
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2399, 45))
|
||||
>h2 : Symbol(JSX.IntrinsicElements.h2, Decl(react.d.ts, 2410, 48))
|
||||
>h2 : Symbol(JSX.IntrinsicElements.h2, Decl(react.d.ts, 2410, 48))
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2400, 45))
|
||||
>h2 : Symbol(JSX.IntrinsicElements.h2, Decl(react.d.ts, 2411, 48))
|
||||
>h2 : Symbol(JSX.IntrinsicElements.h2, Decl(react.d.ts, 2411, 48))
|
||||
>user : Symbol(user, Decl(file.tsx, 4, 34))
|
||||
>h2 : Symbol(JSX.IntrinsicElements.h2, Decl(react.d.ts, 2410, 48))
|
||||
>h2 : Symbol(JSX.IntrinsicElements.h2, Decl(react.d.ts, 2411, 48))
|
||||
>user : Symbol(user, Decl(file.tsx, 4, 34))
|
||||
>h2 : Symbol(JSX.IntrinsicElements.h2, Decl(react.d.ts, 2410, 48))
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2399, 45))
|
||||
>h2 : Symbol(JSX.IntrinsicElements.h2, Decl(react.d.ts, 2411, 48))
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2400, 45))
|
||||
|
||||
let k3 = <div> {1} {"That is a number"} </div>;
|
||||
>k3 : Symbol(k3, Decl(file.tsx, 5, 3))
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2399, 45))
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2399, 45))
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2400, 45))
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2400, 45))
|
||||
|
||||
|
||||
@@ -12,9 +12,9 @@ class A {
|
||||
>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
|
||||
x.forEach((v) => {
|
||||
>x.forEach : Symbol(Array.forEach, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>x.forEach : Symbol(Array.forEach, Decl(lib.d.ts, --, --))
|
||||
>x : Symbol(x, Decl(checkSwitchStatementIfCaseTypeIsString.ts, 3, 9))
|
||||
>forEach : Symbol(Array.forEach, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>forEach : Symbol(Array.forEach, Decl(lib.d.ts, --, --))
|
||||
>v : Symbol(v, Decl(checkSwitchStatementIfCaseTypeIsString.ts, 4, 19))
|
||||
|
||||
switch(v) {
|
||||
|
||||
@@ -13,10 +13,10 @@ class A {
|
||||
|
||||
x.forEach((v) => {
|
||||
>x.forEach((v) => { switch(v) { case "test": use(this); } }) : void
|
||||
>x.forEach : { (callbackfn: (this: void, value: string, index: number, array: string[]) => void): void; (callbackfn: (this: void, value: string, index: number, array: string[]) => void, thisArg: undefined): void; <Z>(callbackfn: (this: Z, value: string, index: number, array: string[]) => void, thisArg: Z): void; }
|
||||
>x.forEach : (callbackfn: (value: string, index: number, array: string[]) => void, thisArg?: any) => void
|
||||
>x : string[]
|
||||
>forEach : { (callbackfn: (this: void, value: string, index: number, array: string[]) => void): void; (callbackfn: (this: void, value: string, index: number, array: string[]) => void, thisArg: undefined): void; <Z>(callbackfn: (this: Z, value: string, index: number, array: string[]) => void, thisArg: Z): void; }
|
||||
>(v) => { switch(v) { case "test": use(this); } } : (this: void, v: string) => void
|
||||
>forEach : (callbackfn: (value: string, index: number, array: string[]) => void, thisArg?: any) => void
|
||||
>(v) => { switch(v) { case "test": use(this); } } : (v: string) => void
|
||||
>v : string
|
||||
|
||||
switch(v) {
|
||||
|
||||
@@ -30,9 +30,9 @@ for (let i = 0; i < 3; i++) {
|
||||
});
|
||||
}
|
||||
arr.forEach(C => console.log(C.y()));
|
||||
>arr.forEach : Symbol(Array.forEach, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>arr.forEach : Symbol(Array.forEach, Decl(lib.d.ts, --, --))
|
||||
>arr : Symbol(arr, Decl(classExpressionWithStaticProperties3.ts, 1, 5))
|
||||
>forEach : Symbol(Array.forEach, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>forEach : Symbol(Array.forEach, Decl(lib.d.ts, --, --))
|
||||
>C : Symbol(C, Decl(classExpressionWithStaticProperties3.ts, 8, 12))
|
||||
>console : Symbol(console, Decl(classExpressionWithStaticProperties3.ts, 0, 11))
|
||||
>C.y : Symbol(y, Decl(classExpressionWithStaticProperties3.ts, 1, 12))
|
||||
|
||||
@@ -41,10 +41,10 @@ for (let i = 0; i < 3; i++) {
|
||||
}
|
||||
arr.forEach(C => console.log(C.y()));
|
||||
>arr.forEach(C => console.log(C.y())) : void
|
||||
>arr.forEach : { (callbackfn: (this: void, value: { y(): number; }, index: number, array: { y(): number; }[]) => void): void; (callbackfn: (this: void, value: { y(): number; }, index: number, array: { y(): number; }[]) => void, thisArg: undefined): void; <Z>(callbackfn: (this: Z, value: { y(): number; }, index: number, array: { y(): number; }[]) => void, thisArg: Z): void; }
|
||||
>arr.forEach : (callbackfn: (value: { y(): number; }, index: number, array: { y(): number; }[]) => void, thisArg?: any) => void
|
||||
>arr : { y(): number; }[]
|
||||
>forEach : { (callbackfn: (this: void, value: { y(): number; }, index: number, array: { y(): number; }[]) => void): void; (callbackfn: (this: void, value: { y(): number; }, index: number, array: { y(): number; }[]) => void, thisArg: undefined): void; <Z>(callbackfn: (this: Z, value: { y(): number; }, index: number, array: { y(): number; }[]) => void, thisArg: Z): void; }
|
||||
>C => console.log(C.y()) : (this: void, C: { y(): number; }) => any
|
||||
>forEach : (callbackfn: (value: { y(): number; }, index: number, array: { y(): number; }[]) => void, thisArg?: any) => void
|
||||
>C => console.log(C.y()) : (C: { y(): number; }) => any
|
||||
>C : { y(): number; }
|
||||
>console.log(C.y()) : any
|
||||
>console.log : any
|
||||
|
||||
@@ -30,9 +30,9 @@ for (let i = 0; i < 3; i++) {
|
||||
});
|
||||
}
|
||||
arr.forEach(C => console.log(C.y()));
|
||||
>arr.forEach : Symbol(Array.forEach, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
|
||||
>arr.forEach : Symbol(Array.forEach, Decl(lib.es5.d.ts, --, --))
|
||||
>arr : Symbol(arr, Decl(classExpressionWithStaticPropertiesES63.ts, 1, 5))
|
||||
>forEach : Symbol(Array.forEach, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
|
||||
>forEach : Symbol(Array.forEach, Decl(lib.es5.d.ts, --, --))
|
||||
>C : Symbol(C, Decl(classExpressionWithStaticPropertiesES63.ts, 8, 12))
|
||||
>console : Symbol(console, Decl(classExpressionWithStaticPropertiesES63.ts, 0, 11))
|
||||
>C.y : Symbol(y, Decl(classExpressionWithStaticPropertiesES63.ts, 1, 12))
|
||||
|
||||
@@ -41,10 +41,10 @@ for (let i = 0; i < 3; i++) {
|
||||
}
|
||||
arr.forEach(C => console.log(C.y()));
|
||||
>arr.forEach(C => console.log(C.y())) : void
|
||||
>arr.forEach : { (callbackfn: (this: void, value: { y(): number; }, index: number, array: { y(): number; }[]) => void): void; (callbackfn: (this: void, value: { y(): number; }, index: number, array: { y(): number; }[]) => void, thisArg: undefined): void; <Z>(callbackfn: (this: Z, value: { y(): number; }, index: number, array: { y(): number; }[]) => void, thisArg: Z): void; }
|
||||
>arr.forEach : (callbackfn: (value: { y(): number; }, index: number, array: { y(): number; }[]) => void, thisArg?: any) => void
|
||||
>arr : { y(): number; }[]
|
||||
>forEach : { (callbackfn: (this: void, value: { y(): number; }, index: number, array: { y(): number; }[]) => void): void; (callbackfn: (this: void, value: { y(): number; }, index: number, array: { y(): number; }[]) => void, thisArg: undefined): void; <Z>(callbackfn: (this: Z, value: { y(): number; }, index: number, array: { y(): number; }[]) => void, thisArg: Z): void; }
|
||||
>C => console.log(C.y()) : (this: void, C: { y(): number; }) => any
|
||||
>forEach : (callbackfn: (value: { y(): number; }, index: number, array: { y(): number; }[]) => void, thisArg?: any) => void
|
||||
>C => console.log(C.y()) : (C: { y(): number; }) => any
|
||||
>C : { y(): number; }
|
||||
>console.log(C.y()) : any
|
||||
>console.log : any
|
||||
|
||||
@@ -4,8 +4,8 @@ function f (m: string) {
|
||||
>m : Symbol(m, Decl(commaOperatorInConditionalExpression.ts, 0, 12))
|
||||
|
||||
[1, 2, 3].map(i => {
|
||||
>[1, 2, 3].map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>[1, 2, 3].map : Symbol(Array.map, Decl(lib.d.ts, --, --))
|
||||
>map : Symbol(Array.map, Decl(lib.d.ts, --, --))
|
||||
>i : Symbol(i, Decl(commaOperatorInConditionalExpression.ts, 1, 18))
|
||||
|
||||
return true? { [m]: i } : { [m]: i + 1 }
|
||||
|
||||
@@ -5,13 +5,13 @@ function f (m: string) {
|
||||
|
||||
[1, 2, 3].map(i => {
|
||||
>[1, 2, 3].map(i => { return true? { [m]: i } : { [m]: i + 1 } }) : { [x: string]: number; }[]
|
||||
>[1, 2, 3].map : { <U>(this: [number, number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U, U, U, U]; <U>(this: [number, number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [number, number, number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U, U, U]; <U>(this: [number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [number, number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U, U]; <U>(this: [number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U]; <U>(this: [number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U]; <U>(this: [number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: number, index: number, array: number[]) => U): U[]; <U>(callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): U[]; }
|
||||
>[1, 2, 3].map : <U>(callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[]
|
||||
>[1, 2, 3] : number[]
|
||||
>1 : 1
|
||||
>2 : 2
|
||||
>3 : 3
|
||||
>map : { <U>(this: [number, number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U, U, U, U]; <U>(this: [number, number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [number, number, number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U, U, U]; <U>(this: [number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [number, number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U, U]; <U>(this: [number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U]; <U>(this: [number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U]; <U>(this: [number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: number, index: number, array: number[]) => U): U[]; <U>(callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): U[]; }
|
||||
>i => { return true? { [m]: i } : { [m]: i + 1 } } : (this: void, i: number) => { [x: string]: number; }
|
||||
>map : <U>(callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[]
|
||||
>i => { return true? { [m]: i } : { [m]: i + 1 } } : (i: number) => { [x: string]: number; }
|
||||
>i : number
|
||||
|
||||
return true? { [m]: i } : { [m]: i + 1 }
|
||||
|
||||
@@ -3,14 +3,14 @@ import React = require('react');
|
||||
>React : Symbol(React, Decl(file.tsx, 0, 0))
|
||||
|
||||
<div>
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2399, 45))
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2400, 45))
|
||||
|
||||
// Not Comment
|
||||
</div>;
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2399, 45))
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2400, 45))
|
||||
|
||||
<div>
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2399, 45))
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2400, 45))
|
||||
|
||||
// Not Comment
|
||||
{
|
||||
@@ -18,10 +18,10 @@ import React = require('react');
|
||||
}
|
||||
// Another not Comment
|
||||
</div>;
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2399, 45))
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2400, 45))
|
||||
|
||||
<div>
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2399, 45))
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2400, 45))
|
||||
|
||||
// Not Comment
|
||||
{
|
||||
@@ -30,10 +30,10 @@ import React = require('react');
|
||||
}
|
||||
// Another not Comment
|
||||
</div>;
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2399, 45))
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2400, 45))
|
||||
|
||||
<div>
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2399, 45))
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2400, 45))
|
||||
|
||||
/* Not Comment */
|
||||
{
|
||||
@@ -41,5 +41,5 @@ import React = require('react');
|
||||
"Hi"
|
||||
}
|
||||
</div>;
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2399, 45))
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2400, 45))
|
||||
|
||||
|
||||
@@ -4,9 +4,9 @@ var s: string[];
|
||||
>s : Symbol(s, Decl(commentInMethodCall.ts, 1, 3))
|
||||
|
||||
s.map(// do something
|
||||
>s.map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>s.map : Symbol(Array.map, Decl(lib.d.ts, --, --))
|
||||
>s : Symbol(s, Decl(commentInMethodCall.ts, 1, 3))
|
||||
>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>map : Symbol(Array.map, Decl(lib.d.ts, --, --))
|
||||
|
||||
function () { });
|
||||
|
||||
|
||||
@@ -5,10 +5,10 @@ var s: string[];
|
||||
|
||||
s.map(// do something
|
||||
>s.map(// do something function () { }) : void[]
|
||||
>s.map : { <U>(this: [string, string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U, U, U]; <U>(this: [string, string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [string, string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U]; <U>(this: [string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U]; <U>(this: [string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U]; <U>(this: [string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: string, index: number, array: string[]) => U): U[]; <U>(callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): U[]; }
|
||||
>s.map : <U>(callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[]
|
||||
>s : string[]
|
||||
>map : { <U>(this: [string, string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U, U, U]; <U>(this: [string, string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [string, string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U]; <U>(this: [string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U]; <U>(this: [string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U]; <U>(this: [string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: string, index: number, array: string[]) => U): U[]; <U>(callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): U[]; }
|
||||
>map : <U>(callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[]
|
||||
|
||||
function () { });
|
||||
>function () { } : (this: void) => void
|
||||
>function () { } : () => void
|
||||
|
||||
|
||||
@@ -12,9 +12,9 @@ function map<T, U>(items: T[], f: (x: T) => U): U[]{
|
||||
>U : Symbol(U, Decl(contextualSignatureInstantiation3.ts, 0, 15))
|
||||
|
||||
return items.map(f);
|
||||
>items.map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>items.map : Symbol(Array.map, Decl(lib.d.ts, --, --))
|
||||
>items : Symbol(items, Decl(contextualSignatureInstantiation3.ts, 0, 19))
|
||||
>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>map : Symbol(Array.map, Decl(lib.d.ts, --, --))
|
||||
>f : Symbol(f, Decl(contextualSignatureInstantiation3.ts, 0, 30))
|
||||
}
|
||||
|
||||
@@ -47,9 +47,9 @@ var v1: number[];
|
||||
|
||||
var v1 = xs.map(identity); // Error if not number[]
|
||||
>v1 : Symbol(v1, Decl(contextualSignatureInstantiation3.ts, 15, 3), Decl(contextualSignatureInstantiation3.ts, 16, 3), Decl(contextualSignatureInstantiation3.ts, 17, 3))
|
||||
>xs.map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>xs.map : Symbol(Array.map, Decl(lib.d.ts, --, --))
|
||||
>xs : Symbol(xs, Decl(contextualSignatureInstantiation3.ts, 12, 3))
|
||||
>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>map : Symbol(Array.map, Decl(lib.d.ts, --, --))
|
||||
>identity : Symbol(identity, Decl(contextualSignatureInstantiation3.ts, 2, 1))
|
||||
|
||||
var v1 = map(xs, identity); // Error if not number[]
|
||||
@@ -63,9 +63,9 @@ var v2: number[][];
|
||||
|
||||
var v2 = xs.map(singleton); // Error if not number[][]
|
||||
>v2 : Symbol(v2, Decl(contextualSignatureInstantiation3.ts, 19, 3), Decl(contextualSignatureInstantiation3.ts, 20, 3), Decl(contextualSignatureInstantiation3.ts, 21, 3))
|
||||
>xs.map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>xs.map : Symbol(Array.map, Decl(lib.d.ts, --, --))
|
||||
>xs : Symbol(xs, Decl(contextualSignatureInstantiation3.ts, 12, 3))
|
||||
>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>map : Symbol(Array.map, Decl(lib.d.ts, --, --))
|
||||
>singleton : Symbol(singleton, Decl(contextualSignatureInstantiation3.ts, 6, 1))
|
||||
|
||||
var v2 = map(xs, singleton); // Error if not number[][]
|
||||
|
||||
@@ -13,9 +13,9 @@ function map<T, U>(items: T[], f: (x: T) => U): U[]{
|
||||
|
||||
return items.map(f);
|
||||
>items.map(f) : U[]
|
||||
>items.map : { <U>(this: [T, T, T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U): [U, U, U, U, U]; <U>(this: [T, T, T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [T, T, T, T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [T, T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U): [U, U, U, U]; <U>(this: [T, T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [T, T, T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U): [U, U, U]; <U>(this: [T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [T, T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U, U]; <U>(this: [T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U): [U, U]; <U>(this: [T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: T, index: number, array: T[]) => U): U[]; <U>(callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): U[]; }
|
||||
>items.map : <U>(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any) => U[]
|
||||
>items : T[]
|
||||
>map : { <U>(this: [T, T, T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U): [U, U, U, U, U]; <U>(this: [T, T, T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [T, T, T, T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [T, T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U): [U, U, U, U]; <U>(this: [T, T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [T, T, T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U): [U, U, U]; <U>(this: [T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [T, T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U, U]; <U>(this: [T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U): [U, U]; <U>(this: [T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: T, index: number, array: T[]) => U): U[]; <U>(callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): U[]; }
|
||||
>map : <U>(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any) => U[]
|
||||
>f : (x: T) => U
|
||||
}
|
||||
|
||||
@@ -54,9 +54,9 @@ var v1: number[];
|
||||
var v1 = xs.map(identity); // Error if not number[]
|
||||
>v1 : number[]
|
||||
>xs.map(identity) : number[]
|
||||
>xs.map : { <U>(this: [number, number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U, U, U, U]; <U>(this: [number, number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [number, number, number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U, U, U]; <U>(this: [number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [number, number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U, U]; <U>(this: [number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U]; <U>(this: [number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U]; <U>(this: [number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: number, index: number, array: number[]) => U): U[]; <U>(callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): U[]; }
|
||||
>xs.map : <U>(callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[]
|
||||
>xs : number[]
|
||||
>map : { <U>(this: [number, number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U, U, U, U]; <U>(this: [number, number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [number, number, number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U, U, U]; <U>(this: [number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [number, number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U, U]; <U>(this: [number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U]; <U>(this: [number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U]; <U>(this: [number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: number, index: number, array: number[]) => U): U[]; <U>(callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): U[]; }
|
||||
>map : <U>(callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[]
|
||||
>identity : <T>(x: T) => T
|
||||
|
||||
var v1 = map(xs, identity); // Error if not number[]
|
||||
@@ -72,9 +72,9 @@ var v2: number[][];
|
||||
var v2 = xs.map(singleton); // Error if not number[][]
|
||||
>v2 : number[][]
|
||||
>xs.map(singleton) : number[][]
|
||||
>xs.map : { <U>(this: [number, number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U, U, U, U]; <U>(this: [number, number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [number, number, number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U, U, U]; <U>(this: [number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [number, number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U, U]; <U>(this: [number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U]; <U>(this: [number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U]; <U>(this: [number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: number, index: number, array: number[]) => U): U[]; <U>(callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): U[]; }
|
||||
>xs.map : <U>(callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[]
|
||||
>xs : number[]
|
||||
>map : { <U>(this: [number, number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U, U, U, U]; <U>(this: [number, number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [number, number, number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U, U, U]; <U>(this: [number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [number, number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U, U]; <U>(this: [number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U]; <U>(this: [number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U]; <U>(this: [number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: number, index: number, array: number[]) => U): U[]; <U>(callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): U[]; }
|
||||
>map : <U>(callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[]
|
||||
>singleton : <T>(x: T) => T[]
|
||||
|
||||
var v2 = map(xs, singleton); // Error if not number[][]
|
||||
|
||||
@@ -47,25 +47,25 @@
|
||||
// rest parameters
|
||||
((...numbers) => numbers.every(n => n > 0))(5,6,7);
|
||||
>numbers : Symbol(numbers, Decl(contextuallyTypedIife.ts, 17, 2))
|
||||
>numbers.every : Symbol(Array.every, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>numbers.every : Symbol(Array.every, Decl(lib.d.ts, --, --))
|
||||
>numbers : Symbol(numbers, Decl(contextuallyTypedIife.ts, 17, 2))
|
||||
>every : Symbol(Array.every, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>every : Symbol(Array.every, Decl(lib.d.ts, --, --))
|
||||
>n : Symbol(n, Decl(contextuallyTypedIife.ts, 17, 31))
|
||||
>n : Symbol(n, Decl(contextuallyTypedIife.ts, 17, 31))
|
||||
|
||||
((...mixed) => mixed.every(n => !!n))(5,'oops','oh no');
|
||||
>mixed : Symbol(mixed, Decl(contextuallyTypedIife.ts, 18, 2))
|
||||
>mixed.every : Symbol(Array.every, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>mixed.every : Symbol(Array.every, Decl(lib.d.ts, --, --))
|
||||
>mixed : Symbol(mixed, Decl(contextuallyTypedIife.ts, 18, 2))
|
||||
>every : Symbol(Array.every, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>every : Symbol(Array.every, Decl(lib.d.ts, --, --))
|
||||
>n : Symbol(n, Decl(contextuallyTypedIife.ts, 18, 27))
|
||||
>n : Symbol(n, Decl(contextuallyTypedIife.ts, 18, 27))
|
||||
|
||||
((...noNumbers) => noNumbers.some(n => n > 0))();
|
||||
>noNumbers : Symbol(noNumbers, Decl(contextuallyTypedIife.ts, 19, 2))
|
||||
>noNumbers.some : Symbol(Array.some, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>noNumbers.some : Symbol(Array.some, Decl(lib.d.ts, --, --))
|
||||
>noNumbers : Symbol(noNumbers, Decl(contextuallyTypedIife.ts, 19, 2))
|
||||
>some : Symbol(Array.some, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>some : Symbol(Array.some, Decl(lib.d.ts, --, --))
|
||||
>n : Symbol(n, Decl(contextuallyTypedIife.ts, 19, 34))
|
||||
>n : Symbol(n, Decl(contextuallyTypedIife.ts, 19, 34))
|
||||
|
||||
@@ -73,9 +73,9 @@
|
||||
>first : Symbol(first, Decl(contextuallyTypedIife.ts, 20, 2))
|
||||
>rest : Symbol(rest, Decl(contextuallyTypedIife.ts, 20, 8))
|
||||
>first : Symbol(first, Decl(contextuallyTypedIife.ts, 20, 2))
|
||||
>rest.map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>rest.map : Symbol(Array.map, Decl(lib.d.ts, --, --))
|
||||
>rest : Symbol(rest, Decl(contextuallyTypedIife.ts, 20, 8))
|
||||
>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>map : Symbol(Array.map, Decl(lib.d.ts, --, --))
|
||||
>n : Symbol(n, Decl(contextuallyTypedIife.ts, 20, 43))
|
||||
>n : Symbol(n, Decl(contextuallyTypedIife.ts, 20, 43))
|
||||
|
||||
|
||||
@@ -105,10 +105,10 @@
|
||||
>(...numbers) => numbers.every(n => n > 0) : (...numbers: number[]) => boolean
|
||||
>numbers : number[]
|
||||
>numbers.every(n => n > 0) : boolean
|
||||
>numbers.every : { (callbackfn: (this: void, value: number, index: number, array: number[]) => boolean): boolean; (callbackfn: (this: void, value: number, index: number, array: number[]) => boolean, thisArg: undefined): boolean; <Z>(callbackfn: (this: Z, value: number, index: number, array: number[]) => boolean, thisArg: Z): boolean; }
|
||||
>numbers.every : (callbackfn: (value: number, index: number, array: number[]) => boolean, thisArg?: any) => boolean
|
||||
>numbers : number[]
|
||||
>every : { (callbackfn: (this: void, value: number, index: number, array: number[]) => boolean): boolean; (callbackfn: (this: void, value: number, index: number, array: number[]) => boolean, thisArg: undefined): boolean; <Z>(callbackfn: (this: Z, value: number, index: number, array: number[]) => boolean, thisArg: Z): boolean; }
|
||||
>n => n > 0 : (this: void, n: number) => boolean
|
||||
>every : (callbackfn: (value: number, index: number, array: number[]) => boolean, thisArg?: any) => boolean
|
||||
>n => n > 0 : (n: number) => boolean
|
||||
>n : number
|
||||
>n > 0 : boolean
|
||||
>n : number
|
||||
@@ -123,10 +123,10 @@
|
||||
>(...mixed) => mixed.every(n => !!n) : (...mixed: (string | number)[]) => boolean
|
||||
>mixed : (string | number)[]
|
||||
>mixed.every(n => !!n) : boolean
|
||||
>mixed.every : { (callbackfn: (this: void, value: string | number, index: number, array: (string | number)[]) => boolean): boolean; (callbackfn: (this: void, value: string | number, index: number, array: (string | number)[]) => boolean, thisArg: undefined): boolean; <Z>(callbackfn: (this: Z, value: string | number, index: number, array: (string | number)[]) => boolean, thisArg: Z): boolean; }
|
||||
>mixed.every : (callbackfn: (value: string | number, index: number, array: (string | number)[]) => boolean, thisArg?: any) => boolean
|
||||
>mixed : (string | number)[]
|
||||
>every : { (callbackfn: (this: void, value: string | number, index: number, array: (string | number)[]) => boolean): boolean; (callbackfn: (this: void, value: string | number, index: number, array: (string | number)[]) => boolean, thisArg: undefined): boolean; <Z>(callbackfn: (this: Z, value: string | number, index: number, array: (string | number)[]) => boolean, thisArg: Z): boolean; }
|
||||
>n => !!n : (this: void, n: string | number) => boolean
|
||||
>every : (callbackfn: (value: string | number, index: number, array: (string | number)[]) => boolean, thisArg?: any) => boolean
|
||||
>n => !!n : (n: string | number) => boolean
|
||||
>n : string | number
|
||||
>!!n : boolean
|
||||
>!n : boolean
|
||||
@@ -141,10 +141,10 @@
|
||||
>(...noNumbers) => noNumbers.some(n => n > 0) : (...noNumbers: any[]) => boolean
|
||||
>noNumbers : any[]
|
||||
>noNumbers.some(n => n > 0) : boolean
|
||||
>noNumbers.some : { (callbackfn: (this: void, value: any, index: number, array: any[]) => boolean): boolean; (callbackfn: (this: void, value: any, index: number, array: any[]) => boolean, thisArg: undefined): boolean; <Z>(callbackfn: (this: Z, value: any, index: number, array: any[]) => boolean, thisArg: Z): boolean; }
|
||||
>noNumbers.some : (callbackfn: (value: any, index: number, array: any[]) => boolean, thisArg?: any) => boolean
|
||||
>noNumbers : any[]
|
||||
>some : { (callbackfn: (this: void, value: any, index: number, array: any[]) => boolean): boolean; (callbackfn: (this: void, value: any, index: number, array: any[]) => boolean, thisArg: undefined): boolean; <Z>(callbackfn: (this: Z, value: any, index: number, array: any[]) => boolean, thisArg: Z): boolean; }
|
||||
>n => n > 0 : (this: void, n: any) => boolean
|
||||
>some : (callbackfn: (value: any, index: number, array: any[]) => boolean, thisArg?: any) => boolean
|
||||
>n => n > 0 : (n: any) => boolean
|
||||
>n : any
|
||||
>n > 0 : boolean
|
||||
>n : any
|
||||
@@ -160,10 +160,10 @@
|
||||
>first : number
|
||||
>[] : undefined[]
|
||||
>rest.map(n => n > 0) : boolean[]
|
||||
>rest.map : { <U>(this: [number, number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U, U, U, U]; <U>(this: [number, number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [number, number, number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U, U, U]; <U>(this: [number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [number, number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U, U]; <U>(this: [number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U]; <U>(this: [number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U]; <U>(this: [number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: number, index: number, array: number[]) => U): U[]; <U>(callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): U[]; }
|
||||
>rest.map : <U>(callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[]
|
||||
>rest : number[]
|
||||
>map : { <U>(this: [number, number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U, U, U, U]; <U>(this: [number, number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [number, number, number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U, U, U]; <U>(this: [number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [number, number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U, U]; <U>(this: [number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U]; <U>(this: [number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U]; <U>(this: [number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: number, index: number, array: number[]) => U): U[]; <U>(callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): U[]; }
|
||||
>n => n > 0 : (this: void, n: number) => boolean
|
||||
>map : <U>(callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[]
|
||||
>n => n > 0 : (n: number) => boolean
|
||||
>n : number
|
||||
>n > 0 : boolean
|
||||
>n : number
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
|
||||
[{ x: 1 }].map(
|
||||
>[{ x: 1 }].map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>[{ x: 1 }].map : Symbol(Array.map, Decl(lib.d.ts, --, --))
|
||||
>x : Symbol(x, Decl(controlFlowDestructuringParameters.ts, 3, 2))
|
||||
>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>map : Symbol(Array.map, Decl(lib.d.ts, --, --))
|
||||
|
||||
({ x }) => x
|
||||
>x : Symbol(x, Decl(controlFlowDestructuringParameters.ts, 4, 4))
|
||||
|
||||
@@ -4,15 +4,15 @@
|
||||
|
||||
[{ x: 1 }].map(
|
||||
>[{ x: 1 }].map( ({ x }) => x) : number[]
|
||||
>[{ x: 1 }].map : { <U>(this: [{ x: number; }, { x: number; }, { x: number; }, { x: number; }, { x: number; }], callbackfn: (this: void, value: { x: number; }, index: number, array: { x: number; }[]) => U): [U, U, U, U, U]; <U>(this: [{ x: number; }, { x: number; }, { x: number; }, { x: number; }, { x: number; }], callbackfn: (this: void, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [{ x: number; }, { x: number; }, { x: number; }, { x: number; }, { x: number; }], callbackfn: (this: Z, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [{ x: number; }, { x: number; }, { x: number; }, { x: number; }], callbackfn: (this: void, value: { x: number; }, index: number, array: { x: number; }[]) => U): [U, U, U, U]; <U>(this: [{ x: number; }, { x: number; }, { x: number; }, { x: number; }], callbackfn: (this: void, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [{ x: number; }, { x: number; }, { x: number; }, { x: number; }], callbackfn: (this: Z, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [{ x: number; }, { x: number; }, { x: number; }], callbackfn: (this: void, value: { x: number; }, index: number, array: { x: number; }[]) => U): [U, U, U]; <U>(this: [{ x: number; }, { x: number; }, { x: number; }], callbackfn: (this: void, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [{ x: number; }, { x: number; }, { x: number; }], callbackfn: (this: Z, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: Z): [U, U, U]; <U>(this: [{ x: number; }, { x: number; }], callbackfn: (this: void, value: { x: number; }, index: number, array: { x: number; }[]) => U): [U, U]; <U>(this: [{ x: number; }, { x: number; }], callbackfn: (this: void, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [{ x: number; }, { x: number; }], callbackfn: (this: Z, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: { x: number; }, index: number, array: { x: number; }[]) => U): U[]; <U>(callbackfn: (this: void, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: Z): U[]; }
|
||||
>[{ x: 1 }].map : <U>(callbackfn: (value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg?: any) => U[]
|
||||
>[{ x: 1 }] : { x: number; }[]
|
||||
>{ x: 1 } : { x: number; }
|
||||
>x : number
|
||||
>1 : 1
|
||||
>map : { <U>(this: [{ x: number; }, { x: number; }, { x: number; }, { x: number; }, { x: number; }], callbackfn: (this: void, value: { x: number; }, index: number, array: { x: number; }[]) => U): [U, U, U, U, U]; <U>(this: [{ x: number; }, { x: number; }, { x: number; }, { x: number; }, { x: number; }], callbackfn: (this: void, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [{ x: number; }, { x: number; }, { x: number; }, { x: number; }, { x: number; }], callbackfn: (this: Z, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [{ x: number; }, { x: number; }, { x: number; }, { x: number; }], callbackfn: (this: void, value: { x: number; }, index: number, array: { x: number; }[]) => U): [U, U, U, U]; <U>(this: [{ x: number; }, { x: number; }, { x: number; }, { x: number; }], callbackfn: (this: void, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [{ x: number; }, { x: number; }, { x: number; }, { x: number; }], callbackfn: (this: Z, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [{ x: number; }, { x: number; }, { x: number; }], callbackfn: (this: void, value: { x: number; }, index: number, array: { x: number; }[]) => U): [U, U, U]; <U>(this: [{ x: number; }, { x: number; }, { x: number; }], callbackfn: (this: void, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [{ x: number; }, { x: number; }, { x: number; }], callbackfn: (this: Z, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: Z): [U, U, U]; <U>(this: [{ x: number; }, { x: number; }], callbackfn: (this: void, value: { x: number; }, index: number, array: { x: number; }[]) => U): [U, U]; <U>(this: [{ x: number; }, { x: number; }], callbackfn: (this: void, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [{ x: number; }, { x: number; }], callbackfn: (this: Z, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: { x: number; }, index: number, array: { x: number; }[]) => U): U[]; <U>(callbackfn: (this: void, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: Z): U[]; }
|
||||
>map : <U>(callbackfn: (value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg?: any) => U[]
|
||||
|
||||
({ x }) => x
|
||||
>({ x }) => x : (this: void, { x }: { x: number; }) => number
|
||||
>({ x }) => x : ({ x }: { x: number; }) => number
|
||||
>x : number
|
||||
>x : number
|
||||
|
||||
|
||||
@@ -247,7 +247,7 @@ function goo(x: X) {
|
||||
|
||||
x.y;
|
||||
>x.y : string
|
||||
>x : Y
|
||||
>x : X & Y
|
||||
>y : string
|
||||
}
|
||||
x;
|
||||
|
||||
@@ -11,17 +11,17 @@ let buttonProps; // any
|
||||
|
||||
let k = <button {...buttonProps}>
|
||||
>k : Symbol(k, Decl(0.tsx, 5, 3))
|
||||
>button : Symbol(JSX.IntrinsicElements.button, Decl(react.d.ts, 2385, 43))
|
||||
>button : Symbol(JSX.IntrinsicElements.button, Decl(react.d.ts, 2386, 43))
|
||||
>buttonProps : Symbol(buttonProps, Decl(0.tsx, 4, 3))
|
||||
|
||||
<span className={cx('class1', { class2: true })} />
|
||||
>span : Symbol(JSX.IntrinsicElements.span, Decl(react.d.ts, 2460, 51))
|
||||
>span : Symbol(JSX.IntrinsicElements.span, Decl(react.d.ts, 2461, 51))
|
||||
>className : Symbol(className, Decl(0.tsx, 6, 17))
|
||||
>cx : Symbol(cx, Decl(0.tsx, 1, 6))
|
||||
>class2 : Symbol(class2, Decl(0.tsx, 6, 43))
|
||||
|
||||
</button>;
|
||||
>button : Symbol(JSX.IntrinsicElements.button, Decl(react.d.ts, 2385, 43))
|
||||
>button : Symbol(JSX.IntrinsicElements.button, Decl(react.d.ts, 2386, 43))
|
||||
|
||||
=== tests/cases/conformance/jsx/declaration.d.ts ===
|
||||
declare module "classnames";
|
||||
|
||||
@@ -12,17 +12,17 @@ let buttonProps : {[attributeName: string]: ''}
|
||||
|
||||
let k = <button {...buttonProps}>
|
||||
>k : Symbol(k, Decl(0.tsx, 5, 3))
|
||||
>button : Symbol(JSX.IntrinsicElements.button, Decl(react.d.ts, 2385, 43))
|
||||
>button : Symbol(JSX.IntrinsicElements.button, Decl(react.d.ts, 2386, 43))
|
||||
>buttonProps : Symbol(buttonProps, Decl(0.tsx, 4, 3))
|
||||
|
||||
<span className={cx('class1', { class2: true })} />
|
||||
>span : Symbol(JSX.IntrinsicElements.span, Decl(react.d.ts, 2460, 51))
|
||||
>span : Symbol(JSX.IntrinsicElements.span, Decl(react.d.ts, 2461, 51))
|
||||
>className : Symbol(className, Decl(0.tsx, 6, 17))
|
||||
>cx : Symbol(cx, Decl(0.tsx, 1, 6))
|
||||
>class2 : Symbol(class2, Decl(0.tsx, 6, 43))
|
||||
|
||||
</button>;
|
||||
>button : Symbol(JSX.IntrinsicElements.button, Decl(react.d.ts, 2385, 43))
|
||||
>button : Symbol(JSX.IntrinsicElements.button, Decl(react.d.ts, 2386, 43))
|
||||
|
||||
=== tests/cases/conformance/jsx/declaration.d.ts ===
|
||||
declare module "classnames";
|
||||
|
||||
@@ -11,17 +11,17 @@ let buttonProps;
|
||||
|
||||
let k = <button {...buttonProps}>
|
||||
>k : Symbol(k, Decl(0.tsx, 5, 3))
|
||||
>button : Symbol(JSX.IntrinsicElements.button, Decl(react.d.ts, 2385, 43))
|
||||
>button : Symbol(JSX.IntrinsicElements.button, Decl(react.d.ts, 2386, 43))
|
||||
>buttonProps : Symbol(buttonProps, Decl(0.tsx, 4, 3))
|
||||
|
||||
<span className={cx('class1', { class2: true })} />
|
||||
>span : Symbol(JSX.IntrinsicElements.span, Decl(react.d.ts, 2460, 51))
|
||||
>span : Symbol(JSX.IntrinsicElements.span, Decl(react.d.ts, 2461, 51))
|
||||
>className : Symbol(className, Decl(0.tsx, 6, 17))
|
||||
>cx : Symbol(cx, Decl(0.tsx, 1, 6))
|
||||
>class2 : Symbol(class2, Decl(0.tsx, 6, 43))
|
||||
|
||||
</button>;
|
||||
>button : Symbol(JSX.IntrinsicElements.button, Decl(react.d.ts, 2385, 43))
|
||||
>button : Symbol(JSX.IntrinsicElements.button, Decl(react.d.ts, 2386, 43))
|
||||
|
||||
=== tests/cases/conformance/jsx/declaration.d.ts ===
|
||||
declare module "classnames";
|
||||
|
||||
@@ -12,7 +12,7 @@ let buttonProps : {[attributeName: string]: ''}
|
||||
|
||||
let k = <button {...buttonProps} className={cx('class1', { class2: true })} />;
|
||||
>k : Symbol(k, Decl(0.tsx, 5, 3))
|
||||
>button : Symbol(JSX.IntrinsicElements.button, Decl(react.d.ts, 2385, 43))
|
||||
>button : Symbol(JSX.IntrinsicElements.button, Decl(react.d.ts, 2386, 43))
|
||||
>buttonProps : Symbol(buttonProps, Decl(0.tsx, 4, 3))
|
||||
>className : Symbol(className, Decl(0.tsx, 5, 32))
|
||||
>cx : Symbol(cx, Decl(0.tsx, 1, 6))
|
||||
|
||||
@@ -39,13 +39,13 @@ export async function runSampleWorks<A, B, C, D, E>(
|
||||
>bluebird.all : Symbol(bluebird.all, Decl(declarationEmitPromise.ts, 0, 26))
|
||||
>bluebird : Symbol(bluebird, Decl(declarationEmitPromise.ts, 0, 0))
|
||||
>all : Symbol(bluebird.all, Decl(declarationEmitPromise.ts, 0, 26))
|
||||
>[a, b, c, d, e].filter : Symbol(Array.filter, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
|
||||
>[a, b, c, d, e].filter : Symbol(Array.filter, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
|
||||
>a : Symbol(a, Decl(declarationEmitPromise.ts, 4, 52))
|
||||
>b : Symbol(b, Decl(declarationEmitPromise.ts, 5, 19))
|
||||
>c : Symbol(c, Decl(declarationEmitPromise.ts, 5, 36))
|
||||
>d : Symbol(d, Decl(declarationEmitPromise.ts, 5, 53))
|
||||
>e : Symbol(e, Decl(declarationEmitPromise.ts, 5, 70))
|
||||
>filter : Symbol(Array.filter, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
|
||||
>filter : Symbol(Array.filter, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
|
||||
>el : Symbol(el, Decl(declarationEmitPromise.ts, 6, 68))
|
||||
>el : Symbol(el, Decl(declarationEmitPromise.ts, 6, 68))
|
||||
|
||||
@@ -111,13 +111,13 @@ export async function runSampleBreaks<A, B, C, D, E>(
|
||||
>bluebird.all : Symbol(bluebird.all, Decl(declarationEmitPromise.ts, 0, 26))
|
||||
>bluebird : Symbol(bluebird, Decl(declarationEmitPromise.ts, 0, 0))
|
||||
>all : Symbol(bluebird.all, Decl(declarationEmitPromise.ts, 0, 26))
|
||||
>[a, b, c, d, e].filter : Symbol(Array.filter, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
|
||||
>[a, b, c, d, e].filter : Symbol(Array.filter, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
|
||||
>a : Symbol(a, Decl(declarationEmitPromise.ts, 13, 53))
|
||||
>b : Symbol(b, Decl(declarationEmitPromise.ts, 14, 19))
|
||||
>c : Symbol(c, Decl(declarationEmitPromise.ts, 14, 36))
|
||||
>d : Symbol(d, Decl(declarationEmitPromise.ts, 14, 53))
|
||||
>e : Symbol(e, Decl(declarationEmitPromise.ts, 14, 70))
|
||||
>filter : Symbol(Array.filter, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
|
||||
>filter : Symbol(Array.filter, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
|
||||
>el : Symbol(el, Decl(declarationEmitPromise.ts, 15, 68))
|
||||
>el : Symbol(el, Decl(declarationEmitPromise.ts, 15, 68))
|
||||
|
||||
|
||||
@@ -44,15 +44,15 @@ export async function runSampleWorks<A, B, C, D, E>(
|
||||
>bluebird : typeof bluebird
|
||||
>all : bluebird<any>[]
|
||||
>[a, b, c, d, e].filter(el => !!el) : bluebird<A>[]
|
||||
>[a, b, c, d, e].filter : { (callbackfn: (this: void, value: bluebird<A>, index: number, array: bluebird<A>[]) => any): bluebird<A>[]; (callbackfn: (this: void, value: bluebird<A>, index: number, array: bluebird<A>[]) => any, thisArg: undefined): bluebird<A>[]; <Z>(callbackfn: (this: Z, value: bluebird<A>, index: number, array: bluebird<A>[]) => any, thisArg: Z): bluebird<A>[]; }
|
||||
>[a, b, c, d, e].filter : { <S extends bluebird<A>>(callbackfn: (value: bluebird<A>, index: number, array: bluebird<A>[]) => value is S, thisArg?: any): S[]; (callbackfn: (value: bluebird<A>, index: number, array: bluebird<A>[]) => any, thisArg?: any): bluebird<A>[]; }
|
||||
>[a, b, c, d, e] : bluebird<A>[]
|
||||
>a : bluebird<A>
|
||||
>b : bluebird<B>
|
||||
>c : bluebird<C>
|
||||
>d : bluebird<D>
|
||||
>e : bluebird<E>
|
||||
>filter : { (callbackfn: (this: void, value: bluebird<A>, index: number, array: bluebird<A>[]) => any): bluebird<A>[]; (callbackfn: (this: void, value: bluebird<A>, index: number, array: bluebird<A>[]) => any, thisArg: undefined): bluebird<A>[]; <Z>(callbackfn: (this: Z, value: bluebird<A>, index: number, array: bluebird<A>[]) => any, thisArg: Z): bluebird<A>[]; }
|
||||
>el => !!el : (this: void, el: bluebird<A>) => boolean
|
||||
>filter : { <S extends bluebird<A>>(callbackfn: (value: bluebird<A>, index: number, array: bluebird<A>[]) => value is S, thisArg?: any): S[]; (callbackfn: (value: bluebird<A>, index: number, array: bluebird<A>[]) => any, thisArg?: any): bluebird<A>[]; }
|
||||
>el => !!el : (el: bluebird<A>) => boolean
|
||||
>el : bluebird<A>
|
||||
>!!el : boolean
|
||||
>!el : boolean
|
||||
@@ -129,15 +129,15 @@ export async function runSampleBreaks<A, B, C, D, E>(
|
||||
>bluebird : typeof bluebird
|
||||
>all : bluebird<any>[]
|
||||
>[a, b, c, d, e].filter(el => !!el) : bluebird<A>[]
|
||||
>[a, b, c, d, e].filter : { (callbackfn: (this: void, value: bluebird<A>, index: number, array: bluebird<A>[]) => any): bluebird<A>[]; (callbackfn: (this: void, value: bluebird<A>, index: number, array: bluebird<A>[]) => any, thisArg: undefined): bluebird<A>[]; <Z>(callbackfn: (this: Z, value: bluebird<A>, index: number, array: bluebird<A>[]) => any, thisArg: Z): bluebird<A>[]; }
|
||||
>[a, b, c, d, e].filter : { <S extends bluebird<A>>(callbackfn: (value: bluebird<A>, index: number, array: bluebird<A>[]) => value is S, thisArg?: any): S[]; (callbackfn: (value: bluebird<A>, index: number, array: bluebird<A>[]) => any, thisArg?: any): bluebird<A>[]; }
|
||||
>[a, b, c, d, e] : bluebird<A>[]
|
||||
>a : bluebird<A>
|
||||
>b : bluebird<B>
|
||||
>c : bluebird<C>
|
||||
>d : bluebird<D>
|
||||
>e : bluebird<E>
|
||||
>filter : { (callbackfn: (this: void, value: bluebird<A>, index: number, array: bluebird<A>[]) => any): bluebird<A>[]; (callbackfn: (this: void, value: bluebird<A>, index: number, array: bluebird<A>[]) => any, thisArg: undefined): bluebird<A>[]; <Z>(callbackfn: (this: Z, value: bluebird<A>, index: number, array: bluebird<A>[]) => any, thisArg: Z): bluebird<A>[]; }
|
||||
>el => !!el : (this: void, el: bluebird<A>) => boolean
|
||||
>filter : { <S extends bluebird<A>>(callbackfn: (value: bluebird<A>, index: number, array: bluebird<A>[]) => value is S, thisArg?: any): S[]; (callbackfn: (value: bluebird<A>, index: number, array: bluebird<A>[]) => any, thisArg?: any): bluebird<A>[]; }
|
||||
>el => !!el : (el: bluebird<A>) => boolean
|
||||
>el : bluebird<A>
|
||||
>!!el : boolean
|
||||
>!el : boolean
|
||||
|
||||
@@ -19,9 +19,9 @@ var enumValue = MyEnumType.foo;
|
||||
|
||||
var x = _arr.map(o => MyEnumType[o.key] === enumValue); // these are not same type
|
||||
>x : Symbol(x, Decl(enumIndexer.ts, 5, 3))
|
||||
>_arr.map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>_arr.map : Symbol(Array.map, Decl(lib.d.ts, --, --))
|
||||
>_arr : Symbol(_arr, Decl(enumIndexer.ts, 3, 3))
|
||||
>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>map : Symbol(Array.map, Decl(lib.d.ts, --, --))
|
||||
>o : Symbol(o, Decl(enumIndexer.ts, 5, 17))
|
||||
>MyEnumType : Symbol(MyEnumType, Decl(enumIndexer.ts, 0, 0))
|
||||
>o.key : Symbol(key, Decl(enumIndexer.ts, 3, 13))
|
||||
|
||||
@@ -25,10 +25,10 @@ var enumValue = MyEnumType.foo;
|
||||
var x = _arr.map(o => MyEnumType[o.key] === enumValue); // these are not same type
|
||||
>x : boolean[]
|
||||
>_arr.map(o => MyEnumType[o.key] === enumValue) : boolean[]
|
||||
>_arr.map : { <U>(this: [{ key: string; }, { key: string; }, { key: string; }, { key: string; }, { key: string; }], callbackfn: (this: void, value: { key: string; }, index: number, array: { key: string; }[]) => U): [U, U, U, U, U]; <U>(this: [{ key: string; }, { key: string; }, { key: string; }, { key: string; }, { key: string; }], callbackfn: (this: void, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [{ key: string; }, { key: string; }, { key: string; }, { key: string; }, { key: string; }], callbackfn: (this: Z, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [{ key: string; }, { key: string; }, { key: string; }, { key: string; }], callbackfn: (this: void, value: { key: string; }, index: number, array: { key: string; }[]) => U): [U, U, U, U]; <U>(this: [{ key: string; }, { key: string; }, { key: string; }, { key: string; }], callbackfn: (this: void, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [{ key: string; }, { key: string; }, { key: string; }, { key: string; }], callbackfn: (this: Z, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [{ key: string; }, { key: string; }, { key: string; }], callbackfn: (this: void, value: { key: string; }, index: number, array: { key: string; }[]) => U): [U, U, U]; <U>(this: [{ key: string; }, { key: string; }, { key: string; }], callbackfn: (this: void, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [{ key: string; }, { key: string; }, { key: string; }], callbackfn: (this: Z, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: Z): [U, U, U]; <U>(this: [{ key: string; }, { key: string; }], callbackfn: (this: void, value: { key: string; }, index: number, array: { key: string; }[]) => U): [U, U]; <U>(this: [{ key: string; }, { key: string; }], callbackfn: (this: void, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [{ key: string; }, { key: string; }], callbackfn: (this: Z, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: { key: string; }, index: number, array: { key: string; }[]) => U): U[]; <U>(callbackfn: (this: void, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: Z): U[]; }
|
||||
>_arr.map : <U>(callbackfn: (value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg?: any) => U[]
|
||||
>_arr : { key: string; }[]
|
||||
>map : { <U>(this: [{ key: string; }, { key: string; }, { key: string; }, { key: string; }, { key: string; }], callbackfn: (this: void, value: { key: string; }, index: number, array: { key: string; }[]) => U): [U, U, U, U, U]; <U>(this: [{ key: string; }, { key: string; }, { key: string; }, { key: string; }, { key: string; }], callbackfn: (this: void, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [{ key: string; }, { key: string; }, { key: string; }, { key: string; }, { key: string; }], callbackfn: (this: Z, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [{ key: string; }, { key: string; }, { key: string; }, { key: string; }], callbackfn: (this: void, value: { key: string; }, index: number, array: { key: string; }[]) => U): [U, U, U, U]; <U>(this: [{ key: string; }, { key: string; }, { key: string; }, { key: string; }], callbackfn: (this: void, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [{ key: string; }, { key: string; }, { key: string; }, { key: string; }], callbackfn: (this: Z, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [{ key: string; }, { key: string; }, { key: string; }], callbackfn: (this: void, value: { key: string; }, index: number, array: { key: string; }[]) => U): [U, U, U]; <U>(this: [{ key: string; }, { key: string; }, { key: string; }], callbackfn: (this: void, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [{ key: string; }, { key: string; }, { key: string; }], callbackfn: (this: Z, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: Z): [U, U, U]; <U>(this: [{ key: string; }, { key: string; }], callbackfn: (this: void, value: { key: string; }, index: number, array: { key: string; }[]) => U): [U, U]; <U>(this: [{ key: string; }, { key: string; }], callbackfn: (this: void, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [{ key: string; }, { key: string; }], callbackfn: (this: Z, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: { key: string; }, index: number, array: { key: string; }[]) => U): U[]; <U>(callbackfn: (this: void, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: Z): U[]; }
|
||||
>o => MyEnumType[o.key] === enumValue : (this: void, o: { key: string; }) => boolean
|
||||
>map : <U>(callbackfn: (value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg?: any) => U[]
|
||||
>o => MyEnumType[o.key] === enumValue : (o: { key: string; }) => boolean
|
||||
>o : { key: string; }
|
||||
>MyEnumType[o.key] === enumValue : boolean
|
||||
>MyEnumType[o.key] : any
|
||||
|
||||
@@ -13,8 +13,8 @@ interface String{
|
||||
|
||||
var lengths = ["a", "b", "c"].map(x => x.length);
|
||||
>lengths : Symbol(lengths, Decl(genericArray1.ts, 12, 3))
|
||||
>["a", "b", "c"].map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>["a", "b", "c"].map : Symbol(Array.map, Decl(lib.d.ts, --, --))
|
||||
>map : Symbol(Array.map, Decl(lib.d.ts, --, --))
|
||||
>x : Symbol(x, Decl(genericArray1.ts, 12, 34))
|
||||
>x.length : Symbol(String.length, Decl(lib.d.ts, --, --))
|
||||
>x : Symbol(x, Decl(genericArray1.ts, 12, 34))
|
||||
|
||||
@@ -14,13 +14,13 @@ interface String{
|
||||
var lengths = ["a", "b", "c"].map(x => x.length);
|
||||
>lengths : number[]
|
||||
>["a", "b", "c"].map(x => x.length) : number[]
|
||||
>["a", "b", "c"].map : { <U>(this: [string, string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U, U, U]; <U>(this: [string, string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [string, string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U]; <U>(this: [string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U]; <U>(this: [string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U]; <U>(this: [string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: string, index: number, array: string[]) => U): U[]; <U>(callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): U[]; }
|
||||
>["a", "b", "c"].map : <U>(callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[]
|
||||
>["a", "b", "c"] : string[]
|
||||
>"a" : "a"
|
||||
>"b" : "b"
|
||||
>"c" : "c"
|
||||
>map : { <U>(this: [string, string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U, U, U]; <U>(this: [string, string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [string, string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U]; <U>(this: [string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U]; <U>(this: [string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U]; <U>(this: [string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: string, index: number, array: string[]) => U): U[]; <U>(callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): U[]; }
|
||||
>x => x.length : (this: void, x: string) => number
|
||||
>map : <U>(callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[]
|
||||
>x => x.length : (x: string) => number
|
||||
>x : string
|
||||
>x.length : number
|
||||
>x : string
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
=== tests/cases/compiler/genericInference1.ts ===
|
||||
['a', 'b', 'c'].map(x => x.length);
|
||||
>['a', 'b', 'c'].map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>['a', 'b', 'c'].map : Symbol(Array.map, Decl(lib.d.ts, --, --))
|
||||
>map : Symbol(Array.map, Decl(lib.d.ts, --, --))
|
||||
>x : Symbol(x, Decl(genericInference1.ts, 0, 20))
|
||||
>x.length : Symbol(String.length, Decl(lib.d.ts, --, --))
|
||||
>x : Symbol(x, Decl(genericInference1.ts, 0, 20))
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
=== tests/cases/compiler/genericInference1.ts ===
|
||||
['a', 'b', 'c'].map(x => x.length);
|
||||
>['a', 'b', 'c'].map(x => x.length) : number[]
|
||||
>['a', 'b', 'c'].map : { <U>(this: [string, string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U, U, U]; <U>(this: [string, string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [string, string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U]; <U>(this: [string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U]; <U>(this: [string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U]; <U>(this: [string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: string, index: number, array: string[]) => U): U[]; <U>(callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): U[]; }
|
||||
>['a', 'b', 'c'].map : <U>(callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[]
|
||||
>['a', 'b', 'c'] : string[]
|
||||
>'a' : "a"
|
||||
>'b' : "b"
|
||||
>'c' : "c"
|
||||
>map : { <U>(this: [string, string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U, U, U]; <U>(this: [string, string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [string, string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U]; <U>(this: [string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U]; <U>(this: [string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U]; <U>(this: [string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: string, index: number, array: string[]) => U): U[]; <U>(callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): U[]; }
|
||||
>x => x.length : (this: void, x: string) => number
|
||||
>map : <U>(callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[]
|
||||
>x => x.length : (x: string) => number
|
||||
>x : string
|
||||
>x.length : number
|
||||
>x : string
|
||||
|
||||
@@ -27,9 +27,9 @@ interface Document {
|
||||
|
||||
var elements = names.map(function (name) {
|
||||
>elements : Symbol(elements, Decl(genericMethodOverspecialization.ts, 12, 3))
|
||||
>names.map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>names.map : Symbol(Array.map, Decl(lib.d.ts, --, --))
|
||||
>names : Symbol(names, Decl(genericMethodOverspecialization.ts, 0, 3))
|
||||
>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>map : Symbol(Array.map, Decl(lib.d.ts, --, --))
|
||||
>name : Symbol(name, Decl(genericMethodOverspecialization.ts, 12, 35))
|
||||
|
||||
return document.getElementById(name);
|
||||
@@ -43,9 +43,9 @@ var elements = names.map(function (name) {
|
||||
|
||||
var xxx = elements.filter(function (e) {
|
||||
>xxx : Symbol(xxx, Decl(genericMethodOverspecialization.ts, 17, 3))
|
||||
>elements.filter : Symbol(Array.filter, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>elements.filter : Symbol(Array.filter, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>elements : Symbol(elements, Decl(genericMethodOverspecialization.ts, 12, 3))
|
||||
>filter : Symbol(Array.filter, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>filter : Symbol(Array.filter, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>e : Symbol(e, Decl(genericMethodOverspecialization.ts, 17, 36))
|
||||
|
||||
return !e.isDisabled;
|
||||
@@ -57,9 +57,9 @@ var xxx = elements.filter(function (e) {
|
||||
|
||||
var widths:number[] = elements.map(function (e) { // should not error
|
||||
>widths : Symbol(widths, Decl(genericMethodOverspecialization.ts, 21, 3))
|
||||
>elements.map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>elements.map : Symbol(Array.map, Decl(lib.d.ts, --, --))
|
||||
>elements : Symbol(elements, Decl(genericMethodOverspecialization.ts, 12, 3))
|
||||
>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>map : Symbol(Array.map, Decl(lib.d.ts, --, --))
|
||||
>e : Symbol(e, Decl(genericMethodOverspecialization.ts, 21, 45))
|
||||
|
||||
return e.clientWidth;
|
||||
|
||||
@@ -34,10 +34,10 @@ interface Document {
|
||||
var elements = names.map(function (name) {
|
||||
>elements : HTMLElement[]
|
||||
>names.map(function (name) { return document.getElementById(name);}) : HTMLElement[]
|
||||
>names.map : { <U>(this: [string, string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U, U, U]; <U>(this: [string, string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [string, string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U]; <U>(this: [string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U]; <U>(this: [string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U]; <U>(this: [string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: string, index: number, array: string[]) => U): U[]; <U>(callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): U[]; }
|
||||
>names.map : <U>(callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[]
|
||||
>names : string[]
|
||||
>map : { <U>(this: [string, string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U, U, U]; <U>(this: [string, string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [string, string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U]; <U>(this: [string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U]; <U>(this: [string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U]; <U>(this: [string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: string, index: number, array: string[]) => U): U[]; <U>(callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): U[]; }
|
||||
>function (name) { return document.getElementById(name);} : (this: void, name: string) => HTMLElement
|
||||
>map : <U>(callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[]
|
||||
>function (name) { return document.getElementById(name);} : (name: string) => HTMLElement
|
||||
>name : string
|
||||
|
||||
return document.getElementById(name);
|
||||
@@ -53,10 +53,10 @@ var elements = names.map(function (name) {
|
||||
var xxx = elements.filter(function (e) {
|
||||
>xxx : HTMLElement[]
|
||||
>elements.filter(function (e) { return !e.isDisabled;}) : HTMLElement[]
|
||||
>elements.filter : { (callbackfn: (this: void, value: HTMLElement, index: number, array: HTMLElement[]) => any): HTMLElement[]; (callbackfn: (this: void, value: HTMLElement, index: number, array: HTMLElement[]) => any, thisArg: undefined): HTMLElement[]; <Z>(callbackfn: (this: Z, value: HTMLElement, index: number, array: HTMLElement[]) => any, thisArg: Z): HTMLElement[]; }
|
||||
>elements.filter : { <S extends HTMLElement>(callbackfn: (value: HTMLElement, index: number, array: HTMLElement[]) => value is S, thisArg?: any): S[]; (callbackfn: (value: HTMLElement, index: number, array: HTMLElement[]) => any, thisArg?: any): HTMLElement[]; }
|
||||
>elements : HTMLElement[]
|
||||
>filter : { (callbackfn: (this: void, value: HTMLElement, index: number, array: HTMLElement[]) => any): HTMLElement[]; (callbackfn: (this: void, value: HTMLElement, index: number, array: HTMLElement[]) => any, thisArg: undefined): HTMLElement[]; <Z>(callbackfn: (this: Z, value: HTMLElement, index: number, array: HTMLElement[]) => any, thisArg: Z): HTMLElement[]; }
|
||||
>function (e) { return !e.isDisabled;} : (this: void, e: HTMLElement) => boolean
|
||||
>filter : { <S extends HTMLElement>(callbackfn: (value: HTMLElement, index: number, array: HTMLElement[]) => value is S, thisArg?: any): S[]; (callbackfn: (value: HTMLElement, index: number, array: HTMLElement[]) => any, thisArg?: any): HTMLElement[]; }
|
||||
>function (e) { return !e.isDisabled;} : (e: HTMLElement) => boolean
|
||||
>e : HTMLElement
|
||||
|
||||
return !e.isDisabled;
|
||||
@@ -70,10 +70,10 @@ var xxx = elements.filter(function (e) {
|
||||
var widths:number[] = elements.map(function (e) { // should not error
|
||||
>widths : number[]
|
||||
>elements.map(function (e) { // should not error return e.clientWidth;}) : number[]
|
||||
>elements.map : { <U>(this: [HTMLElement, HTMLElement, HTMLElement, HTMLElement, HTMLElement], callbackfn: (this: void, value: HTMLElement, index: number, array: HTMLElement[]) => U): [U, U, U, U, U]; <U>(this: [HTMLElement, HTMLElement, HTMLElement, HTMLElement, HTMLElement], callbackfn: (this: void, value: HTMLElement, index: number, array: HTMLElement[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [HTMLElement, HTMLElement, HTMLElement, HTMLElement, HTMLElement], callbackfn: (this: Z, value: HTMLElement, index: number, array: HTMLElement[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [HTMLElement, HTMLElement, HTMLElement, HTMLElement], callbackfn: (this: void, value: HTMLElement, index: number, array: HTMLElement[]) => U): [U, U, U, U]; <U>(this: [HTMLElement, HTMLElement, HTMLElement, HTMLElement], callbackfn: (this: void, value: HTMLElement, index: number, array: HTMLElement[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [HTMLElement, HTMLElement, HTMLElement, HTMLElement], callbackfn: (this: Z, value: HTMLElement, index: number, array: HTMLElement[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [HTMLElement, HTMLElement, HTMLElement], callbackfn: (this: void, value: HTMLElement, index: number, array: HTMLElement[]) => U): [U, U, U]; <U>(this: [HTMLElement, HTMLElement, HTMLElement], callbackfn: (this: void, value: HTMLElement, index: number, array: HTMLElement[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [HTMLElement, HTMLElement, HTMLElement], callbackfn: (this: Z, value: HTMLElement, index: number, array: HTMLElement[]) => U, thisArg: Z): [U, U, U]; <U>(this: [HTMLElement, HTMLElement], callbackfn: (this: void, value: HTMLElement, index: number, array: HTMLElement[]) => U): [U, U]; <U>(this: [HTMLElement, HTMLElement], callbackfn: (this: void, value: HTMLElement, index: number, array: HTMLElement[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [HTMLElement, HTMLElement], callbackfn: (this: Z, value: HTMLElement, index: number, array: HTMLElement[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: HTMLElement, index: number, array: HTMLElement[]) => U): U[]; <U>(callbackfn: (this: void, value: HTMLElement, index: number, array: HTMLElement[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: HTMLElement, index: number, array: HTMLElement[]) => U, thisArg: Z): U[]; }
|
||||
>elements.map : <U>(callbackfn: (value: HTMLElement, index: number, array: HTMLElement[]) => U, thisArg?: any) => U[]
|
||||
>elements : HTMLElement[]
|
||||
>map : { <U>(this: [HTMLElement, HTMLElement, HTMLElement, HTMLElement, HTMLElement], callbackfn: (this: void, value: HTMLElement, index: number, array: HTMLElement[]) => U): [U, U, U, U, U]; <U>(this: [HTMLElement, HTMLElement, HTMLElement, HTMLElement, HTMLElement], callbackfn: (this: void, value: HTMLElement, index: number, array: HTMLElement[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [HTMLElement, HTMLElement, HTMLElement, HTMLElement, HTMLElement], callbackfn: (this: Z, value: HTMLElement, index: number, array: HTMLElement[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [HTMLElement, HTMLElement, HTMLElement, HTMLElement], callbackfn: (this: void, value: HTMLElement, index: number, array: HTMLElement[]) => U): [U, U, U, U]; <U>(this: [HTMLElement, HTMLElement, HTMLElement, HTMLElement], callbackfn: (this: void, value: HTMLElement, index: number, array: HTMLElement[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [HTMLElement, HTMLElement, HTMLElement, HTMLElement], callbackfn: (this: Z, value: HTMLElement, index: number, array: HTMLElement[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [HTMLElement, HTMLElement, HTMLElement], callbackfn: (this: void, value: HTMLElement, index: number, array: HTMLElement[]) => U): [U, U, U]; <U>(this: [HTMLElement, HTMLElement, HTMLElement], callbackfn: (this: void, value: HTMLElement, index: number, array: HTMLElement[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [HTMLElement, HTMLElement, HTMLElement], callbackfn: (this: Z, value: HTMLElement, index: number, array: HTMLElement[]) => U, thisArg: Z): [U, U, U]; <U>(this: [HTMLElement, HTMLElement], callbackfn: (this: void, value: HTMLElement, index: number, array: HTMLElement[]) => U): [U, U]; <U>(this: [HTMLElement, HTMLElement], callbackfn: (this: void, value: HTMLElement, index: number, array: HTMLElement[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [HTMLElement, HTMLElement], callbackfn: (this: Z, value: HTMLElement, index: number, array: HTMLElement[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: HTMLElement, index: number, array: HTMLElement[]) => U): U[]; <U>(callbackfn: (this: void, value: HTMLElement, index: number, array: HTMLElement[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: HTMLElement, index: number, array: HTMLElement[]) => U, thisArg: Z): U[]; }
|
||||
>function (e) { // should not error return e.clientWidth;} : (this: void, e: HTMLElement) => number
|
||||
>map : <U>(callbackfn: (value: HTMLElement, index: number, array: HTMLElement[]) => U, thisArg?: any) => U[]
|
||||
>function (e) { // should not error return e.clientWidth;} : (e: HTMLElement) => number
|
||||
>e : HTMLElement
|
||||
|
||||
return e.clientWidth;
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
tests/cases/compiler/implementArrayInterface.ts(1,15): error TS2420: Class 'MyArray<T>' incorrectly implements interface 'T[]'.
|
||||
Types of property 'map' are incompatible.
|
||||
Type '<U>(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any) => U[]' is not assignable to type '{ <U>(this: [T, T, T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U): [U, U, U, U, U]; <U>(this: [T, T, T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [T, T, T, T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [T, T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U): [U, U, U, U]; <U>(this: [T, T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [T, T, T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U): [U, U, U]; <U>(this: [T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [T, T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U, U]; <U>(this: [T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U): [U, U]; <U>(this: [T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: T, index: number, array: T[]) => U): U[]; <U>(callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): U[]; }'.
|
||||
Type 'any[]' is not assignable to type '[any, any, any, any, any]'.
|
||||
Property '0' is missing in type 'any[]'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/implementArrayInterface.ts (1 errors) ====
|
||||
declare class MyArray<T> implements Array<T> {
|
||||
~~~~~~~
|
||||
!!! error TS2420: Class 'MyArray<T>' incorrectly implements interface 'T[]'.
|
||||
!!! error TS2420: Types of property 'map' are incompatible.
|
||||
!!! error TS2420: Type '<U>(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any) => U[]' is not assignable to type '{ <U>(this: [T, T, T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U): [U, U, U, U, U]; <U>(this: [T, T, T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [T, T, T, T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [T, T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U): [U, U, U, U]; <U>(this: [T, T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [T, T, T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U): [U, U, U]; <U>(this: [T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [T, T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U, U]; <U>(this: [T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U): [U, U]; <U>(this: [T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: T, index: number, array: T[]) => U): U[]; <U>(callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): U[]; }'.
|
||||
!!! error TS2420: Type 'any[]' is not assignable to type '[any, any, any, any, any]'.
|
||||
!!! error TS2420: Property '0' is missing in type 'any[]'.
|
||||
toString(): string;
|
||||
toLocaleString(): string;
|
||||
concat<U extends T[]>(...items: U[]): T[];
|
||||
concat(...items: T[]): T[];
|
||||
join(separator?: string): string;
|
||||
pop(): T;
|
||||
push(...items: T[]): number;
|
||||
reverse(): T[];
|
||||
shift(): T;
|
||||
slice(start?: number, end?: number): T[];
|
||||
sort(compareFn?: (a: T, b: T) => number): this;
|
||||
splice(start: number): T[];
|
||||
splice(start: number, deleteCount: number, ...items: T[]): T[];
|
||||
unshift(...items: T[]): number;
|
||||
|
||||
indexOf(searchElement: T, fromIndex?: number): number;
|
||||
lastIndexOf(searchElement: T, fromIndex?: number): number;
|
||||
every(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean;
|
||||
some(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean;
|
||||
forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void;
|
||||
map<U>(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[];
|
||||
filter(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): T[];
|
||||
reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T;
|
||||
reduce<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;
|
||||
reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T;
|
||||
reduceRight<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;
|
||||
|
||||
length: number;
|
||||
|
||||
[n: number]: T;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
//// [tests/cases/conformance/dynamicImport/importCallExpression1ESNext.ts] ////
|
||||
|
||||
//// [0.ts]
|
||||
export function foo() { return "foo"; }
|
||||
|
||||
//// [1.ts]
|
||||
import("./0");
|
||||
var p1 = import("./0");
|
||||
p1.then(zero => {
|
||||
return zero.foo();
|
||||
})
|
||||
|
||||
function foo() {
|
||||
const p2 = import("./0");
|
||||
}
|
||||
|
||||
//// [0.js]
|
||||
export function foo() { return "foo"; }
|
||||
//// [1.js]
|
||||
import("./0");
|
||||
var p1 = import("./0");
|
||||
p1.then(zero => {
|
||||
return zero.foo();
|
||||
});
|
||||
function foo() {
|
||||
const p2 = import("./0");
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
=== tests/cases/conformance/dynamicImport/0.ts ===
|
||||
export function foo() { return "foo"; }
|
||||
>foo : Symbol(foo, Decl(0.ts, 0, 0))
|
||||
|
||||
=== tests/cases/conformance/dynamicImport/1.ts ===
|
||||
import("./0");
|
||||
var p1 = import("./0");
|
||||
>p1 : Symbol(p1, Decl(1.ts, 1, 3))
|
||||
|
||||
p1.then(zero => {
|
||||
>p1.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
|
||||
>p1 : Symbol(p1, Decl(1.ts, 1, 3))
|
||||
>then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
|
||||
>zero : Symbol(zero, Decl(1.ts, 2, 8))
|
||||
|
||||
return zero.foo();
|
||||
>zero.foo : Symbol(foo, Decl(0.ts, 0, 0))
|
||||
>zero : Symbol(zero, Decl(1.ts, 2, 8))
|
||||
>foo : Symbol(foo, Decl(0.ts, 0, 0))
|
||||
|
||||
})
|
||||
|
||||
function foo() {
|
||||
>foo : Symbol(foo, Decl(1.ts, 4, 2))
|
||||
|
||||
const p2 = import("./0");
|
||||
>p2 : Symbol(p2, Decl(1.ts, 7, 9))
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
=== tests/cases/conformance/dynamicImport/0.ts ===
|
||||
export function foo() { return "foo"; }
|
||||
>foo : () => string
|
||||
>"foo" : "foo"
|
||||
|
||||
=== tests/cases/conformance/dynamicImport/1.ts ===
|
||||
import("./0");
|
||||
>import("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
|
||||
var p1 = import("./0");
|
||||
>p1 : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>import("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
|
||||
p1.then(zero => {
|
||||
>p1.then(zero => { return zero.foo();}) : Promise<string>
|
||||
>p1.then : <TResult1 = typeof "tests/cases/conformance/dynamicImport/0", TResult2 = never>(onfulfilled?: (value: typeof "tests/cases/conformance/dynamicImport/0") => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>) => Promise<TResult1 | TResult2>
|
||||
>p1 : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>then : <TResult1 = typeof "tests/cases/conformance/dynamicImport/0", TResult2 = never>(onfulfilled?: (value: typeof "tests/cases/conformance/dynamicImport/0") => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>) => Promise<TResult1 | TResult2>
|
||||
>zero => { return zero.foo();} : (zero: typeof "tests/cases/conformance/dynamicImport/0") => string
|
||||
>zero : typeof "tests/cases/conformance/dynamicImport/0"
|
||||
|
||||
return zero.foo();
|
||||
>zero.foo() : string
|
||||
>zero.foo : () => string
|
||||
>zero : typeof "tests/cases/conformance/dynamicImport/0"
|
||||
>foo : () => string
|
||||
|
||||
})
|
||||
|
||||
function foo() {
|
||||
>foo : () => void
|
||||
|
||||
const p2 = import("./0");
|
||||
>p2 : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>import("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
//// [tests/cases/conformance/dynamicImport/importCallExpression2ESNext.ts] ////
|
||||
|
||||
//// [0.ts]
|
||||
export class B {
|
||||
print() { return "I am B"}
|
||||
}
|
||||
|
||||
//// [2.ts]
|
||||
function foo(x: Promise<any>) {
|
||||
x.then(value => {
|
||||
let b = new value.B();
|
||||
b.print();
|
||||
})
|
||||
}
|
||||
|
||||
foo(import("./0"));
|
||||
|
||||
//// [0.js]
|
||||
export class B {
|
||||
print() { return "I am B"; }
|
||||
}
|
||||
//// [2.js]
|
||||
function foo(x) {
|
||||
x.then(value => {
|
||||
let b = new value.B();
|
||||
b.print();
|
||||
});
|
||||
}
|
||||
foo(import("./0"));
|
||||
@@ -0,0 +1,33 @@
|
||||
=== tests/cases/conformance/dynamicImport/0.ts ===
|
||||
export class B {
|
||||
>B : Symbol(B, Decl(0.ts, 0, 0))
|
||||
|
||||
print() { return "I am B"}
|
||||
>print : Symbol(B.print, Decl(0.ts, 0, 16))
|
||||
}
|
||||
|
||||
=== tests/cases/conformance/dynamicImport/2.ts ===
|
||||
function foo(x: Promise<any>) {
|
||||
>foo : Symbol(foo, Decl(2.ts, 0, 0))
|
||||
>x : Symbol(x, Decl(2.ts, 0, 13))
|
||||
>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --))
|
||||
|
||||
x.then(value => {
|
||||
>x.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
|
||||
>x : Symbol(x, Decl(2.ts, 0, 13))
|
||||
>then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
|
||||
>value : Symbol(value, Decl(2.ts, 1, 11))
|
||||
|
||||
let b = new value.B();
|
||||
>b : Symbol(b, Decl(2.ts, 2, 11))
|
||||
>value : Symbol(value, Decl(2.ts, 1, 11))
|
||||
|
||||
b.print();
|
||||
>b : Symbol(b, Decl(2.ts, 2, 11))
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
foo(import("./0"));
|
||||
>foo : Symbol(foo, Decl(2.ts, 0, 0))
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
=== tests/cases/conformance/dynamicImport/0.ts ===
|
||||
export class B {
|
||||
>B : B
|
||||
|
||||
print() { return "I am B"}
|
||||
>print : () => string
|
||||
>"I am B" : "I am B"
|
||||
}
|
||||
|
||||
=== tests/cases/conformance/dynamicImport/2.ts ===
|
||||
function foo(x: Promise<any>) {
|
||||
>foo : (x: Promise<any>) => void
|
||||
>x : Promise<any>
|
||||
>Promise : Promise<T>
|
||||
|
||||
x.then(value => {
|
||||
>x.then(value => { let b = new value.B(); b.print(); }) : Promise<void>
|
||||
>x.then : <TResult1 = any, TResult2 = never>(onfulfilled?: (value: any) => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>) => Promise<TResult1 | TResult2>
|
||||
>x : Promise<any>
|
||||
>then : <TResult1 = any, TResult2 = never>(onfulfilled?: (value: any) => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>) => Promise<TResult1 | TResult2>
|
||||
>value => { let b = new value.B(); b.print(); } : (value: any) => void
|
||||
>value : any
|
||||
|
||||
let b = new value.B();
|
||||
>b : any
|
||||
>new value.B() : any
|
||||
>value.B : any
|
||||
>value : any
|
||||
>B : any
|
||||
|
||||
b.print();
|
||||
>b.print() : any
|
||||
>b.print : any
|
||||
>b : any
|
||||
>print : any
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
foo(import("./0"));
|
||||
>foo(import("./0")) : void
|
||||
>foo : (x: Promise<any>) => void
|
||||
>import("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
//// [tests/cases/conformance/dynamicImport/importCallExpression3ESNext.ts] ////
|
||||
|
||||
//// [0.ts]
|
||||
export class B {
|
||||
print() { return "I am B"}
|
||||
}
|
||||
|
||||
//// [2.ts]
|
||||
async function foo() {
|
||||
class C extends (await import("./0")).B {}
|
||||
var c = new C();
|
||||
c.print();
|
||||
}
|
||||
foo();
|
||||
|
||||
//// [0.js]
|
||||
export class B {
|
||||
print() { return "I am B"; }
|
||||
}
|
||||
//// [2.js]
|
||||
async function foo() {
|
||||
class C extends (await import("./0")).B {
|
||||
}
|
||||
var c = new C();
|
||||
c.print();
|
||||
}
|
||||
foo();
|
||||
@@ -0,0 +1,29 @@
|
||||
=== tests/cases/conformance/dynamicImport/0.ts ===
|
||||
export class B {
|
||||
>B : Symbol(B, Decl(0.ts, 0, 0))
|
||||
|
||||
print() { return "I am B"}
|
||||
>print : Symbol(B.print, Decl(0.ts, 0, 16))
|
||||
}
|
||||
|
||||
=== tests/cases/conformance/dynamicImport/2.ts ===
|
||||
async function foo() {
|
||||
>foo : Symbol(foo, Decl(2.ts, 0, 0))
|
||||
|
||||
class C extends (await import("./0")).B {}
|
||||
>C : Symbol(C, Decl(2.ts, 0, 22))
|
||||
>(await import("./0")).B : Symbol(B, Decl(0.ts, 0, 0))
|
||||
>B : Symbol(B, Decl(0.ts, 0, 0))
|
||||
|
||||
var c = new C();
|
||||
>c : Symbol(c, Decl(2.ts, 2, 7))
|
||||
>C : Symbol(C, Decl(2.ts, 0, 22))
|
||||
|
||||
c.print();
|
||||
>c.print : Symbol(B.print, Decl(0.ts, 0, 16))
|
||||
>c : Symbol(c, Decl(2.ts, 2, 7))
|
||||
>print : Symbol(B.print, Decl(0.ts, 0, 16))
|
||||
}
|
||||
foo();
|
||||
>foo : Symbol(foo, Decl(2.ts, 0, 0))
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user