diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000000..1f64bbcee32 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,48 @@ +node_modules +.node_modules +built/* +test-args.txt +~*.docx +\#*\# +.\#* +src/harness/*.js +src/compiler/diagnosticInformationMap.generated.ts +src/compiler/diagnosticMessages.generated.json +src/parser/diagnosticInformationMap.generated.ts +src/parser/diagnosticMessages.generated.json +rwc-report.html +*.swp +build.json +*.actual +*.config +scripts/debug.bat +scripts/run.bat +scripts/word2md.js +scripts/buildProtocol.js +scripts/ior.js +scripts/authors.js +scripts/configurePrerelease.js +scripts/open-user-pr.js +scripts/open-cherry-pick-pr.js +scripts/processDiagnosticMessages.d.ts +scripts/processDiagnosticMessages.js +scripts/produceLKG.js +scripts/importDefinitelyTypedTests/importDefinitelyTypedTests.js +scripts/generateLocalizedDiagnosticMessages.js +scripts/*.js.map +scripts/typings/ +coverage/ +internal/ +**/.DS_Store +.settings +**/.vs +.idea +yarn.lock +yarn-error.log +.parallelperf.* +.failed-tests +TEST-results.xml +package-lock.json +tests +.vscode +.git \ No newline at end of file diff --git a/.npmignore b/.npmignore index 482633f48fc..2144451e3e8 100644 --- a/.npmignore +++ b/.npmignore @@ -29,3 +29,5 @@ package-lock.json yarn.lock CONTRIBUTING.md TEST-results.xml +.dockerignore +Dockerfile \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000000..8898a69af6d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +# We use this dockerfile to build a packed tarfile which we import in our `docker` tests +FROM node:current +COPY . /typescript +WORKDIR /typescript +RUN npm install +RUN npm i -g gulp-cli +RUN gulp configure-insiders && gulp LKG && gulp clean && npm pack . \ No newline at end of file diff --git a/scripts/open-cherry-pick-pr.ts b/scripts/open-cherry-pick-pr.ts index eed8f33d374..70c0bc7dd23 100644 --- a/scripts/open-cherry-pick-pr.ts +++ b/scripts/open-cherry-pick-pr.ts @@ -36,9 +36,10 @@ async function main() { Component commits: ${logText.trim()}`; const logpath = path.join(__dirname, "../", "logmessage.txt"); + const mergebase = runSequence([["git", ["merge-base", "origin/master", currentSha]]]).trim(); runSequence([ ["git", ["checkout", "-b", "temp-branch"]], - ["git", ["reset", "origin/master", "--soft"]] + ["git", ["reset", mergebase, "--soft"]] ]); fs.writeFileSync(logpath, logText); runSequence([ diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index ead7e333cfe..123a185dced 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -3265,7 +3265,7 @@ namespace ts { function hasVisibleDeclarations(symbol: Symbol, shouldComputeAliasToMakeVisible: boolean): SymbolVisibilityResult | undefined { let aliasesToMakeVisible: LateVisibilityPaintedStatement[] | undefined; - if (!every(symbol.declarations, getIsDeclarationVisible)) { + if (!every(filter(symbol.declarations, d => d.kind !== SyntaxKind.Identifier), getIsDeclarationVisible)) { return undefined; } return { accessibility: SymbolAccessibility.Accessible, aliasesToMakeVisible }; @@ -5483,7 +5483,7 @@ namespace ts { function getTypeFromObjectBindingPattern(pattern: ObjectBindingPattern, includePatternInType: boolean, reportErrors: boolean): Type { const members = createSymbolTable(); let stringIndexInfo: IndexInfo | undefined; - let objectFlags = ObjectFlags.ObjectLiteral | ObjectFlags.ContainsObjectLiteral; + let objectFlags = ObjectFlags.ObjectLiteral | ObjectFlags.ContainsObjectOrArrayLiteral; forEach(pattern.elements, e => { const name = e.propertyName || e.name; if (e.dotDotDotToken) { @@ -10805,7 +10805,7 @@ namespace ts { emptyArray, getIndexInfoWithReadonly(stringIndexInfo, readonly), getIndexInfoWithReadonly(numberIndexInfo, readonly)); - spread.objectFlags |= ObjectFlags.ObjectLiteral | ObjectFlags.ContainsObjectLiteral | ObjectFlags.ContainsSpread | objectFlags; + spread.objectFlags |= ObjectFlags.ObjectLiteral | ObjectFlags.ContainsObjectOrArrayLiteral | ObjectFlags.ContainsSpread | objectFlags; return spread; } @@ -14442,7 +14442,7 @@ namespace ts { if (propType) { return propType; } - if (everyType(type, isTupleType) && !everyType(type, t => !(t).target.hasRestElement)) { + if (everyType(type, isTupleType)) { return mapType(type, t => getRestTypeOfTupleType(t) || undefinedType); } return undefined; @@ -15646,12 +15646,16 @@ namespace ts { return !!(getObjectFlags(type) & ObjectFlags.ObjectLiteral); } - function widenObjectLiteralCandidates(candidates: Type[]): Type[] { + function isObjectOrArrayLiteralType(type: Type) { + return !!(getObjectFlags(type) & (ObjectFlags.ObjectLiteral | ObjectFlags.ArrayLiteral)); + } + + function unionObjectAndArrayLiteralCandidates(candidates: Type[]): Type[] { if (candidates.length > 1) { - const objectLiterals = filter(candidates, isObjectLiteralType); + const objectLiterals = filter(candidates, isObjectOrArrayLiteralType); if (objectLiterals.length) { - const objectLiteralsType = getWidenedType(getUnionType(objectLiterals, UnionReduction.Subtype)); - return concatenate(filter(candidates, t => !isObjectLiteralType(t)), [objectLiteralsType]); + const literalsType = getUnionType(objectLiterals, UnionReduction.Subtype); + return concatenate(filter(candidates, t => !isObjectOrArrayLiteralType(t)), [literalsType]); } } return candidates; @@ -15662,8 +15666,8 @@ namespace ts { } function getCovariantInference(inference: InferenceInfo, signature: Signature) { - // Extract all object literal types and replace them with a single widened and normalized type. - const candidates = widenObjectLiteralCandidates(inference.candidates!); + // Extract all object and array literal types and replace them with a single widened and normalized type. + const candidates = unionObjectAndArrayLiteralCandidates(inference.candidates!); // We widen inferred literal types if // all inferences were made to top-level occurrences of the type parameter, and // the type parameter has no constraint or its constraint includes no primitive or literal types, and @@ -19149,22 +19153,34 @@ namespace ts { const minLength = elementCount - (hasRestElement ? 1 : 0); // If array literal is actually a destructuring pattern, mark it as an implied type. We do this such // that we get the same behavior for "var [x, y] = []" and "[x, y] = []". - let tupleResult: Type | undefined; + let tupleResult; if (inDestructuringPattern && minLength > 0) { const type = cloneTypeReference(createTupleType(elementTypes, minLength, hasRestElement)); type.pattern = node; return type; } else if (tupleResult = getArrayLiteralTupleTypeIfApplicable(elementTypes, contextualType, hasRestElement, elementCount, inConstContext)) { - return tupleResult; + return createArrayLiteralType(tupleResult); } else if (forceTuple) { - return createTupleType(elementTypes, minLength, hasRestElement); + return createArrayLiteralType(createTupleType(elementTypes, minLength, hasRestElement)); } } - return createArrayType(elementTypes.length ? + return createArrayLiteralType(createArrayType(elementTypes.length ? getUnionType(elementTypes, UnionReduction.Subtype) : - strictNullChecks ? implicitNeverType : undefinedWideningType, inConstContext); + strictNullChecks ? implicitNeverType : undefinedWideningType, inConstContext)); + } + + function createArrayLiteralType(type: ObjectType) { + if (!(getObjectFlags(type) & ObjectFlags.Reference)) { + return type; + } + let literalType = (type).literalType; + if (!literalType) { + literalType = (type).literalType = cloneTypeReference(type); + literalType.objectFlags |= ObjectFlags.ArrayLiteral | ObjectFlags.ContainsObjectOrArrayLiteral; + } + return literalType; } function getArrayLiteralTupleTypeIfApplicable(elementTypes: Type[], contextualType: Type | undefined, hasRestElement: boolean, elementCount = elementTypes.length, readonly = false) { @@ -19449,7 +19465,7 @@ namespace ts { const stringIndexInfo = hasComputedStringProperty ? getObjectLiteralIndexInfo(node, offset, propertiesArray, IndexKind.String) : undefined; const numberIndexInfo = hasComputedNumberProperty ? getObjectLiteralIndexInfo(node, offset, propertiesArray, IndexKind.Number) : undefined; const result = createAnonymousType(node.symbol, propertiesTable, emptyArray, emptyArray, stringIndexInfo, numberIndexInfo); - result.objectFlags |= objectFlags | ObjectFlags.ObjectLiteral | ObjectFlags.ContainsObjectLiteral; + result.objectFlags |= objectFlags | ObjectFlags.ObjectLiteral | ObjectFlags.ContainsObjectOrArrayLiteral; if (isJSObjectLiteral) { result.objectFlags |= ObjectFlags.JSLiteral; } @@ -19645,7 +19661,7 @@ namespace ts { function createJsxAttributesType() { objectFlags |= freshObjectLiteralFlag; const result = createAnonymousType(attributes.symbol, attributesTable, emptyArray, emptyArray, /*stringIndexInfo*/ undefined, /*numberIndexInfo*/ undefined); - result.objectFlags |= objectFlags | ObjectFlags.ObjectLiteral | ObjectFlags.ContainsObjectLiteral; + result.objectFlags |= objectFlags | ObjectFlags.ObjectLiteral | ObjectFlags.ContainsObjectOrArrayLiteral; return result; } } @@ -21398,7 +21414,8 @@ namespace ts { reorderCandidates(signatures, candidates); if (!candidates.length) { if (reportErrors) { - diagnostics.add(createDiagnosticForNode(node, Diagnostics.Call_target_does_not_contain_any_signatures)); + const errorNode = getCallErrorNode(node); + diagnostics.add(createDiagnosticForNode(errorNode, Diagnostics.Call_target_does_not_contain_any_signatures)); } return resolveErrorCall(node); } @@ -21476,11 +21493,13 @@ namespace ts { // If candidate is undefined, it means that no candidates had a suitable arity. In that case, // skip the checkApplicableSignature check. if (reportErrors) { + const errorNode = getCallErrorNode(node); + if (candidateForArgumentError) { checkApplicableSignature(node, args, candidateForArgumentError, assignableRelation, CheckMode.Normal, /*reportErrors*/ true); } else if (candidateForArgumentArityError) { - diagnostics.add(getArgumentArityError(node, [candidateForArgumentArityError], args)); + diagnostics.add(getArgumentArityError(errorNode, [candidateForArgumentArityError], args)); } else if (candidateForTypeArgumentError) { checkTypeArguments(candidateForTypeArgumentError, (node as CallExpression | TaggedTemplateExpression | JsxOpeningLikeElement).typeArguments!, /*reportErrors*/ true, fallbackError); @@ -21488,19 +21507,31 @@ namespace ts { else { const signaturesWithCorrectTypeArgumentArity = filter(signatures, s => hasCorrectTypeArgumentArity(s, typeArguments)); if (signaturesWithCorrectTypeArgumentArity.length === 0) { - diagnostics.add(getTypeArgumentArityError(node, signatures, typeArguments!)); + diagnostics.add(getTypeArgumentArityError(errorNode, signatures, typeArguments!)); } else if (!isDecorator) { - diagnostics.add(getArgumentArityError(node, signaturesWithCorrectTypeArgumentArity, args)); + diagnostics.add(getArgumentArityError(errorNode, signaturesWithCorrectTypeArgumentArity, args)); } else if (fallbackError) { - diagnostics.add(createDiagnosticForNode(node, fallbackError)); + diagnostics.add(createDiagnosticForNode(errorNode, fallbackError)); } } } return produceDiagnostics || !args ? resolveErrorCall(node) : getCandidateForOverloadFailure(node, candidates, args, !!candidatesOutArray); + function getCallErrorNode(node: CallLikeExpression): Node { + if (isCallExpression(node)) { + if (isPropertyAccessExpression(node.expression)) { + return node.expression.name; + } + else { + return node.expression; + } + } + return node; + } + function chooseOverload(candidates: Signature[], relation: Map, signatureHelpTrailingComma = false) { candidateForArgumentError = undefined; candidateForArgumentArityError = undefined; diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 394a94cb663..c0363788c9e 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -147,6 +147,12 @@ namespace ts { category: Diagnostics.Basic_Options, description: Diagnostics.Enable_incremental_compilation, }, + { + name: "locale", + type: "string", + category: Diagnostics.Advanced_Options, + description: Diagnostics.The_locale_used_when_displaying_messages_to_the_user_e_g_en_us + }, ]; /* @internal */ @@ -698,12 +704,6 @@ namespace ts { category: Diagnostics.Advanced_Options, description: Diagnostics.Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files }, - { - name: "locale", - type: "string", - category: Diagnostics.Advanced_Options, - description: Diagnostics.The_locale_used_when_displaying_messages_to_the_user_e_g_en_us - }, { name: "newLine", type: createMapFromTemplate({ @@ -1171,7 +1171,7 @@ namespace ts { export interface ParsedBuildCommand { buildOptions: BuildOptions; projects: string[]; - errors: ReadonlyArray; + errors: Diagnostic[]; } /*@internal*/ diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 019f1f56872..258540ec1bb 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -725,7 +725,8 @@ namespace ts { fileExists: f => host.fileExists(f), directoryExists: host.directoryExists && (f => host.directoryExists!(f)), useCaseSensitiveFileNames: () => host.useCaseSensitiveFileNames(), - getProgramBuildInfo: returnUndefined + getProgramBuildInfo: returnUndefined, + getSourceFileFromReference: returnUndefined, }; emitFiles( notImplementedResolver, diff --git a/src/compiler/moduleNameResolver.ts b/src/compiler/moduleNameResolver.ts index 62c416b3804..8cf2bad6f0f 100644 --- a/src/compiler/moduleNameResolver.ts +++ b/src/compiler/moduleNameResolver.ts @@ -1487,8 +1487,8 @@ namespace ts { } /** - * LSHost may load a module from a global cache of typings. - * This is the minumum code needed to expose that functionality; the rest is in LSHost. + * A host may load a module from a global cache of typings. + * This is the minumum code needed to expose that functionality; the rest is in the host. */ /* @internal */ export function loadModuleFromGlobalCache(moduleName: string, projectName: string | undefined, compilerOptions: CompilerOptions, host: ModuleResolutionHost, globalCache: string): ResolvedModuleWithFailedLookupLocations { diff --git a/src/compiler/program.ts b/src/compiler/program.ts index ebaf5dbfefa..0a0fa8ebb0b 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -1439,7 +1439,8 @@ namespace ts { }, ...(host.directoryExists ? { directoryExists: f => host.directoryExists!(f) } : {}), useCaseSensitiveFileNames: () => host.useCaseSensitiveFileNames(), - getProgramBuildInfo: () => program.getProgramBuildInfo && program.getProgramBuildInfo() + getProgramBuildInfo: () => program.getProgramBuildInfo && program.getProgramBuildInfo(), + getSourceFileFromReference: (file, ref) => program.getSourceFileFromReference(file, ref), }; } @@ -2126,7 +2127,7 @@ namespace ts { } /** This should have similar behavior to 'processSourceFile' without diagnostics or mutation. */ - function getSourceFileFromReference(referencingFile: SourceFile, ref: FileReference): SourceFile | undefined { + function getSourceFileFromReference(referencingFile: SourceFile | UnparsedSource, ref: FileReference): SourceFile | undefined { return getSourceFileFromReferenceWorker(resolveTripleslashReference(ref.fileName, referencingFile.fileName), fileName => filesByName.get(toPath(fileName)) || undefined); } diff --git a/src/compiler/sys.ts b/src/compiler/sys.ts index 2fd3f5af3c7..2f342509719 100644 --- a/src/compiler/sys.ts +++ b/src/compiler/sys.ts @@ -330,7 +330,7 @@ namespace ts { } /*@internal*/ - export const ignoredPaths = ["/node_modules/.", "/.git"]; + export const ignoredPaths = ["/node_modules/.", "/.git", "/.#"]; /*@internal*/ export interface RecursiveDirectoryWatcherHost { diff --git a/src/compiler/transformers/declarations.ts b/src/compiler/transformers/declarations.ts index 20aac7d4936..4f68c36d919 100644 --- a/src/compiler/transformers/declarations.ts +++ b/src/compiler/transformers/declarations.ts @@ -348,7 +348,7 @@ namespace ts { function collectReferences(sourceFile: SourceFile | UnparsedSource, ret: Map) { if (noResolve || (!isUnparsedSource(sourceFile) && isSourceFileJS(sourceFile))) return ret; forEach(sourceFile.referencedFiles, f => { - const elem = tryResolveScriptReference(host, sourceFile, f); + const elem = host.getSourceFileFromReference(sourceFile, f); if (elem) { ret.set("" + getOriginalNodeId(elem), elem); } @@ -1036,19 +1036,25 @@ namespace ts { /*body*/ undefined )); if (clean && resolver.isExpandoFunctionDeclaration(input)) { - const declarations = mapDefined(resolver.getPropertiesOfContainerFunction(input), p => { + const props = resolver.getPropertiesOfContainerFunction(input); + const fakespace = createModuleDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, clean.name || createIdentifier("_default"), createModuleBlock([]), NodeFlags.Namespace); + fakespace.flags ^= NodeFlags.Synthesized; // unset synthesized so it is usable as an enclosing declaration + fakespace.parent = enclosingDeclaration as SourceFile | NamespaceDeclaration; + fakespace.locals = createSymbolTable(props); + fakespace.symbol = props[0].parent!; + const declarations = mapDefined(props, p => { if (!isPropertyAccessExpression(p.valueDeclaration)) { return undefined; } getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(p.valueDeclaration); - const type = resolver.createTypeOfDeclaration(p.valueDeclaration, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker); + const type = resolver.createTypeOfDeclaration(p.valueDeclaration, fakespace, declarationEmitNodeBuilderFlags, symbolTracker); getSymbolAccessibilityDiagnostic = oldDiag; const varDecl = createVariableDeclaration(unescapeLeadingUnderscores(p.escapedName), type, /*initializer*/ undefined); return createVariableStatement(/*modifiers*/ undefined, createVariableDeclarationList([varDecl])); }); const namespaceDecl = createModuleDeclaration(/*decorators*/ undefined, ensureModifiers(input, isPrivate), input.name!, createModuleBlock(declarations), NodeFlags.Namespace); - if (!hasModifier(clean, ModifierFlags.ExportDefault)) { + if (!hasModifier(clean, ModifierFlags.Default)) { return [clean, namespaceDecl]; } diff --git a/src/compiler/tsbuild.ts b/src/compiler/tsbuild.ts index fdb5d5851e2..868eac2cf06 100644 --- a/src/compiler/tsbuild.ts +++ b/src/compiler/tsbuild.ts @@ -172,6 +172,7 @@ namespace ts { traceResolution?: boolean; /* @internal */ diagnostics?: boolean; /* @internal */ extendedDiagnostics?: boolean; + /* @internal */ locale?: string; [option: string]: CompilerOptionsValue | undefined; } @@ -1461,7 +1462,8 @@ namespace ts { const refStatus = getUpToDateStatus(state, parseConfigFile(state, resolvedRef, resolvedRefPath), resolvedRefPath); // Its a circular reference ignore the status of this project - if (refStatus.type === UpToDateStatusType.ComputingUpstream) { + if (refStatus.type === UpToDateStatusType.ComputingUpstream || + refStatus.type === UpToDateStatusType.ContainerOnly) { // Container only ignore this project continue; } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 8b2fea83dcd..245d965582b 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -2975,7 +2975,7 @@ namespace ts { // For testing purposes only. /* @internal */ structureIsReused?: StructureIsReused; - /* @internal */ getSourceFileFromReference(referencingFile: SourceFile, ref: FileReference): SourceFile | undefined; + /* @internal */ getSourceFileFromReference(referencingFile: SourceFile | UnparsedSource, ref: FileReference): SourceFile | undefined; /* @internal */ getLibFileFromReference(ref: FileReference): SourceFile | undefined; /** Given a source file, get the name of the package it was imported from. */ @@ -4089,19 +4089,20 @@ namespace ts { MarkerType = 1 << 13, // Marker type used for variance probing JSLiteral = 1 << 14, // Object type declared in JS - disables errors on read/write of nonexisting members FreshLiteral = 1 << 15, // Fresh object literal + ArrayLiteral = 1 << 16, // Originates in an array literal /* @internal */ - PrimitiveUnion = 1 << 16, // Union of only primitive types + PrimitiveUnion = 1 << 17, // Union of only primitive types /* @internal */ - ContainsWideningType = 1 << 17, // Type is or contains undefined or null widening type + ContainsWideningType = 1 << 18, // Type is or contains undefined or null widening type /* @internal */ - ContainsObjectLiteral = 1 << 18, // Type is or contains object literal type + ContainsObjectOrArrayLiteral = 1 << 19, // Type is or contains object literal type /* @internal */ - NonInferrableType = 1 << 19, // Type is or contains anyFunctionType or silentNeverType + NonInferrableType = 1 << 20, // Type is or contains anyFunctionType or silentNeverType ClassOrInterface = Class | Interface, /* @internal */ - RequiresWidening = ContainsWideningType | ContainsObjectLiteral, + RequiresWidening = ContainsWideningType | ContainsObjectOrArrayLiteral, /* @internal */ - PropagatingFlags = ContainsWideningType | ContainsObjectLiteral | NonInferrableType + PropagatingFlags = ContainsWideningType | ContainsObjectOrArrayLiteral | NonInferrableType } /* @internal */ @@ -4154,6 +4155,8 @@ namespace ts { export interface TypeReference extends ObjectType { target: GenericType; // Type reference target typeArguments?: ReadonlyArray; // Type reference type arguments (undefined if none) + /* @internal */ + literalType?: TypeReference; // Clone of type with ObjectFlags.ArrayLiteral set } /* @internal */ @@ -5396,6 +5399,7 @@ namespace ts { writeFile: WriteFileCallback; getProgramBuildInfo(): ProgramBuildInfo | undefined; + getSourceFileFromReference: Program["getSourceFileFromReference"]; } export interface TransformationContext { diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index d4c55f0291e..7215fad76ff 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -2615,13 +2615,6 @@ namespace ts { return undefined; } - export function tryResolveScriptReference(host: ScriptReferenceHost, sourceFile: SourceFile | UnparsedSource, reference: FileReference) { - if (!host.getCompilerOptions().noResolve) { - const referenceFileName = isRootedDiskPath(reference.fileName) ? reference.fileName : combinePaths(getDirectoryPath(sourceFile.fileName), reference.fileName); - return host.getSourceFile(referenceFileName); - } - } - export function getAncestor(node: Node | undefined, kind: SyntaxKind): Node | undefined { while (node) { if (node.kind === kind) { diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index bdb725ea369..847dc2a2b13 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -1177,7 +1177,9 @@ Actual: ${stringify(fullActual)}`); public verifyRenameLocations(startRanges: ArrayOrSingle, options: FourSlashInterface.RenameLocationsOptions) { const { findInStrings = false, findInComments = false, ranges = this.getRanges(), providePrefixAndSuffixTextForRename = true } = ts.isArray(options) ? { findInStrings: false, findInComments: false, ranges: options, providePrefixAndSuffixTextForRename: true } : options; - for (const startRange of toArray(startRanges)) { + const _startRanges = toArray(startRanges); + assert(_startRanges.length); + for (const startRange of _startRanges) { this.goToRangeStart(startRange); const renameInfo = this.languageService.getRenameInfo(this.activeFile.fileName, this.currentCaretPosition); @@ -2731,6 +2733,7 @@ Actual: ${stringify(fullActual)}`); public verifyRangesAreOccurrences(isWriteAccess?: boolean, ranges?: Range[]) { ranges = ranges || this.getRanges(); + assert(ranges.length); for (const r of ranges) { this.goToRangeStart(r); this.verifyOccurrencesAtPositionListCount(ranges.length); @@ -2761,6 +2764,7 @@ Actual: ${stringify(fullActual)}`); public verifyRangesAreDocumentHighlights(ranges: Range[] | undefined, options: FourSlashInterface.VerifyDocumentHighlightsOptions | undefined) { ranges = ranges || this.getRanges(); + assert(ranges.length); const fileNames = options && options.filesToSearch || unique(ranges, range => range.fileName); for (const range of ranges) { this.goToRangeStart(range); @@ -2930,7 +2934,9 @@ Actual: ${stringify(fullActual)}`); } public noMoveToNewFile() { - for (const range of this.getRanges()) { + const ranges = this.getRanges(); + assert(ranges.length); + for (const range of ranges) { for (const refactor of this.getApplicableRefactors(range, { allowTextChangesInNewFiles: true })) { if (refactor.name === "Move to a new file") { ts.Debug.fail("Did not expect to get 'move to a new file' refactor"); diff --git a/src/harness/runnerbase.ts b/src/harness/runnerbase.ts index b29ebb7f920..ce56772927e 100644 --- a/src/harness/runnerbase.ts +++ b/src/harness/runnerbase.ts @@ -1,4 +1,4 @@ -type TestRunnerKind = CompilerTestKind | FourslashTestKind | "project" | "rwc" | "test262" | "user" | "dt"; +type TestRunnerKind = CompilerTestKind | FourslashTestKind | "project" | "rwc" | "test262" | "user" | "dt" | "docker"; type CompilerTestKind = "conformance" | "compiler"; type FourslashTestKind = "fourslash" | "fourslash-shims" | "fourslash-shims-pp" | "fourslash-server"; diff --git a/src/server/project.ts b/src/server/project.ts index 72104e68911..0e21855f15f 100644 --- a/src/server/project.ts +++ b/src/server/project.ts @@ -952,7 +952,7 @@ namespace ts.server { this.externalFiles = this.getExternalFiles(); enumerateInsertsAndDeletes(this.externalFiles, oldExternalFiles, getStringComparer(!this.useCaseSensitiveFileNames()), // Ensure a ScriptInfo is created for new external files. This is performed indirectly - // by the LSHost for files in the program when the program is retrieved above but + // by the host for files in the program when the program is retrieved above but // the program doesn't contain external files so this must be done explicitly. inserted => { const scriptInfo = this.projectService.getOrCreateScriptInfoNotOpenedByClient(inserted, this.currentDirectory, this.directoryStructureHost)!; diff --git a/src/services/goToDefinition.ts b/src/services/goToDefinition.ts index fbd0be91022..1cb42a59e3c 100644 --- a/src/services/goToDefinition.ts +++ b/src/services/goToDefinition.ts @@ -108,7 +108,7 @@ namespace ts.GoToDefinition { export function getReferenceAtPosition(sourceFile: SourceFile, position: number, program: Program): { fileName: string, file: SourceFile } | undefined { const referencePath = findReferenceInPosition(sourceFile.referencedFiles, position); if (referencePath) { - const file = tryResolveScriptReference(program, sourceFile, referencePath); + const file = program.getSourceFileFromReference(sourceFile, referencePath); return file && { fileName: referencePath.fileName, file }; } diff --git a/src/testRunner/externalCompileRunner.ts b/src/testRunner/externalCompileRunner.ts index f21d7ea9b90..a0aaea45af4 100644 --- a/src/testRunner/externalCompileRunner.ts +++ b/src/testRunner/externalCompileRunner.ts @@ -106,6 +106,81 @@ ${stripAbsoluteImportPaths(result.stderr.toString().replace(/\r\n/g, "\n"))}`; } } +class DockerfileRunner extends ExternalCompileRunnerBase { + readonly testDir = "tests/cases/docker/"; + kind(): TestRunnerKind { + return "docker"; + } + initializeTests(): void { + // Read in and evaluate the test list + const testList = this.tests && this.tests.length ? this.tests : this.enumerateTestFiles(); + + // tslint:disable-next-line:no-this-assignment + const cls = this; + describe(`${this.kind()} code samples`, function(this: Mocha.ISuiteCallbackContext) { + this.timeout(cls.timeout); // 20 minutes + before(() => { + cls.exec("docker", ["build", ".", "-t", "typescript/typescript"], { cwd: Harness.IO.getWorkspaceRoot() }); // cached because workspace is hashed to determine cacheability + }); + for (const test of testList) { + const directory = typeof test === "string" ? test : test.file; + const cwd = path.join(Harness.IO.getWorkspaceRoot(), cls.testDir, directory); + it(`should build ${directory} successfully`, () => { + const imageName = `tstest/${directory}`; + cls.exec("docker", ["build", "--no-cache", ".", "-t", imageName], { cwd }); // --no-cache so the latest version of the repos referenced is always fetched + const cp: typeof import("child_process") = require("child_process"); + Harness.Baseline.runBaseline(`${cls.kind()}/${directory}.log`, cls.report(cp.spawnSync(`docker`, ["run", imageName], { cwd, timeout: cls.timeout, shell: true }))); + }); + } + }); + } + + private timeout = 1_200_000; // 20 minutes; + private exec(command: string, args: string[], options: { cwd: string, timeout?: number }): void { + const cp: typeof import("child_process") = require("child_process"); + const stdio = isWorker ? "pipe" : "inherit"; + const res = cp.spawnSync(command, args, { timeout: this.timeout, shell: true, stdio, ...options }); + if (res.status !== 0) { + throw new Error(`${command} ${args.join(" ")} for ${options.cwd} failed: ${res.stderr && res.stderr.toString()}`); + } + } + report(result: ExecResult) { + // tslint:disable-next-line:no-null-keyword + return result.status === 0 && !result.stdout.length && !result.stderr.length ? null : `Exit Code: ${result.status} +Standard output: +${sanitizeDockerfileOutput(result.stdout.toString())} + + +Standard error: +${sanitizeDockerfileOutput(result.stderr.toString())}`; + } +} + +function sanitizeDockerfileOutput(result: string): string { + return stripAbsoluteImportPaths(sanitizeTimestamps(stripRushStageNumbers(stripANSIEscapes(normalizeNewlines(result))))); +} + +function normalizeNewlines(result: string): string { + return result.replace(/\r\n/g, "\n"); +} + +function stripANSIEscapes(result: string): string { + return result.replace(/\x1b\[[0-9;]*[a-zA-Z]/g, ""); +} + +function stripRushStageNumbers(result: string): string { + return result.replace(/\d+ of \d+:/g, "XX of XX:"); +} + +function sanitizeTimestamps(result: string): string { + return result.replace(/\[\d?\d:\d\d:\d\d (A|P)M\]/g, "[XX:XX:XX XM]") + .replace(/\d+(\.\d+)? seconds?/g, "? seconds") + .replace(/\d+(\.\d+)? minutes?/g, "") + .replace(/\d+(\.\d+)?s/g, "?s") + .replace(/\d+.\d+.\d+-insiders.\d\d\d\d\d\d\d\d/g, "X.X.X-insiders.xxxxxxxx"); +} + + /** * Import types and some other error messages use absolute paths in errors as they have no context to be written relative to; * This is problematic for error baselines, so we grep for them and strip them out. diff --git a/src/testRunner/runner.ts b/src/testRunner/runner.ts index 455a749e207..9ceb7cd8d77 100644 --- a/src/testRunner/runner.ts +++ b/src/testRunner/runner.ts @@ -40,6 +40,8 @@ function createRunner(kind: TestRunnerKind): RunnerBase { return new UserCodeRunner(); case "dt": return new DefinitelyTypedRunner(); + case "docker": + return new DockerfileRunner(); } return ts.Debug.fail(`Unknown runner kind ${kind}`); } @@ -172,6 +174,9 @@ function handleTestConfig() { case "dt": runners.push(new DefinitelyTypedRunner()); break; + case "docker": + runners.push(new DockerfileRunner()); + break; } } } @@ -194,6 +199,7 @@ function handleTestConfig() { // CRON-only tests if (process.env.TRAVIS_EVENT_TYPE === "cron") { runners.push(new UserCodeRunner()); + runners.push(new DockerfileRunner()); } } if (runUnitTests === undefined) { diff --git a/src/testRunner/tsconfig.json b/src/testRunner/tsconfig.json index 07499a998ba..b2e7e3e78b9 100644 --- a/src/testRunner/tsconfig.json +++ b/src/testRunner/tsconfig.json @@ -90,6 +90,7 @@ "unittests/services/textChanges.ts", "unittests/services/transpile.ts", "unittests/tsbuild/amdModulesWithOut.ts", + "unittests/tsbuild/containerOnlyReferenced.ts", "unittests/tsbuild/emptyFiles.ts", "unittests/tsbuild/graphOrdering.ts", "unittests/tsbuild/inferredTypeFromTransitiveModule.ts", diff --git a/src/testRunner/unittests/config/commandLineParsing.ts b/src/testRunner/unittests/config/commandLineParsing.ts index 3c033d658ef..3d1001c7daf 100644 --- a/src/testRunner/unittests/config/commandLineParsing.ts +++ b/src/testRunner/unittests/config/commandLineParsing.ts @@ -486,6 +486,16 @@ namespace ts { }); }); + it("parse build with --locale en-us", () => { + // --lib es6 0.ts + assertParseResult(["--locale", "en-us", "src"], + { + errors: [], + projects: ["src"], + buildOptions: { locale: "en-us" } + }); + }); + it("parse build with --tsBuildInfoFile", () => { // --lib es6 0.ts assertParseResult(["--tsBuildInfoFile", "build.tsbuildinfo", "tests"], diff --git a/src/testRunner/unittests/tsbuild/containerOnlyReferenced.ts b/src/testRunner/unittests/tsbuild/containerOnlyReferenced.ts new file mode 100644 index 00000000000..425dbf2e20f --- /dev/null +++ b/src/testRunner/unittests/tsbuild/containerOnlyReferenced.ts @@ -0,0 +1,48 @@ +namespace ts { + describe("unittests:: tsbuild:: when containerOnly project is referenced", () => { + let projFs: vfs.FileSystem; + before(() => { + projFs = loadProjectFromDisk("tests/projects/containerOnlyReferenced"); + }); + + after(() => { + projFs = undefined!; // Release the contents + }); + + function outputs(folder: string) { + return [ + `${folder}/index.js`, + `${folder}/index.d.ts`, + `${folder}/tsconfig.tsbuildinfo` + ]; + } + + it("verify that subsequent builds after initial build doesnt build anything", () => { + const fs = projFs.shadow(); + const host = new fakes.SolutionBuilderHost(fs); + createSolutionBuilder(host, ["/src"], { verbose: true }).build(); + host.assertDiagnosticMessages( + getExpectedDiagnosticForProjectsInBuild("src/src/folder/tsconfig.json", "src/src/folder2/tsconfig.json", "src/src/tsconfig.json", "src/tests/tsconfig.json", "src/tsconfig.json"), + [Diagnostics.Project_0_is_out_of_date_because_output_file_1_does_not_exist, "src/src/folder/tsconfig.json", "src/src/folder/index.js"], + [Diagnostics.Building_project_0, "/src/src/folder/tsconfig.json"], + [Diagnostics.Project_0_is_out_of_date_because_output_file_1_does_not_exist, "src/src/folder2/tsconfig.json", "src/src/folder2/index.js"], + [Diagnostics.Building_project_0, "/src/src/folder2/tsconfig.json"], + [Diagnostics.Project_0_is_out_of_date_because_output_file_1_does_not_exist, "src/tests/tsconfig.json", "src/tests/index.js"], + [Diagnostics.Building_project_0, "/src/tests/tsconfig.json"], + ); + verifyOutputsPresent(fs, [ + ...outputs("/src/src/folder"), + ...outputs("/src/src/folder2"), + ...outputs("/src/tests"), + ]); + host.clearDiagnostics(); + createSolutionBuilder(host, ["/src"], { verbose: true }).build(); + host.assertDiagnosticMessages( + getExpectedDiagnosticForProjectsInBuild("src/src/folder/tsconfig.json", "src/src/folder2/tsconfig.json", "src/src/tsconfig.json", "src/tests/tsconfig.json", "src/tsconfig.json"), + [Diagnostics.Project_0_is_up_to_date_because_newest_input_1_is_older_than_oldest_output_2, "src/src/folder/tsconfig.json", "src/src/folder/index.ts", "src/src/folder/index.js"], + [Diagnostics.Project_0_is_up_to_date_because_newest_input_1_is_older_than_oldest_output_2, "src/src/folder2/tsconfig.json", "src/src/folder2/index.ts", "src/src/folder2/index.js"], + [Diagnostics.Project_0_is_up_to_date_because_newest_input_1_is_older_than_oldest_output_2, "src/tests/tsconfig.json", "src/tests/index.ts", "src/tests/index.js"], + ); + }); + }); +} diff --git a/src/testRunner/unittests/tsbuild/referencesWithRootDirInParent.ts b/src/testRunner/unittests/tsbuild/referencesWithRootDirInParent.ts index 186a43b3c3e..f6a2dca6c2e 100644 --- a/src/testRunner/unittests/tsbuild/referencesWithRootDirInParent.ts +++ b/src/testRunner/unittests/tsbuild/referencesWithRootDirInParent.ts @@ -10,7 +10,6 @@ namespace ts { }); it("verify that it builds correctly", () => { - const projFs = loadProjectFromDisk("tests/projects/projectReferenceWithRootDirInParent"); const allExpectedOutputs = [ "/src/dist/other/other.js", "/src/dist/other/other.d.ts", "/src/dist/main/a.js", "/src/dist/main/a.d.ts", diff --git a/src/testRunner/unittests/tscWatch/resolutionCache.ts b/src/testRunner/unittests/tscWatch/resolutionCache.ts index b29fde85697..802b9c5bc52 100644 --- a/src/testRunner/unittests/tscWatch/resolutionCache.ts +++ b/src/testRunner/unittests/tscWatch/resolutionCache.ts @@ -54,7 +54,7 @@ namespace ts.tscWatch { root.content = `import {x} from "f2"`; host.reloadFS(files); - // trigger synchronization to make sure that LSHost will try to find 'f2' module on disk + // trigger synchronization to make sure that system will try to find 'f2' module on disk host.runQueuedTimeoutCallbacks(); // ensure file has correct number of errors after edit diff --git a/src/testRunner/unittests/tsserver/cachingFileSystemInformation.ts b/src/testRunner/unittests/tsserver/cachingFileSystemInformation.ts index 53a1cb4e421..688c8c49ebe 100644 --- a/src/testRunner/unittests/tsserver/cachingFileSystemInformation.ts +++ b/src/testRunner/unittests/tsserver/cachingFileSystemInformation.ts @@ -131,10 +131,10 @@ namespace ts.projectSystem { verifyImportedDiagnostics(); callsTrackingHost.verifyNoHostCalls(); - // trigger synchronization to make sure that LSHost will try to find 'f2' module on disk + // trigger synchronization to make sure that the host will try to find 'f2' module on disk editContent(`import {x} from "f2"`); try { - // trigger synchronization to make sure that LSHost will try to find 'f2' module on disk + // trigger synchronization to make sure that the host will try to find 'f2' module on disk verifyImportedDiagnostics(); assert.isTrue(false, `should not find file '${imported.path}'`); } diff --git a/src/testRunner/unittests/tsserver/resolutionCache.ts b/src/testRunner/unittests/tsserver/resolutionCache.ts index 441146ed33d..e9be75b90c1 100644 --- a/src/testRunner/unittests/tsserver/resolutionCache.ts +++ b/src/testRunner/unittests/tsserver/resolutionCache.ts @@ -5,7 +5,7 @@ namespace ts.projectSystem { return resolutionTrace; } - describe("unittests:: tsserver:: resolutionCache:: tsserverProjectSystem extra resolution pass in lshost", () => { + describe("unittests:: tsserver:: resolutionCache:: tsserverProjectSystem extra resolution pass in server host", () => { it("can load typings that are proper modules", () => { const file1 = { path: "/a/b/app.js", diff --git a/src/testRunner/unittests/tsserver/watchEnvironment.ts b/src/testRunner/unittests/tsserver/watchEnvironment.ts index bc8e84a8025..5e776aa9908 100644 --- a/src/testRunner/unittests/tsserver/watchEnvironment.ts +++ b/src/testRunner/unittests/tsserver/watchEnvironment.ts @@ -171,33 +171,37 @@ namespace ts.projectSystem { path: `${projectFolder}/node_modules/.cache/someFile.d.ts`, content: "" }; - host.ensureFileOrFolder(nodeModulesIgnoredFileFromIgnoreDirectory); - host.checkTimeoutQueueLength(0); - verifyProject(); const nodeModulesIgnoredFile: File = { path: `${projectFolder}/node_modules/.cacheFile.ts`, content: "" }; - host.ensureFileOrFolder(nodeModulesIgnoredFile); - host.checkTimeoutQueueLength(0); - verifyProject(); const gitIgnoredFileFromIgnoreDirectory: File = { path: `${projectFolder}/.git/someFile.d.ts`, content: "" }; - host.ensureFileOrFolder(gitIgnoredFileFromIgnoreDirectory); - host.checkTimeoutQueueLength(0); - verifyProject(); const gitIgnoredFile: File = { path: `${projectFolder}/.gitCache.d.ts`, content: "" }; - host.ensureFileOrFolder(gitIgnoredFile); - host.checkTimeoutQueueLength(0); - verifyProject(); + const emacsIgnoredFileFromIgnoreDirectory: File = { + path: `${projectFolder}/src/.#field.ts`, + content: "" + }; + + [ + nodeModulesIgnoredFileFromIgnoreDirectory, + nodeModulesIgnoredFile, + gitIgnoredFileFromIgnoreDirectory, + gitIgnoredFile, + emacsIgnoredFileFromIgnoreDirectory + ].forEach(ignoredEntity => { + host.ensureFileOrFolder(ignoredEntity); + host.checkTimeoutQueueLength(0); + verifyProject(); + }); function verifyProject() { checkWatchedDirectories(host, emptyArray, /*recursive*/ true); diff --git a/src/tsc/tsc.ts b/src/tsc/tsc.ts index 6a340109238..d27c1aace4e 100644 --- a/src/tsc/tsc.ts +++ b/src/tsc/tsc.ts @@ -186,6 +186,10 @@ namespace ts { // Update to pretty if host supports it updateReportDiagnostic(buildOptions); + if (buildOptions.locale) { + validateLocaleAndSetLanguage(buildOptions.locale, sys, errors); + } + if (errors.length > 0) { errors.forEach(reportDiagnostic); return sys.exit(ExitStatus.DiagnosticsPresent_OutputsSkipped); diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index cbab57b0644..82ab70b6e6f 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -2303,6 +2303,7 @@ declare namespace ts { MarkerType = 8192, JSLiteral = 16384, FreshLiteral = 32768, + ArrayLiteral = 65536, ClassOrInterface = 3, } interface ObjectType extends Type { diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index fd254a2fe50..0c55cff1275 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -2303,6 +2303,7 @@ declare namespace ts { MarkerType = 8192, JSLiteral = 16384, FreshLiteral = 32768, + ArrayLiteral = 65536, ClassOrInterface = 3, } interface ObjectType extends Type { diff --git a/tests/baselines/reference/arityErrorRelatedSpanBindingPattern.errors.txt b/tests/baselines/reference/arityErrorRelatedSpanBindingPattern.errors.txt index 788ff30c58f..3ebaaa1004f 100644 --- a/tests/baselines/reference/arityErrorRelatedSpanBindingPattern.errors.txt +++ b/tests/baselines/reference/arityErrorRelatedSpanBindingPattern.errors.txt @@ -8,12 +8,12 @@ tests/cases/compiler/arityErrorRelatedSpanBindingPattern.ts(7,1): error TS2554: function bar(a, b, [c]): void {} foo("", 0); - ~~~~~~~~~~ + ~~~ !!! error TS2554: Expected 3 arguments, but got 2. !!! related TS6211 tests/cases/compiler/arityErrorRelatedSpanBindingPattern.ts:1:20: An argument matching this binding pattern was not provided. bar("", 0); - ~~~~~~~~~~ + ~~~ !!! error TS2554: Expected 3 arguments, but got 2. !!! related TS6211 tests/cases/compiler/arityErrorRelatedSpanBindingPattern.ts:3:20: An argument matching this binding pattern was not provided. \ No newline at end of file diff --git a/tests/baselines/reference/arrayLiteralInference.js b/tests/baselines/reference/arrayLiteralInference.js new file mode 100644 index 00000000000..6b98b22394a --- /dev/null +++ b/tests/baselines/reference/arrayLiteralInference.js @@ -0,0 +1,65 @@ +//// [arrayLiteralInference.ts] +// Repro from #31204 + +export enum AppType { + HeaderDetail = 'HeaderDetail', + HeaderMultiDetail = 'HeaderMultiDetail', + AdvancedList = 'AdvancedList', + Standard = 'Standard', + Relationship = 'Relationship', + Report = 'Report', + Composite = 'Composite', + ListOnly = 'ListOnly', + ModuleSettings = 'ModuleSettings' +} + +export enum AppStyle { + Tree, + TreeEntity, + Standard, + MiniApp, + PivotTable +} + +const appTypeStylesWithError: Map> = new Map([ + [AppType.Standard, [AppStyle.Standard, AppStyle.MiniApp]], + [AppType.Relationship, [AppStyle.Standard, AppStyle.Tree, AppStyle.TreeEntity]], + [AppType.AdvancedList, [AppStyle.Standard, AppStyle.MiniApp]] +]); + +// Repro from #31204 + +declare function foo(...args: T[]): T[]; +let b1: { x: boolean }[] = foo({ x: true }, { x: false }); +let b2: boolean[][] = foo([true], [false]); + + +//// [arrayLiteralInference.js] +// Repro from #31204 +export var AppType; +(function (AppType) { + AppType["HeaderDetail"] = "HeaderDetail"; + AppType["HeaderMultiDetail"] = "HeaderMultiDetail"; + AppType["AdvancedList"] = "AdvancedList"; + AppType["Standard"] = "Standard"; + AppType["Relationship"] = "Relationship"; + AppType["Report"] = "Report"; + AppType["Composite"] = "Composite"; + AppType["ListOnly"] = "ListOnly"; + AppType["ModuleSettings"] = "ModuleSettings"; +})(AppType || (AppType = {})); +export var AppStyle; +(function (AppStyle) { + AppStyle[AppStyle["Tree"] = 0] = "Tree"; + AppStyle[AppStyle["TreeEntity"] = 1] = "TreeEntity"; + AppStyle[AppStyle["Standard"] = 2] = "Standard"; + AppStyle[AppStyle["MiniApp"] = 3] = "MiniApp"; + AppStyle[AppStyle["PivotTable"] = 4] = "PivotTable"; +})(AppStyle || (AppStyle = {})); +const appTypeStylesWithError = new Map([ + [AppType.Standard, [AppStyle.Standard, AppStyle.MiniApp]], + [AppType.Relationship, [AppStyle.Standard, AppStyle.Tree, AppStyle.TreeEntity]], + [AppType.AdvancedList, [AppStyle.Standard, AppStyle.MiniApp]] +]); +let b1 = foo({ x: true }, { x: false }); +let b2 = foo([true], [false]); diff --git a/tests/baselines/reference/arrayLiteralInference.symbols b/tests/baselines/reference/arrayLiteralInference.symbols new file mode 100644 index 00000000000..cdb89eb2061 --- /dev/null +++ b/tests/baselines/reference/arrayLiteralInference.symbols @@ -0,0 +1,119 @@ +=== tests/cases/conformance/expressions/arrayLiterals/arrayLiteralInference.ts === +// Repro from #31204 + +export enum AppType { +>AppType : Symbol(AppType, Decl(arrayLiteralInference.ts, 0, 0)) + + HeaderDetail = 'HeaderDetail', +>HeaderDetail : Symbol(AppType.HeaderDetail, Decl(arrayLiteralInference.ts, 2, 21)) + + HeaderMultiDetail = 'HeaderMultiDetail', +>HeaderMultiDetail : Symbol(AppType.HeaderMultiDetail, Decl(arrayLiteralInference.ts, 3, 34)) + + AdvancedList = 'AdvancedList', +>AdvancedList : Symbol(AppType.AdvancedList, Decl(arrayLiteralInference.ts, 4, 44)) + + Standard = 'Standard', +>Standard : Symbol(AppType.Standard, Decl(arrayLiteralInference.ts, 5, 34)) + + Relationship = 'Relationship', +>Relationship : Symbol(AppType.Relationship, Decl(arrayLiteralInference.ts, 6, 26)) + + Report = 'Report', +>Report : Symbol(AppType.Report, Decl(arrayLiteralInference.ts, 7, 34)) + + Composite = 'Composite', +>Composite : Symbol(AppType.Composite, Decl(arrayLiteralInference.ts, 8, 22)) + + ListOnly = 'ListOnly', +>ListOnly : Symbol(AppType.ListOnly, Decl(arrayLiteralInference.ts, 9, 28)) + + ModuleSettings = 'ModuleSettings' +>ModuleSettings : Symbol(AppType.ModuleSettings, Decl(arrayLiteralInference.ts, 10, 26)) +} + +export enum AppStyle { +>AppStyle : Symbol(AppStyle, Decl(arrayLiteralInference.ts, 12, 1)) + + Tree, +>Tree : Symbol(AppStyle.Tree, Decl(arrayLiteralInference.ts, 14, 22)) + + TreeEntity, +>TreeEntity : Symbol(AppStyle.TreeEntity, Decl(arrayLiteralInference.ts, 15, 9)) + + Standard, +>Standard : Symbol(AppStyle.Standard, Decl(arrayLiteralInference.ts, 16, 15)) + + MiniApp, +>MiniApp : Symbol(AppStyle.MiniApp, Decl(arrayLiteralInference.ts, 17, 13)) + + PivotTable +>PivotTable : Symbol(AppStyle.PivotTable, Decl(arrayLiteralInference.ts, 18, 12)) +} + +const appTypeStylesWithError: Map> = new Map([ +>appTypeStylesWithError : Symbol(appTypeStylesWithError, Decl(arrayLiteralInference.ts, 22, 5)) +>Map : Symbol(Map, Decl(lib.es2015.collection.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) +>AppType : Symbol(AppType, Decl(arrayLiteralInference.ts, 0, 0)) +>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) +>AppStyle : Symbol(AppStyle, Decl(arrayLiteralInference.ts, 12, 1)) +>Map : Symbol(Map, Decl(lib.es2015.collection.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) + + [AppType.Standard, [AppStyle.Standard, AppStyle.MiniApp]], +>AppType.Standard : Symbol(AppType.Standard, Decl(arrayLiteralInference.ts, 5, 34)) +>AppType : Symbol(AppType, Decl(arrayLiteralInference.ts, 0, 0)) +>Standard : Symbol(AppType.Standard, Decl(arrayLiteralInference.ts, 5, 34)) +>AppStyle.Standard : Symbol(AppStyle.Standard, Decl(arrayLiteralInference.ts, 16, 15)) +>AppStyle : Symbol(AppStyle, Decl(arrayLiteralInference.ts, 12, 1)) +>Standard : Symbol(AppStyle.Standard, Decl(arrayLiteralInference.ts, 16, 15)) +>AppStyle.MiniApp : Symbol(AppStyle.MiniApp, Decl(arrayLiteralInference.ts, 17, 13)) +>AppStyle : Symbol(AppStyle, Decl(arrayLiteralInference.ts, 12, 1)) +>MiniApp : Symbol(AppStyle.MiniApp, Decl(arrayLiteralInference.ts, 17, 13)) + + [AppType.Relationship, [AppStyle.Standard, AppStyle.Tree, AppStyle.TreeEntity]], +>AppType.Relationship : Symbol(AppType.Relationship, Decl(arrayLiteralInference.ts, 6, 26)) +>AppType : Symbol(AppType, Decl(arrayLiteralInference.ts, 0, 0)) +>Relationship : Symbol(AppType.Relationship, Decl(arrayLiteralInference.ts, 6, 26)) +>AppStyle.Standard : Symbol(AppStyle.Standard, Decl(arrayLiteralInference.ts, 16, 15)) +>AppStyle : Symbol(AppStyle, Decl(arrayLiteralInference.ts, 12, 1)) +>Standard : Symbol(AppStyle.Standard, Decl(arrayLiteralInference.ts, 16, 15)) +>AppStyle.Tree : Symbol(AppStyle.Tree, Decl(arrayLiteralInference.ts, 14, 22)) +>AppStyle : Symbol(AppStyle, Decl(arrayLiteralInference.ts, 12, 1)) +>Tree : Symbol(AppStyle.Tree, Decl(arrayLiteralInference.ts, 14, 22)) +>AppStyle.TreeEntity : Symbol(AppStyle.TreeEntity, Decl(arrayLiteralInference.ts, 15, 9)) +>AppStyle : Symbol(AppStyle, Decl(arrayLiteralInference.ts, 12, 1)) +>TreeEntity : Symbol(AppStyle.TreeEntity, Decl(arrayLiteralInference.ts, 15, 9)) + + [AppType.AdvancedList, [AppStyle.Standard, AppStyle.MiniApp]] +>AppType.AdvancedList : Symbol(AppType.AdvancedList, Decl(arrayLiteralInference.ts, 4, 44)) +>AppType : Symbol(AppType, Decl(arrayLiteralInference.ts, 0, 0)) +>AdvancedList : Symbol(AppType.AdvancedList, Decl(arrayLiteralInference.ts, 4, 44)) +>AppStyle.Standard : Symbol(AppStyle.Standard, Decl(arrayLiteralInference.ts, 16, 15)) +>AppStyle : Symbol(AppStyle, Decl(arrayLiteralInference.ts, 12, 1)) +>Standard : Symbol(AppStyle.Standard, Decl(arrayLiteralInference.ts, 16, 15)) +>AppStyle.MiniApp : Symbol(AppStyle.MiniApp, Decl(arrayLiteralInference.ts, 17, 13)) +>AppStyle : Symbol(AppStyle, Decl(arrayLiteralInference.ts, 12, 1)) +>MiniApp : Symbol(AppStyle.MiniApp, Decl(arrayLiteralInference.ts, 17, 13)) + +]); + +// Repro from #31204 + +declare function foo(...args: T[]): T[]; +>foo : Symbol(foo, Decl(arrayLiteralInference.ts, 26, 3)) +>T : Symbol(T, Decl(arrayLiteralInference.ts, 30, 21)) +>args : Symbol(args, Decl(arrayLiteralInference.ts, 30, 24)) +>T : Symbol(T, Decl(arrayLiteralInference.ts, 30, 21)) +>T : Symbol(T, Decl(arrayLiteralInference.ts, 30, 21)) + +let b1: { x: boolean }[] = foo({ x: true }, { x: false }); +>b1 : Symbol(b1, Decl(arrayLiteralInference.ts, 31, 3)) +>x : Symbol(x, Decl(arrayLiteralInference.ts, 31, 9)) +>foo : Symbol(foo, Decl(arrayLiteralInference.ts, 26, 3)) +>x : Symbol(x, Decl(arrayLiteralInference.ts, 31, 32)) +>x : Symbol(x, Decl(arrayLiteralInference.ts, 31, 45)) + +let b2: boolean[][] = foo([true], [false]); +>b2 : Symbol(b2, Decl(arrayLiteralInference.ts, 32, 3)) +>foo : Symbol(foo, Decl(arrayLiteralInference.ts, 26, 3)) + diff --git a/tests/baselines/reference/arrayLiteralInference.types b/tests/baselines/reference/arrayLiteralInference.types new file mode 100644 index 00000000000..fc7bdc8c032 --- /dev/null +++ b/tests/baselines/reference/arrayLiteralInference.types @@ -0,0 +1,139 @@ +=== tests/cases/conformance/expressions/arrayLiterals/arrayLiteralInference.ts === +// Repro from #31204 + +export enum AppType { +>AppType : AppType + + HeaderDetail = 'HeaderDetail', +>HeaderDetail : AppType.HeaderDetail +>'HeaderDetail' : "HeaderDetail" + + HeaderMultiDetail = 'HeaderMultiDetail', +>HeaderMultiDetail : AppType.HeaderMultiDetail +>'HeaderMultiDetail' : "HeaderMultiDetail" + + AdvancedList = 'AdvancedList', +>AdvancedList : AppType.AdvancedList +>'AdvancedList' : "AdvancedList" + + Standard = 'Standard', +>Standard : AppType.Standard +>'Standard' : "Standard" + + Relationship = 'Relationship', +>Relationship : AppType.Relationship +>'Relationship' : "Relationship" + + Report = 'Report', +>Report : AppType.Report +>'Report' : "Report" + + Composite = 'Composite', +>Composite : AppType.Composite +>'Composite' : "Composite" + + ListOnly = 'ListOnly', +>ListOnly : AppType.ListOnly +>'ListOnly' : "ListOnly" + + ModuleSettings = 'ModuleSettings' +>ModuleSettings : AppType.ModuleSettings +>'ModuleSettings' : "ModuleSettings" +} + +export enum AppStyle { +>AppStyle : AppStyle + + Tree, +>Tree : AppStyle.Tree + + TreeEntity, +>TreeEntity : AppStyle.TreeEntity + + Standard, +>Standard : AppStyle.Standard + + MiniApp, +>MiniApp : AppStyle.MiniApp + + PivotTable +>PivotTable : AppStyle.PivotTable +} + +const appTypeStylesWithError: Map> = new Map([ +>appTypeStylesWithError : Map +>new Map([ [AppType.Standard, [AppStyle.Standard, AppStyle.MiniApp]], [AppType.Relationship, [AppStyle.Standard, AppStyle.Tree, AppStyle.TreeEntity]], [AppType.AdvancedList, [AppStyle.Standard, AppStyle.MiniApp]]]) : Map +>Map : MapConstructor +>[ [AppType.Standard, [AppStyle.Standard, AppStyle.MiniApp]], [AppType.Relationship, [AppStyle.Standard, AppStyle.Tree, AppStyle.TreeEntity]], [AppType.AdvancedList, [AppStyle.Standard, AppStyle.MiniApp]]] : ([AppType.Standard, (AppStyle.Standard | AppStyle.MiniApp)[]] | [AppType.Relationship, (AppStyle.Tree | AppStyle.TreeEntity | AppStyle.Standard)[]] | [AppType.AdvancedList, (AppStyle.Standard | AppStyle.MiniApp)[]])[] + + [AppType.Standard, [AppStyle.Standard, AppStyle.MiniApp]], +>[AppType.Standard, [AppStyle.Standard, AppStyle.MiniApp]] : [AppType.Standard, (AppStyle.Standard | AppStyle.MiniApp)[]] +>AppType.Standard : AppType.Standard +>AppType : typeof AppType +>Standard : AppType.Standard +>[AppStyle.Standard, AppStyle.MiniApp] : (AppStyle.Standard | AppStyle.MiniApp)[] +>AppStyle.Standard : AppStyle.Standard +>AppStyle : typeof AppStyle +>Standard : AppStyle.Standard +>AppStyle.MiniApp : AppStyle.MiniApp +>AppStyle : typeof AppStyle +>MiniApp : AppStyle.MiniApp + + [AppType.Relationship, [AppStyle.Standard, AppStyle.Tree, AppStyle.TreeEntity]], +>[AppType.Relationship, [AppStyle.Standard, AppStyle.Tree, AppStyle.TreeEntity]] : [AppType.Relationship, (AppStyle.Tree | AppStyle.TreeEntity | AppStyle.Standard)[]] +>AppType.Relationship : AppType.Relationship +>AppType : typeof AppType +>Relationship : AppType.Relationship +>[AppStyle.Standard, AppStyle.Tree, AppStyle.TreeEntity] : (AppStyle.Tree | AppStyle.TreeEntity | AppStyle.Standard)[] +>AppStyle.Standard : AppStyle.Standard +>AppStyle : typeof AppStyle +>Standard : AppStyle.Standard +>AppStyle.Tree : AppStyle.Tree +>AppStyle : typeof AppStyle +>Tree : AppStyle.Tree +>AppStyle.TreeEntity : AppStyle.TreeEntity +>AppStyle : typeof AppStyle +>TreeEntity : AppStyle.TreeEntity + + [AppType.AdvancedList, [AppStyle.Standard, AppStyle.MiniApp]] +>[AppType.AdvancedList, [AppStyle.Standard, AppStyle.MiniApp]] : [AppType.AdvancedList, (AppStyle.Standard | AppStyle.MiniApp)[]] +>AppType.AdvancedList : AppType.AdvancedList +>AppType : typeof AppType +>AdvancedList : AppType.AdvancedList +>[AppStyle.Standard, AppStyle.MiniApp] : (AppStyle.Standard | AppStyle.MiniApp)[] +>AppStyle.Standard : AppStyle.Standard +>AppStyle : typeof AppStyle +>Standard : AppStyle.Standard +>AppStyle.MiniApp : AppStyle.MiniApp +>AppStyle : typeof AppStyle +>MiniApp : AppStyle.MiniApp + +]); + +// Repro from #31204 + +declare function foo(...args: T[]): T[]; +>foo : (...args: T[]) => T[] +>args : T[] + +let b1: { x: boolean }[] = foo({ x: true }, { x: false }); +>b1 : { x: boolean; }[] +>x : boolean +>foo({ x: true }, { x: false }) : ({ x: true; } | { x: false; })[] +>foo : (...args: T[]) => T[] +>{ x: true } : { x: true; } +>x : true +>true : true +>{ x: false } : { x: false; } +>x : false +>false : false + +let b2: boolean[][] = foo([true], [false]); +>b2 : boolean[][] +>foo([true], [false]) : (true[] | false[])[] +>foo : (...args: T[]) => T[] +>[true] : true[] +>true : true +>[false] : false[] +>false : false + diff --git a/tests/baselines/reference/baseCheck.errors.txt b/tests/baselines/reference/baseCheck.errors.txt index 67358a10338..359d689e3fe 100644 --- a/tests/baselines/reference/baseCheck.errors.txt +++ b/tests/baselines/reference/baseCheck.errors.txt @@ -30,7 +30,7 @@ tests/cases/compiler/baseCheck.ts(26,9): error TS2304: Cannot find name 'x'. } class D extends C { constructor(public z: number) { super(this.z) } } // too few params - ~~~~~~~~~~~~~ + ~~~~~ !!! error TS2554: Expected 2 arguments, but got 1. !!! related TS6210 tests/cases/compiler/baseCheck.ts:1:34: An argument for 'y' was not provided. ~~~~ diff --git a/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES5.errors.txt b/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES5.errors.txt index 407c1c22a37..96d23c6a304 100644 --- a/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES5.errors.txt +++ b/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES5.errors.txt @@ -33,6 +33,6 @@ tests/cases/compiler/blockScopedSameNameFunctionDeclarationES5.ts(16,1): error T } foo(10); foo(); // not ok - needs number - ~~~~~ + ~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 tests/cases/compiler/blockScopedSameNameFunctionDeclarationES5.ts:1:14: An argument for 'a' was not provided. \ No newline at end of file diff --git a/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES6.errors.txt b/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES6.errors.txt index 0a6109ee05f..da0e50d3086 100644 --- a/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES6.errors.txt +++ b/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES6.errors.txt @@ -33,6 +33,6 @@ tests/cases/compiler/blockScopedSameNameFunctionDeclarationES6.ts(16,1): error T } foo(10); foo(); // not ok - needs number - ~~~~~ + ~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 tests/cases/compiler/blockScopedSameNameFunctionDeclarationES6.ts:1:14: An argument for 'a' was not provided. \ No newline at end of file diff --git a/tests/baselines/reference/blockScopedSameNameFunctionDeclarationStrictES5.errors.txt b/tests/baselines/reference/blockScopedSameNameFunctionDeclarationStrictES5.errors.txt index b6c4ac4c6a5..c8c98c51917 100644 --- a/tests/baselines/reference/blockScopedSameNameFunctionDeclarationStrictES5.errors.txt +++ b/tests/baselines/reference/blockScopedSameNameFunctionDeclarationStrictES5.errors.txt @@ -29,12 +29,12 @@ tests/cases/compiler/blockScopedSameNameFunctionDeclarationStrictES5.ts(17,1): e } foo(10); foo(); // not ok - needs number - ~~~~~ + ~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 tests/cases/compiler/blockScopedSameNameFunctionDeclarationStrictES5.ts:2:14: An argument for 'a' was not provided. } foo(10); foo(); // not ok - needs number - ~~~~~ + ~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 tests/cases/compiler/blockScopedSameNameFunctionDeclarationStrictES5.ts:2:14: An argument for 'a' was not provided. \ No newline at end of file diff --git a/tests/baselines/reference/blockScopedSameNameFunctionDeclarationStrictES6.errors.txt b/tests/baselines/reference/blockScopedSameNameFunctionDeclarationStrictES6.errors.txt index d9b81d2686f..963b849ee72 100644 --- a/tests/baselines/reference/blockScopedSameNameFunctionDeclarationStrictES6.errors.txt +++ b/tests/baselines/reference/blockScopedSameNameFunctionDeclarationStrictES6.errors.txt @@ -23,12 +23,12 @@ tests/cases/compiler/blockScopedSameNameFunctionDeclarationStrictES6.ts(17,1): e } foo(10); foo(); // not ok - ~~~~~ + ~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 tests/cases/compiler/blockScopedSameNameFunctionDeclarationStrictES6.ts:2:14: An argument for 'a' was not provided. } foo(10); foo(); // not ok - needs number - ~~~~~ + ~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 tests/cases/compiler/blockScopedSameNameFunctionDeclarationStrictES6.ts:2:14: An argument for 'a' was not provided. \ No newline at end of file diff --git a/tests/baselines/reference/callOverload.errors.txt b/tests/baselines/reference/callOverload.errors.txt index 0f6a2ade085..b08bf7ce891 100644 --- a/tests/baselines/reference/callOverload.errors.txt +++ b/tests/baselines/reference/callOverload.errors.txt @@ -19,7 +19,7 @@ tests/cases/conformance/expressions/functionCalls/callOverload.ts(11,10): error !!! error TS2554: Expected 2 arguments, but got 4. withRest('a', ...n); // no error withRest(); - ~~~~~~~~~~ + ~~~~~~~~ !!! error TS2555: Expected at least 1 arguments, but got 0. !!! related TS6210 tests/cases/conformance/expressions/functionCalls/callOverload.ts:3:27: An argument for 'a' was not provided. withRest(...n); diff --git a/tests/baselines/reference/callWithMissingVoid.errors.txt b/tests/baselines/reference/callWithMissingVoid.errors.txt index 7ad2a481f2e..8b38f53acd4 100644 --- a/tests/baselines/reference/callWithMissingVoid.errors.txt +++ b/tests/baselines/reference/callWithMissingVoid.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/expressions/functionCalls/callWithMissingVoid.ts(16,1): error TS2554: Expected 1 arguments, but got 0. -tests/cases/conformance/expressions/functionCalls/callWithMissingVoid.ts(19,1): error TS2554: Expected 1 arguments, but got 0. -tests/cases/conformance/expressions/functionCalls/callWithMissingVoid.ts(22,1): error TS2554: Expected 1 arguments, but got 0. +tests/cases/conformance/expressions/functionCalls/callWithMissingVoid.ts(16,6): error TS2554: Expected 1 arguments, but got 0. +tests/cases/conformance/expressions/functionCalls/callWithMissingVoid.ts(19,10): error TS2554: Expected 1 arguments, but got 0. +tests/cases/conformance/expressions/functionCalls/callWithMissingVoid.ts(22,8): error TS2554: Expected 1 arguments, but got 0. tests/cases/conformance/expressions/functionCalls/callWithMissingVoid.ts(35,31): error TS2554: Expected 1 arguments, but got 0. tests/cases/conformance/expressions/functionCalls/callWithMissingVoid.ts(36,35): error TS2554: Expected 1 arguments, but got 0. tests/cases/conformance/expressions/functionCalls/callWithMissingVoid.ts(37,33): error TS2554: Expected 1 arguments, but got 0. @@ -28,19 +28,19 @@ tests/cases/conformance/expressions/functionCalls/callWithMissingVoid.ts(75,1): declare const xAny: X; xAny.f() // error, any still expects an argument - ~~~~~~~~ + ~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 tests/cases/conformance/expressions/functionCalls/callWithMissingVoid.ts:3:7: An argument for 't' was not provided. declare const xUnknown: X; xUnknown.f() // error, unknown still expects an argument - ~~~~~~~~~~~~ + ~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 tests/cases/conformance/expressions/functionCalls/callWithMissingVoid.ts:3:7: An argument for 't' was not provided. declare const xNever: X; xNever.f() // error, never still expects an argument - ~~~~~~~~~~ + ~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 tests/cases/conformance/expressions/functionCalls/callWithMissingVoid.ts:3:7: An argument for 't' was not provided. @@ -56,15 +56,15 @@ tests/cases/conformance/expressions/functionCalls/callWithMissingVoid.ts(75,1): new MyPromise(resolve => resolve()); // no error new MyPromise(resolve => resolve()); // no error new MyPromise(resolve => resolve()); // error, `any` arguments cannot be omitted - ~~~~~~~~~ + ~~~~~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 tests/cases/conformance/expressions/functionCalls/callWithMissingVoid.ts:28:38: An argument for 'value' was not provided. new MyPromise(resolve => resolve()); // error, `unknown` arguments cannot be omitted - ~~~~~~~~~ + ~~~~~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 tests/cases/conformance/expressions/functionCalls/callWithMissingVoid.ts:28:38: An argument for 'value' was not provided. new MyPromise(resolve => resolve()); // error, `never` arguments cannot be omitted - ~~~~~~~~~ + ~~~~~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 tests/cases/conformance/expressions/functionCalls/callWithMissingVoid.ts:28:38: An argument for 'value' was not provided. @@ -78,7 +78,7 @@ tests/cases/conformance/expressions/functionCalls/callWithMissingVoid.ts(75,1): a(4, "hello"); // ok a(4, "hello", void 0); // ok a(4); // not ok - ~~~~ + ~ !!! error TS2554: Expected 3 arguments, but got 1. !!! related TS6210 tests/cases/conformance/expressions/functionCalls/callWithMissingVoid.ts:42:23: An argument for 'y' was not provided. @@ -88,15 +88,15 @@ tests/cases/conformance/expressions/functionCalls/callWithMissingVoid.ts(75,1): b(4, "hello", void 0, 2); // ok b(4, "hello"); // not ok - ~~~~~~~~~~~~~ + ~ !!! error TS2554: Expected 4 arguments, but got 2. !!! related TS6210 tests/cases/conformance/expressions/functionCalls/callWithMissingVoid.ts:50:34: An argument for 'z' was not provided. b(4, "hello", void 0); // not ok - ~~~~~~~~~~~~~~~~~~~~~ + ~ !!! error TS2554: Expected 4 arguments, but got 3. !!! related TS6210 tests/cases/conformance/expressions/functionCalls/callWithMissingVoid.ts:50:43: An argument for 'what' was not provided. b(4); // not ok - ~~~~ + ~ !!! error TS2554: Expected 4 arguments, but got 1. !!! related TS6210 tests/cases/conformance/expressions/functionCalls/callWithMissingVoid.ts:50:23: An argument for 'y' was not provided. @@ -117,7 +117,7 @@ tests/cases/conformance/expressions/functionCalls/callWithMissingVoid.ts(75,1): ...args: TS): void; call((x: number, y: number) => x + y) // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~ !!! error TS2554: Expected 3 arguments, but got 1. !!! related TS6210 tests/cases/conformance/expressions/functionCalls/callWithMissingVoid.ts:73:5: An argument for 'args' was not provided. call((x: number, y: number) => x + y, 4, 2) // ok diff --git a/tests/baselines/reference/classCanExtendConstructorFunction.errors.txt b/tests/baselines/reference/classCanExtendConstructorFunction.errors.txt index 02c5940be14..26b83dc08a6 100644 --- a/tests/baselines/reference/classCanExtendConstructorFunction.errors.txt +++ b/tests/baselines/reference/classCanExtendConstructorFunction.errors.txt @@ -38,7 +38,7 @@ tests/cases/conformance/salsa/second.ts(17,15): error TS2345: Argument of type ' class Sql extends Wagon { constructor() { super(); // error: not enough arguments - ~~~~~~~ + ~~~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 tests/cases/conformance/salsa/first.js:5:16: An argument for 'numberOxen' was not provided. this.foonly = 12 diff --git a/tests/baselines/reference/contextualTypeWithTuple.errors.txt b/tests/baselines/reference/contextualTypeWithTuple.errors.txt index 14228786ef0..d4792119352 100644 --- a/tests/baselines/reference/contextualTypeWithTuple.errors.txt +++ b/tests/baselines/reference/contextualTypeWithTuple.errors.txt @@ -2,6 +2,8 @@ tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(3,5): error TS232 Types of property 'length' are incompatible. Type '3' is not assignable to type '2'. tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(15,1): error TS2322: Type '[number, string, boolean]' is not assignable to type '[number, string]'. + Types of property 'length' are incompatible. + Type '3' is not assignable to type '2'. tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(18,17): error TS2741: Property 'a' is missing in type '{}' but required in type '{ a: string; }'. tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(19,1): error TS2741: Property '2' is missing in type '[number, string]' but required in type '[number, string, boolean]'. tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(20,5): error TS2322: Type '[string, string, number]' is not assignable to type '[string, string]'. @@ -38,6 +40,8 @@ tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(25,1): error TS23 numStrTuple = numStrBoolTuple; ~~~~~~~~~~~ !!! error TS2322: Type '[number, string, boolean]' is not assignable to type '[number, string]'. +!!! error TS2322: Types of property 'length' are incompatible. +!!! error TS2322: Type '3' is not assignable to type '2'. // error objNumTuple = [ {}, 5]; diff --git a/tests/baselines/reference/declarationEmitDefaultExportWithStaticAssignment.js b/tests/baselines/reference/declarationEmitDefaultExportWithStaticAssignment.js new file mode 100644 index 00000000000..0edf3b6f01b --- /dev/null +++ b/tests/baselines/reference/declarationEmitDefaultExportWithStaticAssignment.js @@ -0,0 +1,114 @@ +//// [tests/cases/compiler/declarationEmitDefaultExportWithStaticAssignment.ts] //// + +//// [foo.ts] +export class Foo {} + +//// [index1.ts] +import {Foo} from './foo'; +export default function Example() {} +Example.Foo = Foo + +//// [index2.ts] +import {Foo} from './foo'; +export {Foo}; +export default function Example() {} +Example.Foo = Foo + +//// [index3.ts] +export class Bar {} +export default function Example() {} + +Example.Bar = Bar + +//// [index4.ts] +function A() { } + +function B() { } + +export function C() { + return null; +} + +C.A = A; +C.B = B; + +//// [foo.js] +"use strict"; +exports.__esModule = true; +var Foo = /** @class */ (function () { + function Foo() { + } + return Foo; +}()); +exports.Foo = Foo; +//// [index1.js] +"use strict"; +exports.__esModule = true; +var foo_1 = require("./foo"); +function Example() { } +exports["default"] = Example; +Example.Foo = foo_1.Foo; +//// [index2.js] +"use strict"; +exports.__esModule = true; +var foo_1 = require("./foo"); +exports.Foo = foo_1.Foo; +function Example() { } +exports["default"] = Example; +Example.Foo = foo_1.Foo; +//// [index3.js] +"use strict"; +exports.__esModule = true; +var Bar = /** @class */ (function () { + function Bar() { + } + return Bar; +}()); +exports.Bar = Bar; +function Example() { } +exports["default"] = Example; +Example.Bar = Bar; +//// [index4.js] +"use strict"; +exports.__esModule = true; +function A() { } +function B() { } +function C() { + return null; +} +exports.C = C; +C.A = A; +C.B = B; + + +//// [foo.d.ts] +export declare class Foo { +} +//// [index1.d.ts] +declare function Example(): void; +declare namespace Example { + var Foo: typeof import("./foo").Foo; +} +export default Example; +//// [index2.d.ts] +import { Foo } from './foo'; +export { Foo }; +declare function Example(): void; +declare namespace Example { + var Foo: typeof import("./foo").Foo; +} +export default Example; +//// [index3.d.ts] +export declare class Bar { +} +declare function Example(): void; +declare namespace Example { + var Bar: typeof import("./index3").Bar; +} +export default Example; +//// [index4.d.ts] +export declare function C(): any; +export declare namespace C { + var A: () => void; + var B: () => void; +} diff --git a/tests/baselines/reference/declarationEmitDefaultExportWithStaticAssignment.symbols b/tests/baselines/reference/declarationEmitDefaultExportWithStaticAssignment.symbols new file mode 100644 index 00000000000..f65952c18d7 --- /dev/null +++ b/tests/baselines/reference/declarationEmitDefaultExportWithStaticAssignment.symbols @@ -0,0 +1,71 @@ +=== tests/cases/compiler/foo.ts === +export class Foo {} +>Foo : Symbol(Foo, Decl(foo.ts, 0, 0)) + +=== tests/cases/compiler/index1.ts === +import {Foo} from './foo'; +>Foo : Symbol(Foo, Decl(index1.ts, 0, 8)) + +export default function Example() {} +>Example : Symbol(Example, Decl(index1.ts, 0, 26), Decl(index1.ts, 1, 36)) + +Example.Foo = Foo +>Example.Foo : Symbol(Example.Foo, Decl(index1.ts, 1, 36)) +>Example : Symbol(Example, Decl(index1.ts, 0, 26), Decl(index1.ts, 1, 36)) +>Foo : Symbol(Example.Foo, Decl(index1.ts, 1, 36)) +>Foo : Symbol(Foo, Decl(index1.ts, 0, 8)) + +=== tests/cases/compiler/index2.ts === +import {Foo} from './foo'; +>Foo : Symbol(Foo, Decl(index2.ts, 0, 8)) + +export {Foo}; +>Foo : Symbol(Foo, Decl(index2.ts, 1, 8)) + +export default function Example() {} +>Example : Symbol(Example, Decl(index2.ts, 1, 13), Decl(index2.ts, 2, 36)) + +Example.Foo = Foo +>Example.Foo : Symbol(Example.Foo, Decl(index2.ts, 2, 36)) +>Example : Symbol(Example, Decl(index2.ts, 1, 13), Decl(index2.ts, 2, 36)) +>Foo : Symbol(Example.Foo, Decl(index2.ts, 2, 36)) +>Foo : Symbol(Foo, Decl(index2.ts, 0, 8)) + +=== tests/cases/compiler/index3.ts === +export class Bar {} +>Bar : Symbol(Bar, Decl(index3.ts, 0, 0)) + +export default function Example() {} +>Example : Symbol(Example, Decl(index3.ts, 0, 19), Decl(index3.ts, 1, 36)) + +Example.Bar = Bar +>Example.Bar : Symbol(Example.Bar, Decl(index3.ts, 1, 36)) +>Example : Symbol(Example, Decl(index3.ts, 0, 19), Decl(index3.ts, 1, 36)) +>Bar : Symbol(Example.Bar, Decl(index3.ts, 1, 36)) +>Bar : Symbol(Bar, Decl(index3.ts, 0, 0)) + +=== tests/cases/compiler/index4.ts === +function A() { } +>A : Symbol(A, Decl(index4.ts, 0, 0)) + +function B() { } +>B : Symbol(B, Decl(index4.ts, 0, 17)) + +export function C() { +>C : Symbol(C, Decl(index4.ts, 2, 16), Decl(index4.ts, 6, 1)) + + return null; +} + +C.A = A; +>C.A : Symbol(C.A, Decl(index4.ts, 6, 1)) +>C : Symbol(C, Decl(index4.ts, 2, 16), Decl(index4.ts, 6, 1)) +>A : Symbol(C.A, Decl(index4.ts, 6, 1)) +>A : Symbol(A, Decl(index4.ts, 0, 0)) + +C.B = B; +>C.B : Symbol(C.B, Decl(index4.ts, 8, 8)) +>C : Symbol(C, Decl(index4.ts, 2, 16), Decl(index4.ts, 6, 1)) +>B : Symbol(C.B, Decl(index4.ts, 8, 8)) +>B : Symbol(B, Decl(index4.ts, 0, 17)) + diff --git a/tests/baselines/reference/declarationEmitDefaultExportWithStaticAssignment.types b/tests/baselines/reference/declarationEmitDefaultExportWithStaticAssignment.types new file mode 100644 index 00000000000..b00ddcd68cf --- /dev/null +++ b/tests/baselines/reference/declarationEmitDefaultExportWithStaticAssignment.types @@ -0,0 +1,77 @@ +=== tests/cases/compiler/foo.ts === +export class Foo {} +>Foo : Foo + +=== tests/cases/compiler/index1.ts === +import {Foo} from './foo'; +>Foo : typeof Foo + +export default function Example() {} +>Example : typeof Example + +Example.Foo = Foo +>Example.Foo = Foo : typeof Foo +>Example.Foo : typeof Foo +>Example : typeof Example +>Foo : typeof Foo +>Foo : typeof Foo + +=== tests/cases/compiler/index2.ts === +import {Foo} from './foo'; +>Foo : typeof Foo + +export {Foo}; +>Foo : typeof Foo + +export default function Example() {} +>Example : typeof Example + +Example.Foo = Foo +>Example.Foo = Foo : typeof Foo +>Example.Foo : typeof Foo +>Example : typeof Example +>Foo : typeof Foo +>Foo : typeof Foo + +=== tests/cases/compiler/index3.ts === +export class Bar {} +>Bar : Bar + +export default function Example() {} +>Example : typeof Example + +Example.Bar = Bar +>Example.Bar = Bar : typeof Bar +>Example.Bar : typeof Bar +>Example : typeof Example +>Bar : typeof Bar +>Bar : typeof Bar + +=== tests/cases/compiler/index4.ts === +function A() { } +>A : () => void + +function B() { } +>B : () => void + +export function C() { +>C : typeof C + + return null; +>null : null +} + +C.A = A; +>C.A = A : () => void +>C.A : () => void +>C : typeof C +>A : () => void +>A : () => void + +C.B = B; +>C.B = B : () => void +>C.B : () => void +>C : typeof C +>B : () => void +>B : () => void + diff --git a/tests/baselines/reference/declarationEmitExpandoWithGenericConstraint.js b/tests/baselines/reference/declarationEmitExpandoWithGenericConstraint.js new file mode 100644 index 00000000000..ac1054da110 --- /dev/null +++ b/tests/baselines/reference/declarationEmitExpandoWithGenericConstraint.js @@ -0,0 +1,38 @@ +//// [declarationEmitExpandoWithGenericConstraint.ts] +export interface Point { + readonly x: number; + readonly y: number; +} + +export interface Rect

{ + readonly a: p; + readonly b: p; +} + +export const Point = (x: number, y: number): Point => ({ x, y }); +export const Rect =

(a: p, b: p): Rect

=> ({ a, b }); + +Point.zero = (): Point => Point(0, 0); + +//// [declarationEmitExpandoWithGenericConstraint.js] +"use strict"; +exports.__esModule = true; +exports.Point = function (x, y) { return ({ x: x, y: y }); }; +exports.Rect = function (a, b) { return ({ a: a, b: b }); }; +exports.Point.zero = function () { return exports.Point(0, 0); }; + + +//// [declarationEmitExpandoWithGenericConstraint.d.ts] +export interface Point { + readonly x: number; + readonly y: number; +} +export interface Rect

{ + readonly a: p; + readonly b: p; +} +export declare const Point: { + (x: number, y: number): Point; + zero(): Point; +}; +export declare const Rect:

(a: p, b: p) => Rect

; diff --git a/tests/baselines/reference/declarationEmitExpandoWithGenericConstraint.symbols b/tests/baselines/reference/declarationEmitExpandoWithGenericConstraint.symbols new file mode 100644 index 00000000000..3d3300b3a3a --- /dev/null +++ b/tests/baselines/reference/declarationEmitExpandoWithGenericConstraint.symbols @@ -0,0 +1,53 @@ +=== tests/cases/compiler/declarationEmitExpandoWithGenericConstraint.ts === +export interface Point { +>Point : Symbol(Point, Decl(declarationEmitExpandoWithGenericConstraint.ts, 0, 0), Decl(declarationEmitExpandoWithGenericConstraint.ts, 10, 12), Decl(declarationEmitExpandoWithGenericConstraint.ts, 11, 73)) + + readonly x: number; +>x : Symbol(Point.x, Decl(declarationEmitExpandoWithGenericConstraint.ts, 0, 24)) + + readonly y: number; +>y : Symbol(Point.y, Decl(declarationEmitExpandoWithGenericConstraint.ts, 1, 23)) +} + +export interface Rect

{ +>Rect : Symbol(Rect, Decl(declarationEmitExpandoWithGenericConstraint.ts, 3, 1), Decl(declarationEmitExpandoWithGenericConstraint.ts, 11, 12)) +>p : Symbol(p, Decl(declarationEmitExpandoWithGenericConstraint.ts, 5, 22)) +>Point : Symbol(Point, Decl(declarationEmitExpandoWithGenericConstraint.ts, 0, 0), Decl(declarationEmitExpandoWithGenericConstraint.ts, 10, 12), Decl(declarationEmitExpandoWithGenericConstraint.ts, 11, 73)) + + readonly a: p; +>a : Symbol(Rect.a, Decl(declarationEmitExpandoWithGenericConstraint.ts, 5, 40)) +>p : Symbol(p, Decl(declarationEmitExpandoWithGenericConstraint.ts, 5, 22)) + + readonly b: p; +>b : Symbol(Rect.b, Decl(declarationEmitExpandoWithGenericConstraint.ts, 6, 18)) +>p : Symbol(p, Decl(declarationEmitExpandoWithGenericConstraint.ts, 5, 22)) +} + +export const Point = (x: number, y: number): Point => ({ x, y }); +>Point : Symbol(Point, Decl(declarationEmitExpandoWithGenericConstraint.ts, 0, 0), Decl(declarationEmitExpandoWithGenericConstraint.ts, 10, 12), Decl(declarationEmitExpandoWithGenericConstraint.ts, 11, 73)) +>x : Symbol(x, Decl(declarationEmitExpandoWithGenericConstraint.ts, 10, 22)) +>y : Symbol(y, Decl(declarationEmitExpandoWithGenericConstraint.ts, 10, 32)) +>Point : Symbol(Point, Decl(declarationEmitExpandoWithGenericConstraint.ts, 0, 0), Decl(declarationEmitExpandoWithGenericConstraint.ts, 10, 12), Decl(declarationEmitExpandoWithGenericConstraint.ts, 11, 73)) +>x : Symbol(x, Decl(declarationEmitExpandoWithGenericConstraint.ts, 10, 56)) +>y : Symbol(y, Decl(declarationEmitExpandoWithGenericConstraint.ts, 10, 59)) + +export const Rect =

(a: p, b: p): Rect

=> ({ a, b }); +>Rect : Symbol(Rect, Decl(declarationEmitExpandoWithGenericConstraint.ts, 3, 1), Decl(declarationEmitExpandoWithGenericConstraint.ts, 11, 12)) +>p : Symbol(p, Decl(declarationEmitExpandoWithGenericConstraint.ts, 11, 21)) +>Point : Symbol(Point, Decl(declarationEmitExpandoWithGenericConstraint.ts, 0, 0), Decl(declarationEmitExpandoWithGenericConstraint.ts, 10, 12), Decl(declarationEmitExpandoWithGenericConstraint.ts, 11, 73)) +>a : Symbol(a, Decl(declarationEmitExpandoWithGenericConstraint.ts, 11, 38)) +>p : Symbol(p, Decl(declarationEmitExpandoWithGenericConstraint.ts, 11, 21)) +>b : Symbol(b, Decl(declarationEmitExpandoWithGenericConstraint.ts, 11, 43)) +>p : Symbol(p, Decl(declarationEmitExpandoWithGenericConstraint.ts, 11, 21)) +>Rect : Symbol(Rect, Decl(declarationEmitExpandoWithGenericConstraint.ts, 3, 1), Decl(declarationEmitExpandoWithGenericConstraint.ts, 11, 12)) +>p : Symbol(p, Decl(declarationEmitExpandoWithGenericConstraint.ts, 11, 21)) +>a : Symbol(a, Decl(declarationEmitExpandoWithGenericConstraint.ts, 11, 64)) +>b : Symbol(b, Decl(declarationEmitExpandoWithGenericConstraint.ts, 11, 67)) + +Point.zero = (): Point => Point(0, 0); +>Point.zero : Symbol(Point.zero, Decl(declarationEmitExpandoWithGenericConstraint.ts, 11, 73)) +>Point : Symbol(Point, Decl(declarationEmitExpandoWithGenericConstraint.ts, 0, 0), Decl(declarationEmitExpandoWithGenericConstraint.ts, 10, 12), Decl(declarationEmitExpandoWithGenericConstraint.ts, 11, 73)) +>zero : Symbol(Point.zero, Decl(declarationEmitExpandoWithGenericConstraint.ts, 11, 73)) +>Point : Symbol(Point, Decl(declarationEmitExpandoWithGenericConstraint.ts, 0, 0), Decl(declarationEmitExpandoWithGenericConstraint.ts, 10, 12), Decl(declarationEmitExpandoWithGenericConstraint.ts, 11, 73)) +>Point : Symbol(Point, Decl(declarationEmitExpandoWithGenericConstraint.ts, 0, 0), Decl(declarationEmitExpandoWithGenericConstraint.ts, 10, 12), Decl(declarationEmitExpandoWithGenericConstraint.ts, 11, 73)) + diff --git a/tests/baselines/reference/declarationEmitExpandoWithGenericConstraint.types b/tests/baselines/reference/declarationEmitExpandoWithGenericConstraint.types new file mode 100644 index 00000000000..d4443fd0de4 --- /dev/null +++ b/tests/baselines/reference/declarationEmitExpandoWithGenericConstraint.types @@ -0,0 +1,48 @@ +=== tests/cases/compiler/declarationEmitExpandoWithGenericConstraint.ts === +export interface Point { + readonly x: number; +>x : number + + readonly y: number; +>y : number +} + +export interface Rect

{ + readonly a: p; +>a : p + + readonly b: p; +>b : p +} + +export const Point = (x: number, y: number): Point => ({ x, y }); +>Point : { (x: number, y: number): Point; zero(): Point; } +>(x: number, y: number): Point => ({ x, y }) : { (x: number, y: number): Point; zero(): Point; } +>x : number +>y : number +>({ x, y }) : { x: number; y: number; } +>{ x, y } : { x: number; y: number; } +>x : number +>y : number + +export const Rect =

(a: p, b: p): Rect

=> ({ a, b }); +>Rect :

(a: p, b: p) => Rect

+>

(a: p, b: p): Rect

=> ({ a, b }) :

(a: p, b: p) => Rect

+>a : p +>b : p +>({ a, b }) : { a: p; b: p; } +>{ a, b } : { a: p; b: p; } +>a : p +>b : p + +Point.zero = (): Point => Point(0, 0); +>Point.zero = (): Point => Point(0, 0) : () => Point +>Point.zero : () => Point +>Point : { (x: number, y: number): Point; zero(): Point; } +>zero : () => Point +>(): Point => Point(0, 0) : () => Point +>Point(0, 0) : Point +>Point : { (x: number, y: number): Point; zero(): Point; } +>0 : 0 +>0 : 0 + diff --git a/tests/baselines/reference/derivedTypeCallingBaseImplWithOptionalParams.errors.txt b/tests/baselines/reference/derivedTypeCallingBaseImplWithOptionalParams.errors.txt index 3dd001eb82c..54c58bd40b5 100644 --- a/tests/baselines/reference/derivedTypeCallingBaseImplWithOptionalParams.errors.txt +++ b/tests/baselines/reference/derivedTypeCallingBaseImplWithOptionalParams.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/derivedTypeCallingBaseImplWithOptionalParams.ts(13,1): error TS2554: Expected 1 arguments, but got 0. +tests/cases/compiler/derivedTypeCallingBaseImplWithOptionalParams.ts(13,3): error TS2554: Expected 1 arguments, but got 0. ==== tests/cases/compiler/derivedTypeCallingBaseImplWithOptionalParams.ts (1 errors) ==== @@ -15,6 +15,6 @@ tests/cases/compiler/derivedTypeCallingBaseImplWithOptionalParams.ts(13,1): erro var y: MyClass = new MyClass(); y.myMethod(); // error - ~~~~~~~~~~~~ + ~~~~~~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 tests/cases/compiler/derivedTypeCallingBaseImplWithOptionalParams.ts:5:14: An argument for 'myList' was not provided. \ No newline at end of file diff --git a/tests/baselines/reference/destructuringControlFlow.errors.txt b/tests/baselines/reference/destructuringControlFlow.errors.txt index 2bc85fdd638..e83a76942f0 100644 --- a/tests/baselines/reference/destructuringControlFlow.errors.txt +++ b/tests/baselines/reference/destructuringControlFlow.errors.txt @@ -1,9 +1,10 @@ tests/cases/conformance/es6/destructuring/destructuringControlFlow.ts(31,8): error TS2339: Property 'x' does not exist on type 'Number'. tests/cases/conformance/es6/destructuring/destructuringControlFlow.ts(32,9): error TS2339: Property 'x' does not exist on type 'Number'. tests/cases/conformance/es6/destructuring/destructuringControlFlow.ts(33,9): error TS2537: Type 'Number' has no matching index signature for type 'string'. +tests/cases/conformance/es6/destructuring/destructuringControlFlow.ts(40,1): error TS2532: Object is possibly 'undefined'. -==== tests/cases/conformance/es6/destructuring/destructuringControlFlow.ts (3 errors) ==== +==== tests/cases/conformance/es6/destructuring/destructuringControlFlow.ts (4 errors) ==== function f1(obj: { a?: string }) { if (obj.a) { obj = {}; @@ -44,4 +45,12 @@ tests/cases/conformance/es6/destructuring/destructuringControlFlow.ts(33,9): err ~~~~~~~~ !!! error TS2537: Type 'Number' has no matching index signature for type 'string'. } + + // Repro from #31770 + + type KeyValue = [string, string?]; + let [key, value]: KeyValue = ["foo"]; + value.toUpperCase(); // Error + ~~~~~ +!!! error TS2532: Object is possibly 'undefined'. \ No newline at end of file diff --git a/tests/baselines/reference/destructuringControlFlow.js b/tests/baselines/reference/destructuringControlFlow.js index 2d02fb5a40f..f3b5a8e0dd9 100644 --- a/tests/baselines/reference/destructuringControlFlow.js +++ b/tests/baselines/reference/destructuringControlFlow.js @@ -33,6 +33,12 @@ function f4() { ({ ["x"]: x } = 0); // Error ({ ["x" + ""]: x } = 0); // Errpr } + +// Repro from #31770 + +type KeyValue = [string, string?]; +let [key, value]: KeyValue = ["foo"]; +value.toUpperCase(); // Error //// [destructuringControlFlow.js] @@ -69,3 +75,5 @@ function f4() { (x = 0["x"]); // Error (_a = "x" + "", x = 0[_a]); // Errpr } +var _a = ["foo"], key = _a[0], value = _a[1]; +value.toUpperCase(); // Error diff --git a/tests/baselines/reference/destructuringControlFlow.symbols b/tests/baselines/reference/destructuringControlFlow.symbols index 75cbfcdb481..5e3fa6a365a 100644 --- a/tests/baselines/reference/destructuringControlFlow.symbols +++ b/tests/baselines/reference/destructuringControlFlow.symbols @@ -122,3 +122,16 @@ function f4() { >x : Symbol(x, Decl(destructuringControlFlow.ts, 29, 7)) } +// Repro from #31770 + +type KeyValue = [string, string?]; +>KeyValue : Symbol(KeyValue, Decl(destructuringControlFlow.ts, 33, 1)) + +let [key, value]: KeyValue = ["foo"]; +>key : Symbol(key, Decl(destructuringControlFlow.ts, 38, 5)) +>value : Symbol(value, Decl(destructuringControlFlow.ts, 38, 9)) +>KeyValue : Symbol(KeyValue, Decl(destructuringControlFlow.ts, 33, 1)) + +value.toUpperCase(); // Error +>value : Symbol(value, Decl(destructuringControlFlow.ts, 38, 9)) + diff --git a/tests/baselines/reference/destructuringControlFlow.types b/tests/baselines/reference/destructuringControlFlow.types index b831d116740..347aae32c10 100644 --- a/tests/baselines/reference/destructuringControlFlow.types +++ b/tests/baselines/reference/destructuringControlFlow.types @@ -158,3 +158,20 @@ function f4() { >0 : 0 } +// Repro from #31770 + +type KeyValue = [string, string?]; +>KeyValue : [string, (string | undefined)?] + +let [key, value]: KeyValue = ["foo"]; +>key : string +>value : string | undefined +>["foo"] : [string] +>"foo" : "foo" + +value.toUpperCase(); // Error +>value.toUpperCase() : any +>value.toUpperCase : any +>value : undefined +>toUpperCase : any + diff --git a/tests/baselines/reference/docker/azure-sdk.log b/tests/baselines/reference/docker/azure-sdk.log new file mode 100644 index 00000000000..e89b970b006 --- /dev/null +++ b/tests/baselines/reference/docker/azure-sdk.log @@ -0,0 +1,95 @@ +Exit Code: 1 +Standard output: + + +Rush Multi-Project Build Tool 5.7.3 - https://rushjs.io + + +Starting "rush rebuild" + +Executing a maximum of 1 simultaneous processes... + +[@azure/abort-controller] started +XX of XX: [@azure/abort-controller] completed successfully in ? seconds +[@azure/cosmos] started +XX of XX: [@azure/cosmos] completed successfully in ? seconds +[@azure/event-hubs] started +XX of XX: [@azure/event-hubs] completed successfully in ? seconds +[@azure/service-bus] started +Warning: You have changed the public API signature for this project. Updating review/service-bus.api.md +[@azure/storage-blob] started +XX of XX: [@azure/storage-blob] completed successfully in ? seconds +[@azure/storage-datalake] started +XX of XX: [@azure/storage-datalake] completed successfully in ? seconds +[@azure/storage-file] started +XX of XX: [@azure/storage-file] completed successfully in ? seconds +[@azure/storage-queue] started +XX of XX: [@azure/storage-queue] completed successfully in ? seconds +[@azure/template] started +XX of XX: [@azure/template] completed successfully in ? seconds +[@azure/core-http] started +XX of XX: [@azure/core-http] completed successfully in ? seconds +[@azure/core-paging] started +XX of XX: [@azure/core-paging] completed successfully in ? seconds +[@azure/event-processor-host] started +XX of XX: [@azure/event-processor-host] completed successfully in ? seconds +[testhub] started +XX of XX: [testhub] completed successfully in ? seconds +[@azure/identity] started +XX of XX: [@azure/identity] completed successfully in ? seconds +[@azure/core-amqp] started +[@azure/keyvault-certificates] started +XX of XX: [@azure/keyvault-certificates] completed successfully in ? seconds +[@azure/keyvault-keys] started +XX of XX: [@azure/keyvault-keys] completed successfully in ? seconds +[@azure/keyvault-secrets] started +XX of XX: [@azure/keyvault-secrets] completed successfully in ? seconds + +SUCCESS (16) +================================ +@azure/abort-controller (? seconds) +@azure/core-http (? seconds) +@azure/core-paging (? seconds) +@azure/cosmos (? seconds) +@azure/event-hubs (? seconds) +@azure/event-processor-host (? seconds) +@azure/identity (? seconds) +@azure/keyvault-certificates (? seconds) +@azure/keyvault-keys (? seconds) +@azure/keyvault-secrets (? seconds) +@azure/storage-blob (? seconds) +@azure/storage-datalake (? seconds) +@azure/storage-file (? seconds) +@azure/storage-queue (? seconds) +@azure/template (? seconds) +testhub (? seconds) +================================ + +SUCCESS WITH WARNINGS (1) +================================ +@azure/service-bus (? seconds) +Warning: You have changed the public API signature for this project. Updating review/service-bus.api.md +================================ + +FAILURE (1) +================================ +@azure/core-amqp (? seconds) +>>> @azure/core-amqp +tsc -p . && rollup -c 2>&1 +src/errors.ts(579,20): error TS7053: Element implicitly has an 'any' type because expression of type 'any' can't be used to index type 'typeof ConditionErrorNameMapper'. +src/errors.ts(600,34): error TS7053: Element implicitly has an 'any' type because expression of type 'any' can't be used to index type 'typeof SystemErrorConditionMapper'. +src/errors.ts(601,20): error TS7053: Element implicitly has an 'any' type because expression of type 'any' can't be used to index type 'typeof ConditionErrorNameMapper'. +================================ + + +Error: Project(s) failed to build +rush rebuild - Errors! ( ? seconds) + + + +Standard error: +Your version of Node.js (12.4.0) has not been tested with this release of Rush. The Rush team will not accept issue reports for it. Please consider upgrading Rush or downgrading Node.js. +XX of XX: [@azure/service-bus] completed with warnings in ? seconds + +XX of XX: [@azure/core-amqp] failed to build! +[@azure/core-amqp] Returned error code: 2 diff --git a/tests/baselines/reference/docker/office-ui-fabric.log b/tests/baselines/reference/docker/office-ui-fabric.log new file mode 100644 index 00000000000..536a28f1142 --- /dev/null +++ b/tests/baselines/reference/docker/office-ui-fabric.log @@ -0,0 +1,418 @@ +Exit Code: 1 +Standard output: + + +Rush Multi-Project Build Tool 5.6.0 - https://rushjs.io + + +Starting "rush rebuild" + +Executing a maximum of 1 simultaneous processes... + +[@uifabric/prettier-rules] started +XX of XX: [@uifabric/prettier-rules] completed successfully in ? seconds +[@uifabric/tslint-rules] started +XX of XX: [@uifabric/tslint-rules] completed successfully in ? seconds +[@uifabric/codepen-loader] started +ts-jest[versions] (WARN) Version X.X.X-insiders.xxxxxxxx of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=2.7.0 <4.0.0). Please do not report issues in ts-jest if you are using unsupported versions. +[@uifabric/build] started +XX of XX: [@uifabric/build] completed successfully in ? seconds +[@uifabric/migration] started +XX of XX: [@uifabric/migration] completed successfully in ? seconds +[@uifabric/set-version] started +ts-jest[versions] (WARN) Version X.X.X-insiders.xxxxxxxx of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=2.7.0 <4.0.0). Please do not report issues in ts-jest if you are using unsupported versions. +[@uifabric/merge-styles] started +ts-jest[versions] (WARN) Version X.X.X-insiders.xxxxxxxx of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=2.7.0 <4.0.0). Please do not report issues in ts-jest if you are using unsupported versions. +[@uifabric/jest-serializer-merge-styles] started +ts-jest[versions] (WARN) Version X.X.X-insiders.xxxxxxxx of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=2.7.0 <4.0.0). Please do not report issues in ts-jest if you are using unsupported versions. +[@uifabric/test-utilities] started +XX of XX: [@uifabric/test-utilities] completed successfully in ? seconds +[@uifabric/utilities] started +ts-jest[versions] (WARN) Version X.X.X-insiders.xxxxxxxx of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=2.7.0 <4.0.0). Please do not report issues in ts-jest if you are using unsupported versions. +[@uifabric/styling] started +ts-jest[versions] (WARN) Version X.X.X-insiders.xxxxxxxx of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=2.7.0 <4.0.0). Please do not report issues in ts-jest if you are using unsupported versions. +[@uifabric/file-type-icons] started +XX of XX: [@uifabric/file-type-icons] completed successfully in ? seconds +[@uifabric/foundation] started +ts-jest[versions] (WARN) Version X.X.X-insiders.xxxxxxxx of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=2.7.0 <4.0.0). Please do not report issues in ts-jest if you are using unsupported versions. + ● createFactory › passes componentProps without userProps + + RangeError: Invalid array length + + 189 | for (const props of allProps) { + 190 | classNames.push(props && props.className); + > 191 | assign(finalProps, ...(props as any)); + | ^ + 192 | } + 193 | + 194 | finalProps.className = mergeStyles(defaultStyles, classNames); + + at Object.__spreadArrays (../../common/temp/node_modules/.registry.npmjs.org/tslib/1.10.0/node_modules/tslib/tslib.js:182:22) + at _constructFinalProps (src/slots.tsx:191:11) + at result (src/slots.tsx:88:24) + at Object. (src/slots.test.tsx:205:73) + + ● createFactory › passes userProp string as child + + RangeError: Invalid array length + + 189 | for (const props of allProps) { + 190 | classNames.push(props && props.className); + > 191 | assign(finalProps, ...(props as any)); + | ^ + 192 | } + 193 | + 194 | finalProps.className = mergeStyles(defaultStyles, classNames); + + at Object.__spreadArrays (../../common/temp/node_modules/.registry.npmjs.org/tslib/1.10.0/node_modules/tslib/tslib.js:182:22) + at _constructFinalProps (src/slots.tsx:191:11) + at result (src/slots.tsx:88:24) + at Object. (src/slots.test.tsx:210:76) + + ● createFactory › passes userProp integer as child + + RangeError: Invalid array length + + 189 | for (const props of allProps) { + 190 | classNames.push(props && props.className); + > 191 | assign(finalProps, ...(props as any)); + | ^ + 192 | } + 193 | + 194 | finalProps.className = mergeStyles(defaultStyles, classNames); + + at Object.__spreadArrays (../../common/temp/node_modules/.registry.npmjs.org/tslib/1.10.0/node_modules/tslib/tslib.js:182:22) + at _constructFinalProps (src/slots.tsx:191:11) + at result (src/slots.tsx:88:24) + at Object. (src/slots.test.tsx:220:76) + + ● createFactory › passes userProp string as defaultProp + + RangeError: Invalid array length + + 189 | for (const props of allProps) { + 190 | classNames.push(props && props.className); + > 191 | assign(finalProps, ...(props as any)); + | ^ + 192 | } + 193 | + 194 | finalProps.className = mergeStyles(defaultStyles, classNames); + + at Object.__spreadArrays (../../common/temp/node_modules/.registry.npmjs.org/tslib/1.10.0/node_modules/tslib/tslib.js:182:22) + at _constructFinalProps (src/slots.tsx:191:11) + at result (src/slots.tsx:88:24) + at Object. (src/slots.test.tsx:225:92) + + ● createFactory › passes userProp integer as defaultProp + + RangeError: Invalid array length + + 189 | for (const props of allProps) { + 190 | classNames.push(props && props.className); + > 191 | assign(finalProps, ...(props as any)); + | ^ + 192 | } + 193 | + 194 | finalProps.className = mergeStyles(defaultStyles, classNames); + + at Object.__spreadArrays (../../common/temp/node_modules/.registry.npmjs.org/tslib/1.10.0/node_modules/tslib/tslib.js:182:22) + at _constructFinalProps (src/slots.tsx:191:11) + at result (src/slots.tsx:88:24) + at Object. (src/slots.test.tsx:235:92) + + ● createFactory › merges userProps over componentProps + + RangeError: Invalid array length + + 189 | for (const props of allProps) { + 190 | classNames.push(props && props.className); + > 191 | assign(finalProps, ...(props as any)); + | ^ + 192 | } + 193 | + 194 | finalProps.className = mergeStyles(defaultStyles, classNames); + + at Object.__spreadArrays (../../common/temp/node_modules/.registry.npmjs.org/tslib/1.10.0/node_modules/tslib/tslib.js:182:22) + at _constructFinalProps (src/slots.tsx:191:11) + at result (src/slots.tsx:88:24) + at Object. (src/slots.test.tsx:245:84) + + ● createFactory › renders div and userProp integer as children + + RangeError: Invalid array length + + 189 | for (const props of allProps) { + 190 | classNames.push(props && props.className); + > 191 | assign(finalProps, ...(props as any)); + | ^ + 192 | } + 193 | + 194 | finalProps.className = mergeStyles(defaultStyles, classNames); + + at Object.__spreadArrays (../../common/temp/node_modules/.registry.npmjs.org/tslib/1.10.0/node_modules/tslib/tslib.js:182:22) + at _constructFinalProps (src/slots.tsx:191:11) + at result (src/slots.tsx:88:24) + at Object. (src/slots.test.tsx:255:86) + + ● createFactory › renders div and userProp string as children + + RangeError: Invalid array length + + 189 | for (const props of allProps) { + 190 | classNames.push(props && props.className); + > 191 | assign(finalProps, ...(props as any)); + | ^ + 192 | } + 193 | + 194 | finalProps.className = mergeStyles(defaultStyles, classNames); + + at Object.__spreadArrays (../../common/temp/node_modules/.registry.npmjs.org/tslib/1.10.0/node_modules/tslib/tslib.js:182:22) + at _constructFinalProps (src/slots.tsx:191:11) + at result (src/slots.tsx:88:24) + at Object. (src/slots.test.tsx:266:86) + + ● createFactory › renders userProp span function without component props + + RangeError: Invalid array length + + 189 | for (const props of allProps) { + 190 | classNames.push(props && props.className); + > 191 | assign(finalProps, ...(props as any)); + | ^ + 192 | } + 193 | + 194 | finalProps.className = mergeStyles(defaultStyles, classNames); + + at Object.__spreadArrays (../../common/temp/node_modules/.registry.npmjs.org/tslib/1.10.0/node_modules/tslib/tslib.js:182:22) + at _constructFinalProps (src/slots.tsx:191:11) + at result (src/slots.tsx:88:24) + at Object. (src/slots.test.tsx:288:61) + + ● createFactory › renders userProp span function with component props + + RangeError: Invalid array length + + 189 | for (const props of allProps) { + 190 | classNames.push(props && props.className); + > 191 | assign(finalProps, ...(props as any)); + | ^ + 192 | } + 193 | + 194 | finalProps.className = mergeStyles(defaultStyles, classNames); + + at Object.__spreadArrays (../../common/temp/node_modules/.registry.npmjs.org/tslib/1.10.0/node_modules/tslib/tslib.js:182:22) + at _constructFinalProps (src/slots.tsx:191:11) + at result (src/slots.tsx:88:24) + at Object. (src/slots.test.tsx:301:61) + + ● createFactory › renders userProp span component with component props + + RangeError: Invalid array length + + 189 | for (const props of allProps) { + 190 | classNames.push(props && props.className); + > 191 | assign(finalProps, ...(props as any)); + | ^ + 192 | } + 193 | + 194 | finalProps.className = mergeStyles(defaultStyles, classNames); + + at Object.__spreadArrays (../../common/temp/node_modules/.registry.npmjs.org/tslib/1.10.0/node_modules/tslib/tslib.js:182:22) + at _constructFinalProps (src/slots.tsx:191:11) + at result (src/slots.tsx:88:24) + at Object. (src/slots.test.tsx:314:61) + + ● createFactory › passes props and type arguments to userProp function + + RangeError: Invalid array length + + 189 | for (const props of allProps) { + 190 | classNames.push(props && props.className); + > 191 | assign(finalProps, ...(props as any)); + | ^ + 192 | } + 193 | + 194 | finalProps.className = mergeStyles(defaultStyles, classNames); + + at Object.__spreadArrays (../../common/temp/node_modules/.registry.npmjs.org/tslib/1.10.0/node_modules/tslib/tslib.js:182:22) + at _constructFinalProps (src/slots.tsx:191:11) + at result (src/slots.tsx:88:24) + at Object. (src/slots.test.tsx:334:43) + + ● getSlots › creates slots and passes merged props to them + + RangeError: Invalid array length + + 189 | for (const props of allProps) { + 190 | classNames.push(props && props.className); + > 191 | assign(finalProps, ...(props as any)); + | ^ + 192 | } + 193 | + 194 | finalProps.className = mergeStyles(defaultStyles, classNames); + + at Object.__spreadArrays (../../common/temp/node_modules/.registry.npmjs.org/tslib/1.10.0/node_modules/tslib/tslib.js:182:22) + at _constructFinalProps (src/slots.tsx:191:11) + at result (src/slots.tsx:88:24) + at _renderSlot (src/slots.tsx:221:100) + at Object.slot [as testSlot1] (src/slots.tsx:142:16) + at Object. (src/slots.test.tsx:399:24) + +[XX:XX:XX XM] x Error detected while running 'jest' +[XX:XX:XX XM] x ------------------------------------ +[XX:XX:XX XM] x Error: Command failed: /usr/local/bin/node /office-ui-fabric-react/common/temp/node_modules/jest/bin/jest.js --config /office-ui-fabric-react/packages/foundation/jest.config.js --passWithNoTests --colors + at ChildProcess. (/office-ui-fabric-react/common/temp/node_modules/.registry.npmjs.org/just-scripts-utils/0.8.1/node_modules/just-scripts-utils/lib/exec.js:70:31) + at ChildProcess.emit (events.js:200:13) + at ChildProcess.EventEmitter.emit (domain.js:494:23) + at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12) +[XX:XX:XX XM] x ------------------------------------ +[XX:XX:XX XM] x finished 'validate' in ?s with errors +[XX:XX:XX XM] x finished 'build' in ?s with errors +[XX:XX:XX XM] x Error previously detected. See above for error messages. +[@uifabric/icons] started +XX of XX: [@uifabric/icons] completed successfully in ? seconds +[@uifabric/webpack-utils] started +XX of XX: [@uifabric/webpack-utils] completed successfully in ? seconds + +SUCCESS (8) +================================ +@uifabric/build (? seconds) +@uifabric/file-type-icons (? seconds) +@uifabric/icons (? seconds) +@uifabric/migration (? seconds) +@uifabric/prettier-rules (? seconds) +@uifabric/test-utilities (? seconds) +@uifabric/tslint-rules (? seconds) +@uifabric/webpack-utils (? seconds) +================================ + +SUCCESS WITH WARNINGS (6) +================================ +@uifabric/codepen-loader (? seconds) +ts-jest[versions] (WARN) Version X.X.X-insiders.xxxxxxxx of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=2.7.0 <4.0.0). Please do not report issues in ts-jest if you are using unsupported versions. + +@uifabric/jest-serializer-merge-styles (? seconds) +ts-jest[versions] (WARN) Version X.X.X-insiders.xxxxxxxx of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=2.7.0 <4.0.0). Please do not report issues in ts-jest if you are using unsupported versions. + +@uifabric/merge-styles (? seconds) +ts-jest[versions] (WARN) Version X.X.X-insiders.xxxxxxxx of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=2.7.0 <4.0.0). Please do not report issues in ts-jest if you are using unsupported versions. + +@uifabric/set-version (? seconds) +ts-jest[versions] (WARN) Version X.X.X-insiders.xxxxxxxx of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=2.7.0 <4.0.0). Please do not report issues in ts-jest if you are using unsupported versions. + +@uifabric/styling (? seconds) +ts-jest[versions] (WARN) Version X.X.X-insiders.xxxxxxxx of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=2.7.0 <4.0.0). Please do not report issues in ts-jest if you are using unsupported versions. + +@uifabric/utilities (? seconds) +ts-jest[versions] (WARN) Version X.X.X-insiders.xxxxxxxx of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=2.7.0 <4.0.0). Please do not report issues in ts-jest if you are using unsupported versions. +================================ + +BLOCKED (26) +================================ +@uifabric/api-docs +@uifabric/azure-themes +@uifabric/charting +@uifabric/date-time +@uifabric/example-app-base +@uifabric/experiments +@uifabric/fabric-website +@uifabric/fabric-website-resources +@uifabric/fluent-theme +@uifabric/foundation-scenarios +@uifabric/lists +@uifabric/pr-deploy-site +@uifabric/react-cards +@uifabric/theme-samples +@uifabric/tsx-editor +@uifabric/variants +a11y-tests +dom-tests +office-ui-fabric-react +perf-test +server-rendered-app +ssr-tests +test-bundles +theming-designer +todo-app +vr-tests +================================ + +FAILURE (1) +================================ +@uifabric/foundation (? seconds) +ts-jest[versions] (WARN) Version X.X.X-insiders.xxxxxxxx of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=2.7.0 <4.0.0). Please do not report issues in ts-jest if you are using unsupported versions. + ● createFactory › passes componentProps without userProps + RangeError: Invalid array length + + 189 | for (const props of allProps) { + 190 | classNames.push(props && props.className); + > 191 | assign(finalProps, ...(props as any)); + | ^ + 192 | } + 193 | +[...179 lines omitted...] + 193 | + 194 | finalProps.className = mergeStyles(defaultStyles, classNames); + + at Object.__spreadArrays (../../common/temp/node_modules/.registry.npmjs.org/tslib/1.10.0/node_modules/tslib/tslib.js:182:22) + at _constructFinalProps (src/slots.tsx:191:11) + at result (src/slots.tsx:88:24) + at _renderSlot (src/slots.tsx:221:100) + at Object.slot [as testSlot1] (src/slots.tsx:142:16) + at Object. (src/slots.test.tsx:399:24) +[XX:XX:XX XM] x Error detected while running 'jest' +[XX:XX:XX XM] x ------------------------------------ +[XX:XX:XX XM] x Error: Command failed: /usr/local/bin/node /office-ui-fabric-react/common/temp/node_modules/jest/bin/jest.js --config /office-ui-fabric-react/packages/foundation/jest.config.js --passWithNoTests --colors + at ChildProcess. (/office-ui-fabric-react/common/temp/node_modules/.registry.npmjs.org/just-scripts-utils/0.8.1/node_modules/just-scripts-utils/lib/exec.js:70:31) + at ChildProcess.emit (events.js:200:13) + at ChildProcess.EventEmitter.emit (domain.js:494:23) + at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12) +[XX:XX:XX XM] x ------------------------------------ +[XX:XX:XX XM] x finished 'validate' in ?s with errors +[XX:XX:XX XM] x finished 'build' in ?s with errors +[XX:XX:XX XM] x Error previously detected. See above for error messages. +================================ + + +Error: Project(s) failed to build +rush rebuild - Errors! ( ? seconds) + + + +Standard error: +Your version of Node.js (12.4.0) has not been tested with this release of Rush. The Rush team will not accept issue reports for it. Please consider upgrading Rush or downgrading Node.js. +XX of XX: [@uifabric/codepen-loader] completed with warnings in ? seconds +XX of XX: [@uifabric/set-version] completed with warnings in ? seconds +XX of XX: [@uifabric/merge-styles] completed with warnings in ? seconds +XX of XX: [@uifabric/jest-serializer-merge-styles] completed with warnings in ? seconds +XX of XX: [@uifabric/utilities] completed with warnings in ? seconds +XX of XX: [@uifabric/styling] completed with warnings in ? seconds + +XX of XX: [@uifabric/foundation] failed to build! +XX of XX: [@uifabric/experiments] blocked by [@uifabric/foundation]! +XX of XX: [@uifabric/fabric-website] blocked by [@uifabric/foundation]! +XX of XX: [@uifabric/pr-deploy-site] blocked by [@uifabric/foundation]! +XX of XX: [@uifabric/react-cards] blocked by [@uifabric/foundation]! +XX of XX: [theming-designer] blocked by [@uifabric/foundation]! +XX of XX: [vr-tests] blocked by [@uifabric/foundation]! +XX of XX: [dom-tests] blocked by [@uifabric/foundation]! +XX of XX: [perf-test] blocked by [@uifabric/foundation]! +XX of XX: [test-bundles] blocked by [@uifabric/foundation]! +XX of XX: [office-ui-fabric-react] blocked by [@uifabric/foundation]! +XX of XX: [@uifabric/api-docs] blocked by [@uifabric/foundation]! +XX of XX: [@uifabric/fabric-website-resources] blocked by [@uifabric/foundation]! +XX of XX: [a11y-tests] blocked by [@uifabric/foundation]! +XX of XX: [ssr-tests] blocked by [@uifabric/foundation]! +XX of XX: [@uifabric/azure-themes] blocked by [@uifabric/foundation]! +XX of XX: [@uifabric/charting] blocked by [@uifabric/foundation]! +XX of XX: [@uifabric/date-time] blocked by [@uifabric/foundation]! +XX of XX: [@uifabric/example-app-base] blocked by [@uifabric/foundation]! +XX of XX: [@uifabric/foundation-scenarios] blocked by [@uifabric/foundation]! +XX of XX: [@uifabric/lists] blocked by [@uifabric/foundation]! +XX of XX: [@uifabric/fluent-theme] blocked by [@uifabric/foundation]! +XX of XX: [@uifabric/tsx-editor] blocked by [@uifabric/foundation]! +XX of XX: [@uifabric/theme-samples] blocked by [@uifabric/foundation]! +XX of XX: [@uifabric/variants] blocked by [@uifabric/foundation]! +XX of XX: [server-rendered-app] blocked by [@uifabric/foundation]! +XX of XX: [todo-app] blocked by [@uifabric/foundation]! +[@uifabric/foundation] Returned error code: 1 diff --git a/tests/baselines/reference/functionCall11.errors.txt b/tests/baselines/reference/functionCall11.errors.txt index 4fb06f83157..b35a38fd099 100644 --- a/tests/baselines/reference/functionCall11.errors.txt +++ b/tests/baselines/reference/functionCall11.errors.txt @@ -8,7 +8,7 @@ tests/cases/compiler/functionCall11.ts(6,15): error TS2554: Expected 1-2 argumen foo('foo', 1); foo('foo'); foo(); - ~~~~~ + ~~~ !!! error TS2554: Expected 1-2 arguments, but got 0. !!! related TS6210 tests/cases/compiler/functionCall11.ts:1:14: An argument for 'a' was not provided. foo(1, 'bar'); diff --git a/tests/baselines/reference/functionCall12.errors.txt b/tests/baselines/reference/functionCall12.errors.txt index 8b6c02b4804..0221a9006b7 100644 --- a/tests/baselines/reference/functionCall12.errors.txt +++ b/tests/baselines/reference/functionCall12.errors.txt @@ -8,7 +8,7 @@ tests/cases/compiler/functionCall12.ts(7,15): error TS2345: Argument of type '3' foo('foo', 1); foo('foo'); foo(); - ~~~~~ + ~~~ !!! error TS2554: Expected 1-3 arguments, but got 0. !!! related TS6210 tests/cases/compiler/functionCall12.ts:1:14: An argument for 'a' was not provided. foo(1, 'bar'); diff --git a/tests/baselines/reference/functionCall13.errors.txt b/tests/baselines/reference/functionCall13.errors.txt index 8e7b5ecc97a..4717d04f241 100644 --- a/tests/baselines/reference/functionCall13.errors.txt +++ b/tests/baselines/reference/functionCall13.errors.txt @@ -7,7 +7,7 @@ tests/cases/compiler/functionCall13.ts(5,5): error TS2345: Argument of type '1' foo('foo', 1); foo('foo'); foo(); - ~~~~~ + ~~~ !!! error TS2555: Expected at least 1 arguments, but got 0. !!! related TS6210 tests/cases/compiler/functionCall13.ts:1:14: An argument for 'a' was not provided. foo(1, 'bar'); diff --git a/tests/baselines/reference/functionCall16.errors.txt b/tests/baselines/reference/functionCall16.errors.txt index 220e2017b67..15e67bb6b14 100644 --- a/tests/baselines/reference/functionCall16.errors.txt +++ b/tests/baselines/reference/functionCall16.errors.txt @@ -11,7 +11,7 @@ tests/cases/compiler/functionCall16.ts(6,5): error TS2345: Argument of type '1' foo('foo'); foo('foo', 'bar'); foo(); - ~~~~~ + ~~~ !!! error TS2555: Expected at least 1 arguments, but got 0. !!! related TS6210 tests/cases/compiler/functionCall16.ts:1:14: An argument for 'a' was not provided. foo(1, 'bar'); diff --git a/tests/baselines/reference/functionCall17.errors.txt b/tests/baselines/reference/functionCall17.errors.txt index 5d1bfe98edd..8bb5a7e3e17 100644 --- a/tests/baselines/reference/functionCall17.errors.txt +++ b/tests/baselines/reference/functionCall17.errors.txt @@ -11,7 +11,7 @@ tests/cases/compiler/functionCall17.ts(6,12): error TS2345: Argument of type '1' !!! error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. foo('foo'); foo(); - ~~~~~ + ~~~ !!! error TS2555: Expected at least 1 arguments, but got 0. !!! related TS6210 tests/cases/compiler/functionCall17.ts:1:14: An argument for 'a' was not provided. foo(1, 'bar'); diff --git a/tests/baselines/reference/functionCall18.errors.txt b/tests/baselines/reference/functionCall18.errors.txt index 1744c76982f..dfd0ab9af4f 100644 --- a/tests/baselines/reference/functionCall18.errors.txt +++ b/tests/baselines/reference/functionCall18.errors.txt @@ -6,7 +6,7 @@ tests/cases/compiler/functionCall18.ts(4,1): error TS2554: Expected 2 arguments, declare function foo(a: T, b: T); declare function foo(a: {}); foo("hello"); - ~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS2554: Expected 2 arguments, but got 1. !!! related TS6210 tests/cases/compiler/functionCall18.ts:2:31: An argument for 'b' was not provided. \ No newline at end of file diff --git a/tests/baselines/reference/functionCall6.errors.txt b/tests/baselines/reference/functionCall6.errors.txt index af3d4a0be22..585c12aa354 100644 --- a/tests/baselines/reference/functionCall6.errors.txt +++ b/tests/baselines/reference/functionCall6.errors.txt @@ -13,7 +13,7 @@ tests/cases/compiler/functionCall6.ts(5,1): error TS2554: Expected 1 arguments, ~~~~~ !!! error TS2554: Expected 1 arguments, but got 2. foo(); - ~~~~~ + ~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 tests/cases/compiler/functionCall6.ts:1:14: An argument for 'a' was not provided. \ No newline at end of file diff --git a/tests/baselines/reference/functionCall7.errors.txt b/tests/baselines/reference/functionCall7.errors.txt index 53a3c575ec3..31d0eb32008 100644 --- a/tests/baselines/reference/functionCall7.errors.txt +++ b/tests/baselines/reference/functionCall7.errors.txt @@ -15,7 +15,7 @@ tests/cases/compiler/functionCall7.ts(7,1): error TS2554: Expected 1 arguments, ~ !!! error TS2345: Argument of type '4' is not assignable to parameter of type 'c1'. foo(); - ~~~~~ + ~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 tests/cases/compiler/functionCall7.ts:2:14: An argument for 'a' was not provided. \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads29.errors.txt b/tests/baselines/reference/functionOverloads29.errors.txt index 908380417f9..3f0fdea31b4 100644 --- a/tests/baselines/reference/functionOverloads29.errors.txt +++ b/tests/baselines/reference/functionOverloads29.errors.txt @@ -6,7 +6,7 @@ tests/cases/compiler/functionOverloads29.ts(4,9): error TS2554: Expected 1 argum function foo(bar:number):number; function foo(bar:any):any{ return bar } var x = foo(); - ~~~~~ + ~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 tests/cases/compiler/functionOverloads29.ts:1:14: An argument for 'bar' was not provided. \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads34.errors.txt b/tests/baselines/reference/functionOverloads34.errors.txt index 1d032b7c34d..c83981b9159 100644 --- a/tests/baselines/reference/functionOverloads34.errors.txt +++ b/tests/baselines/reference/functionOverloads34.errors.txt @@ -6,7 +6,7 @@ tests/cases/compiler/functionOverloads34.ts(4,9): error TS2554: Expected 1 argum function foo(bar:{a:boolean;}):number; function foo(bar:{a:any;}):any{ return bar } var x = foo(); - ~~~~~ + ~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 tests/cases/compiler/functionOverloads34.ts:1:14: An argument for 'bar' was not provided. \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads37.errors.txt b/tests/baselines/reference/functionOverloads37.errors.txt index 9f0ac5ee0e5..7760944cd01 100644 --- a/tests/baselines/reference/functionOverloads37.errors.txt +++ b/tests/baselines/reference/functionOverloads37.errors.txt @@ -6,7 +6,7 @@ tests/cases/compiler/functionOverloads37.ts(4,9): error TS2554: Expected 1 argum function foo(bar:{a:boolean;}[]):number; function foo(bar:{a:any;}[]):any{ return bar } var x = foo(); - ~~~~~ + ~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 tests/cases/compiler/functionOverloads37.ts:1:14: An argument for 'bar' was not provided. \ No newline at end of file diff --git a/tests/baselines/reference/functionParameterArityMismatch.errors.txt b/tests/baselines/reference/functionParameterArityMismatch.errors.txt index aa870c23028..45533c6a3fa 100644 --- a/tests/baselines/reference/functionParameterArityMismatch.errors.txt +++ b/tests/baselines/reference/functionParameterArityMismatch.errors.txt @@ -11,11 +11,11 @@ tests/cases/compiler/functionParameterArityMismatch.ts(14,22): error TS2554: Exp declare function f1(a: number); declare function f1(a: number, b: number, c: number); f1(); - ~~~~ + ~~ !!! error TS2554: Expected 1-3 arguments, but got 0. !!! related TS6210 tests/cases/compiler/functionParameterArityMismatch.ts:1:21: An argument for 'a' was not provided. f1(1, 2); - ~~~~~~~~ + ~~ !!! error TS2575: No overload expects 2 arguments, but overloads do exist that expect either 1 or 3 arguments. f1(1, 2, 3, 4); ~ @@ -26,13 +26,13 @@ tests/cases/compiler/functionParameterArityMismatch.ts(14,22): error TS2554: Exp declare function f2(a: number, b: number, c: number, d: number); declare function f2(a: number, b: number, c: number, d: number, e: number, f: number); f2(1); - ~~~~~ + ~~ !!! error TS2575: No overload expects 1 arguments, but overloads do exist that expect either 0 or 2 arguments. f2(1, 2, 3); - ~~~~~~~~~~~ + ~~ !!! error TS2575: No overload expects 3 arguments, but overloads do exist that expect either 2 or 4 arguments. f2(1, 2, 3, 4, 5); - ~~~~~~~~~~~~~~~~~ + ~~ !!! error TS2575: No overload expects 5 arguments, but overloads do exist that expect either 4 or 6 arguments. f2(1, 2, 3, 4, 5, 6, 7); ~ diff --git a/tests/baselines/reference/genericFunctionsWithOptionalParameters2.errors.txt b/tests/baselines/reference/genericFunctionsWithOptionalParameters2.errors.txt index c4c1ce048c2..9eb49dbf9ba 100644 --- a/tests/baselines/reference/genericFunctionsWithOptionalParameters2.errors.txt +++ b/tests/baselines/reference/genericFunctionsWithOptionalParameters2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/genericFunctionsWithOptionalParameters2.ts(7,1): error TS2554: Expected 1-3 arguments, but got 0. +tests/cases/compiler/genericFunctionsWithOptionalParameters2.ts(7,7): error TS2554: Expected 1-3 arguments, but got 0. ==== tests/cases/compiler/genericFunctionsWithOptionalParameters2.ts (1 errors) ==== @@ -9,7 +9,7 @@ tests/cases/compiler/genericFunctionsWithOptionalParameters2.ts(7,1): error TS25 var utils: Utils; utils.fold(); // error - ~~~~~~~~~~~~ + ~~~~ !!! error TS2554: Expected 1-3 arguments, but got 0. !!! related TS6210 tests/cases/compiler/genericFunctionsWithOptionalParameters2.ts:2:15: An argument for 'c' was not provided. utils.fold(null); // no error diff --git a/tests/baselines/reference/genericRestArity.errors.txt b/tests/baselines/reference/genericRestArity.errors.txt index e9c98c35584..97889f68bd4 100644 --- a/tests/baselines/reference/genericRestArity.errors.txt +++ b/tests/baselines/reference/genericRestArity.errors.txt @@ -10,7 +10,7 @@ tests/cases/conformance/types/rest/genericRestArity.ts(8,45): error TS2554: Expe ...args: TS): void; call((x: number, y: number) => x + y); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~ !!! error TS2554: Expected 3 arguments, but got 1. !!! related TS6210 tests/cases/conformance/types/rest/genericRestArity.ts:5:5: An argument for 'args' was not provided. call((x: number, y: number) => x + y, 1, 2, 3, 4, 5, 6, 7); diff --git a/tests/baselines/reference/genericRestArityStrict.errors.txt b/tests/baselines/reference/genericRestArityStrict.errors.txt index c5fc4e9704f..d91611ab494 100644 --- a/tests/baselines/reference/genericRestArityStrict.errors.txt +++ b/tests/baselines/reference/genericRestArityStrict.errors.txt @@ -10,7 +10,7 @@ tests/cases/conformance/types/rest/genericRestArityStrict.ts(8,45): error TS2554 ...args: TS): void; call((x: number, y: number) => x + y); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~ !!! error TS2554: Expected 3 arguments, but got 1. !!! related TS6210 tests/cases/conformance/types/rest/genericRestArityStrict.ts:5:5: An argument for 'args' was not provided. call((x: number, y: number) => x + y, 1, 2, 3, 4, 5, 6, 7); diff --git a/tests/baselines/reference/genericRestParameters3.errors.txt b/tests/baselines/reference/genericRestParameters3.errors.txt index 612140ea940..417338401e3 100644 --- a/tests/baselines/reference/genericRestParameters3.errors.txt +++ b/tests/baselines/reference/genericRestParameters3.errors.txt @@ -87,7 +87,7 @@ tests/cases/conformance/types/rest/genericRestParameters3.ts(53,5): error TS2345 declare function foo(cb: (...args: T) => void): void; foo>(); // Error - ~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 tests/cases/conformance/types/rest/genericRestParameters3.ts:27:39: An argument for 'cb' was not provided. foo>(100); // Error diff --git a/tests/baselines/reference/iterableArrayPattern25.errors.txt b/tests/baselines/reference/iterableArrayPattern25.errors.txt index 0161be07d4b..d566c127e43 100644 --- a/tests/baselines/reference/iterableArrayPattern25.errors.txt +++ b/tests/baselines/reference/iterableArrayPattern25.errors.txt @@ -4,5 +4,5 @@ tests/cases/conformance/es6/destructuring/iterableArrayPattern25.ts(2,1): error ==== tests/cases/conformance/es6/destructuring/iterableArrayPattern25.ts (1 errors) ==== function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]) { } takeFirstTwoEntries(new Map([["", 0], ["hello", 1]])); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~ !!! error TS2554: Expected 2 arguments, but got 1. \ No newline at end of file diff --git a/tests/baselines/reference/jsFileFunctionParametersAsOptional2.errors.txt b/tests/baselines/reference/jsFileFunctionParametersAsOptional2.errors.txt index dda54d6dbe3..23b7c200b83 100644 --- a/tests/baselines/reference/jsFileFunctionParametersAsOptional2.errors.txt +++ b/tests/baselines/reference/jsFileFunctionParametersAsOptional2.errors.txt @@ -14,15 +14,15 @@ tests/cases/compiler/bar.ts(3,1): error TS2554: Expected 3 arguments, but got 2. ==== tests/cases/compiler/bar.ts (3 errors) ==== f(); // Error - ~~~ + ~ !!! error TS2554: Expected 3 arguments, but got 0. !!! related TS6210 tests/cases/compiler/foo.js:6:12: An argument for 'a' was not provided. f(1); // Error - ~~~~ + ~ !!! error TS2554: Expected 3 arguments, but got 1. !!! related TS6210 tests/cases/compiler/foo.js:6:15: An argument for 'b' was not provided. f(1, 2); // Error - ~~~~~~~ + ~ !!! error TS2554: Expected 3 arguments, but got 2. !!! related TS6210 tests/cases/compiler/foo.js:6:18: An argument for 'c' was not provided. diff --git a/tests/baselines/reference/jsdocTypeTagRequiredParameters.errors.txt b/tests/baselines/reference/jsdocTypeTagRequiredParameters.errors.txt index 3658797f87f..270050e0317 100644 --- a/tests/baselines/reference/jsdocTypeTagRequiredParameters.errors.txt +++ b/tests/baselines/reference/jsdocTypeTagRequiredParameters.errors.txt @@ -15,15 +15,15 @@ tests/cases/conformance/jsdoc/a.js(13,1): error TS2554: Expected 1 arguments, bu } f() // should error - ~~~ + ~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 tests/cases/conformance/jsdoc/a.js:1:21: An argument for '0' was not provided. g() // should error - ~~~ + ~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 tests/cases/conformance/jsdoc/a.js:5:12: An argument for 's' was not provided. h() - ~~~ + ~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 tests/cases/conformance/jsdoc/a.js:8:12: An argument for 's' was not provided. \ No newline at end of file diff --git a/tests/baselines/reference/methodChainError.errors.txt b/tests/baselines/reference/methodChainError.errors.txt new file mode 100644 index 00000000000..7cd4df95d40 --- /dev/null +++ b/tests/baselines/reference/methodChainError.errors.txt @@ -0,0 +1,16 @@ +tests/cases/compiler/methodChainError.ts(9,6): error TS2554: Expected 1 arguments, but got 0. + + +==== tests/cases/compiler/methodChainError.ts (1 errors) ==== + class Builder { + method(param: string): Builder { + return this; + } + } + + new Builder() + .method("a") + .method(); + ~~~~~~ +!!! error TS2554: Expected 1 arguments, but got 0. +!!! related TS6210 tests/cases/compiler/methodChainError.ts:2:12: An argument for 'param' was not provided. \ No newline at end of file diff --git a/tests/baselines/reference/methodChainError.js b/tests/baselines/reference/methodChainError.js new file mode 100644 index 00000000000..648ae505c7a --- /dev/null +++ b/tests/baselines/reference/methodChainError.js @@ -0,0 +1,23 @@ +//// [methodChainError.ts] +class Builder { + method(param: string): Builder { + return this; + } +} + +new Builder() + .method("a") + .method(); + +//// [methodChainError.js] +var Builder = /** @class */ (function () { + function Builder() { + } + Builder.prototype.method = function (param) { + return this; + }; + return Builder; +}()); +new Builder() + .method("a") + .method(); diff --git a/tests/baselines/reference/methodChainError.symbols b/tests/baselines/reference/methodChainError.symbols new file mode 100644 index 00000000000..e73024c784d --- /dev/null +++ b/tests/baselines/reference/methodChainError.symbols @@ -0,0 +1,25 @@ +=== tests/cases/compiler/methodChainError.ts === +class Builder { +>Builder : Symbol(Builder, Decl(methodChainError.ts, 0, 0)) + + method(param: string): Builder { +>method : Symbol(Builder.method, Decl(methodChainError.ts, 0, 15)) +>param : Symbol(param, Decl(methodChainError.ts, 1, 11)) +>Builder : Symbol(Builder, Decl(methodChainError.ts, 0, 0)) + + return this; +>this : Symbol(Builder, Decl(methodChainError.ts, 0, 0)) + } +} + +new Builder() +>new Builder() .method("a") .method : Symbol(Builder.method, Decl(methodChainError.ts, 0, 15)) +>new Builder() .method : Symbol(Builder.method, Decl(methodChainError.ts, 0, 15)) +>Builder : Symbol(Builder, Decl(methodChainError.ts, 0, 0)) + + .method("a") +>method : Symbol(Builder.method, Decl(methodChainError.ts, 0, 15)) + + .method(); +>method : Symbol(Builder.method, Decl(methodChainError.ts, 0, 15)) + diff --git a/tests/baselines/reference/methodChainError.types b/tests/baselines/reference/methodChainError.types new file mode 100644 index 00000000000..e66f6c54b45 --- /dev/null +++ b/tests/baselines/reference/methodChainError.types @@ -0,0 +1,28 @@ +=== tests/cases/compiler/methodChainError.ts === +class Builder { +>Builder : Builder + + method(param: string): Builder { +>method : (param: string) => Builder +>param : string + + return this; +>this : this + } +} + +new Builder() +>new Builder() .method("a") .method() : Builder +>new Builder() .method("a") .method : (param: string) => Builder +>new Builder() .method("a") : Builder +>new Builder() .method : (param: string) => Builder +>new Builder() : Builder +>Builder : typeof Builder + + .method("a") +>method : (param: string) => Builder +>"a" : "a" + + .method(); +>method : (param: string) => Builder + diff --git a/tests/baselines/reference/moduleExportWithExportPropertyAssignment.errors.txt b/tests/baselines/reference/moduleExportWithExportPropertyAssignment.errors.txt index e40138407d8..009022bdfe3 100644 --- a/tests/baselines/reference/moduleExportWithExportPropertyAssignment.errors.txt +++ b/tests/baselines/reference/moduleExportWithExportPropertyAssignment.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/salsa/a.js(4,1): error TS2554: Expected 1 arguments, but got 0. +tests/cases/conformance/salsa/a.js(4,6): error TS2554: Expected 1 arguments, but got 0. ==== tests/cases/conformance/salsa/a.js (1 errors) ==== @@ -6,7 +6,7 @@ tests/cases/conformance/salsa/a.js(4,1): error TS2554: Expected 1 arguments, but var mod1 = require('./mod1') mod1() mod1.f() // error, not enough arguments - ~~~~~~~~ + ~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 /.src/tests/cases/conformance/salsa/mod1.js:4:30: An argument for 'a' was not provided. diff --git a/tests/baselines/reference/objectLiteralNormalization.errors.txt b/tests/baselines/reference/objectLiteralNormalization.errors.txt index bc2dfdf2284..bd14787178b 100644 --- a/tests/baselines/reference/objectLiteralNormalization.errors.txt +++ b/tests/baselines/reference/objectLiteralNormalization.errors.txt @@ -9,9 +9,11 @@ tests/cases/conformance/expressions/objectLiterals/objectLiteralNormalization.ts Type 'string' is not assignable to type 'undefined'. tests/cases/conformance/expressions/objectLiterals/objectLiteralNormalization.ts(18,1): error TS2322: Type '{ a: number; }' is not assignable to type '{ a: number; b: number; } | { a: string; b?: undefined; } | { a?: undefined; b?: undefined; }'. Property 'b' is missing in type '{ a: number; }' but required in type '{ a: number; b: number; }'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralNormalization.ts(48,20): error TS2322: Type '2' is not assignable to type '1'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralNormalization.ts(49,14): error TS2322: Type '2' is not assignable to type '1'. -==== tests/cases/conformance/expressions/objectLiterals/objectLiteralNormalization.ts (5 errors) ==== +==== tests/cases/conformance/expressions/objectLiterals/objectLiteralNormalization.ts (7 errors) ==== // Object literals in unions are normalized upon widening let a1 = [{ a: 0 }, { a: 1, b: "x" }, { a: 2, b: "y", c: true }][0]; a1.a; // number @@ -78,5 +80,11 @@ tests/cases/conformance/expressions/objectLiterals/objectLiteralNormalization.ts let e1 = f({ a: 1, b: 2 }, { a: "abc" }, {}); let e2 = f({}, { a: "abc" }, { a: 1, b: 2 }); let e3 = f(data, { a: 2 }); + ~ +!!! error TS2322: Type '2' is not assignable to type '1'. +!!! related TS6500 tests/cases/conformance/expressions/objectLiterals/objectLiteralNormalization.ts:43:21: The expected type comes from property 'a' which is declared here on type '{ a: 1; b: "abc"; c: true; }' let e4 = f({ a: 2 }, data); + ~ +!!! error TS2322: Type '2' is not assignable to type '1'. +!!! related TS6500 tests/cases/conformance/expressions/objectLiterals/objectLiteralNormalization.ts:43:21: The expected type comes from property 'a' which is declared here on type '{ a: 1; b: "abc"; c: true; }' \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralNormalization.js b/tests/baselines/reference/objectLiteralNormalization.js index 0d27e3a954d..1a8aa8d4b04 100644 --- a/tests/baselines/reference/objectLiteralNormalization.js +++ b/tests/baselines/reference/objectLiteralNormalization.js @@ -227,9 +227,5 @@ declare let e2: { a: number; b: number; }; -declare let e3: { - a: number; -}; -declare let e4: { - a: number; -}; +declare let e3: any; +declare let e4: any; diff --git a/tests/baselines/reference/objectLiteralNormalization.types b/tests/baselines/reference/objectLiteralNormalization.types index fbef2e824be..15c3b6b3ecf 100644 --- a/tests/baselines/reference/objectLiteralNormalization.types +++ b/tests/baselines/reference/objectLiteralNormalization.types @@ -304,8 +304,8 @@ let e2 = f({}, { a: "abc" }, { a: 1, b: 2 }); >2 : 2 let e3 = f(data, { a: 2 }); ->e3 : { a: number; } ->f(data, { a: 2 }) : { a: number; } +>e3 : any +>f(data, { a: 2 }) : any >f : (...items: T[]) => T >data : { a: 1; b: "abc"; c: true; } >{ a: 2 } : { a: number; } @@ -313,8 +313,8 @@ let e3 = f(data, { a: 2 }); >2 : 2 let e4 = f({ a: 2 }, data); ->e4 : { a: number; } ->f({ a: 2 }, data) : { a: number; } +>e4 : any +>f({ a: 2 }, data) : any >f : (...items: T[]) => T >{ a: 2 } : { a: number; } >a : number diff --git a/tests/baselines/reference/optionalParamArgsTest.errors.txt b/tests/baselines/reference/optionalParamArgsTest.errors.txt index dd53f5eeca1..5b7c500db0c 100644 --- a/tests/baselines/reference/optionalParamArgsTest.errors.txt +++ b/tests/baselines/reference/optionalParamArgsTest.errors.txt @@ -4,8 +4,8 @@ tests/cases/compiler/optionalParamArgsTest.ts(98,11): error TS2554: Expected 0 a tests/cases/compiler/optionalParamArgsTest.ts(99,11): error TS2554: Expected 0 arguments, but got 1. tests/cases/compiler/optionalParamArgsTest.ts(100,4): error TS2554: Expected 0 arguments, but got 1. tests/cases/compiler/optionalParamArgsTest.ts(101,4): error TS2554: Expected 0 arguments, but got 1. -tests/cases/compiler/optionalParamArgsTest.ts(102,1): error TS2554: Expected 1 arguments, but got 0. -tests/cases/compiler/optionalParamArgsTest.ts(103,1): error TS2554: Expected 1 arguments, but got 0. +tests/cases/compiler/optionalParamArgsTest.ts(102,6): error TS2554: Expected 1 arguments, but got 0. +tests/cases/compiler/optionalParamArgsTest.ts(103,6): error TS2554: Expected 1 arguments, but got 0. tests/cases/compiler/optionalParamArgsTest.ts(104,1): error TS2554: Expected 1 arguments, but got 0. tests/cases/compiler/optionalParamArgsTest.ts(105,1): error TS2554: Expected 1 arguments, but got 0. tests/cases/compiler/optionalParamArgsTest.ts(106,13): error TS2554: Expected 1 arguments, but got 2. @@ -16,8 +16,8 @@ tests/cases/compiler/optionalParamArgsTest.ts(110,15): error TS2554: Expected 0- tests/cases/compiler/optionalParamArgsTest.ts(111,15): error TS2554: Expected 0-2 arguments, but got 3. tests/cases/compiler/optionalParamArgsTest.ts(112,8): error TS2554: Expected 0-2 arguments, but got 3. tests/cases/compiler/optionalParamArgsTest.ts(113,8): error TS2554: Expected 0-2 arguments, but got 3. -tests/cases/compiler/optionalParamArgsTest.ts(114,1): error TS2554: Expected 1-2 arguments, but got 0. -tests/cases/compiler/optionalParamArgsTest.ts(115,1): error TS2554: Expected 1-2 arguments, but got 0. +tests/cases/compiler/optionalParamArgsTest.ts(114,6): error TS2554: Expected 1-2 arguments, but got 0. +tests/cases/compiler/optionalParamArgsTest.ts(115,6): error TS2554: Expected 1-2 arguments, but got 0. tests/cases/compiler/optionalParamArgsTest.ts(116,1): error TS2554: Expected 1-2 arguments, but got 0. tests/cases/compiler/optionalParamArgsTest.ts(117,1): error TS2554: Expected 1-2 arguments, but got 0. @@ -137,19 +137,19 @@ tests/cases/compiler/optionalParamArgsTest.ts(117,1): error TS2554: Expected 1-2 ~ !!! error TS2554: Expected 0 arguments, but got 1. c1o1.C1M2(); - ~~~~~~~~~~~ + ~~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 tests/cases/compiler/optionalParamArgsTest.ts:23:17: An argument for 'C1M2A1' was not provided. i1o1.C1M2(); - ~~~~~~~~~~~ + ~~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 tests/cases/compiler/optionalParamArgsTest.ts:11:10: An argument for 'C1M2A1' was not provided. F2(); - ~~~~ + ~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 tests/cases/compiler/optionalParamArgsTest.ts:45:13: An argument for 'F2A1' was not provided. L2(); - ~~~~ + ~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 tests/cases/compiler/optionalParamArgsTest.ts:50:20: An argument for 'L2A1' was not provided. c1o1.C1M2(1,2); @@ -177,19 +177,19 @@ tests/cases/compiler/optionalParamArgsTest.ts(117,1): error TS2554: Expected 1-2 ~ !!! error TS2554: Expected 0-2 arguments, but got 3. c1o1.C1M4(); - ~~~~~~~~~~~ + ~~~~ !!! error TS2554: Expected 1-2 arguments, but got 0. !!! related TS6210 tests/cases/compiler/optionalParamArgsTest.ts:29:17: An argument for 'C1M4A1' was not provided. i1o1.C1M4(); - ~~~~~~~~~~~ + ~~~~ !!! error TS2554: Expected 1-2 arguments, but got 0. !!! related TS6210 tests/cases/compiler/optionalParamArgsTest.ts:13:10: An argument for 'C1M4A1' was not provided. F4(); - ~~~~ + ~~ !!! error TS2554: Expected 1-2 arguments, but got 0. !!! related TS6210 tests/cases/compiler/optionalParamArgsTest.ts:47:13: An argument for 'F4A1' was not provided. L4(); - ~~~~ + ~~ !!! error TS2554: Expected 1-2 arguments, but got 0. !!! related TS6210 tests/cases/compiler/optionalParamArgsTest.ts:52:20: An argument for 'L4A1' was not provided. diff --git a/tests/baselines/reference/overload1.errors.txt b/tests/baselines/reference/overload1.errors.txt index aa58f23b95a..6adc8b8b579 100644 --- a/tests/baselines/reference/overload1.errors.txt +++ b/tests/baselines/reference/overload1.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/overload1.ts(27,5): error TS2322: Type 'C' is not assignable to type 'string'. tests/cases/compiler/overload1.ts(29,1): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/compiler/overload1.ts(31,11): error TS2554: Expected 1-2 arguments, but got 3. -tests/cases/compiler/overload1.ts(32,3): error TS2554: Expected 1-2 arguments, but got 0. +tests/cases/compiler/overload1.ts(32,5): error TS2554: Expected 1-2 arguments, but got 0. tests/cases/compiler/overload1.ts(33,1): error TS2322: Type 'C' is not assignable to type 'string'. tests/cases/compiler/overload1.ts(34,9): error TS2345: Argument of type '2' is not assignable to parameter of type 'string'. @@ -45,7 +45,7 @@ tests/cases/compiler/overload1.ts(34,9): error TS2345: Argument of type '2' is n ~ !!! error TS2554: Expected 1-2 arguments, but got 3. z=x.g(); // no match - ~~~~~ + ~ !!! error TS2554: Expected 1-2 arguments, but got 0. !!! related TS6210 tests/cases/compiler/overload1.ts:17:11: An argument for 'n' was not provided. z=x.g(new O.B()); // ambiguous (up and down conversion) diff --git a/tests/baselines/reference/overloadsAndTypeArgumentArityErrors.errors.txt b/tests/baselines/reference/overloadsAndTypeArgumentArityErrors.errors.txt index 6b64cd8a773..95e9bf27d23 100644 --- a/tests/baselines/reference/overloadsAndTypeArgumentArityErrors.errors.txt +++ b/tests/baselines/reference/overloadsAndTypeArgumentArityErrors.errors.txt @@ -17,7 +17,7 @@ tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts(9,1): error TS2554: declare function f(arg: number): void; f(); // wrong number of arguments (#25683) - ~~~~~~~~~~~ + ~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts:8:31: An argument for 'arg' was not provided. \ No newline at end of file diff --git a/tests/baselines/reference/requiredInitializedParameter1.errors.txt b/tests/baselines/reference/requiredInitializedParameter1.errors.txt index f9baca7a1b5..e5963845d28 100644 --- a/tests/baselines/reference/requiredInitializedParameter1.errors.txt +++ b/tests/baselines/reference/requiredInitializedParameter1.errors.txt @@ -14,7 +14,7 @@ tests/cases/compiler/requiredInitializedParameter1.ts(16,1): error TS2554: Expec f4(0, 1, 2); f1(0, 1); - ~~~~~~~~ + ~~ !!! error TS2554: Expected 3 arguments, but got 2. !!! related TS6210 tests/cases/compiler/requiredInitializedParameter1.ts:1:23: An argument for 'c' was not provided. f2(0, 1); @@ -22,7 +22,7 @@ tests/cases/compiler/requiredInitializedParameter1.ts(16,1): error TS2554: Expec f4(0, 1); f1(0); - ~~~~~ + ~~ !!! error TS2554: Expected 3 arguments, but got 1. !!! related TS6210 tests/cases/compiler/requiredInitializedParameter1.ts:1:16: An argument for 'b' was not provided. f2(0); diff --git a/tests/baselines/reference/restParamsWithNonRestParams.errors.txt b/tests/baselines/reference/restParamsWithNonRestParams.errors.txt index 5bbcf92f702..067cf6c8267 100644 --- a/tests/baselines/reference/restParamsWithNonRestParams.errors.txt +++ b/tests/baselines/reference/restParamsWithNonRestParams.errors.txt @@ -6,7 +6,7 @@ tests/cases/compiler/restParamsWithNonRestParams.ts(4,1): error TS2555: Expected foo(); // ok function foo2(a:string, ...b:number[]){} foo2(); // should be an error - ~~~~~~ + ~~~~ !!! error TS2555: Expected at least 1 arguments, but got 0. !!! related TS6210 tests/cases/compiler/restParamsWithNonRestParams.ts:3:15: An argument for 'a' was not provided. function foo3(a?:string, ...b:number[]){} diff --git a/tests/baselines/reference/spreadOfParamsFromGeneratorMakesRequiredParams.errors.txt b/tests/baselines/reference/spreadOfParamsFromGeneratorMakesRequiredParams.errors.txt index 393e21edb6c..d37b20f7403 100644 --- a/tests/baselines/reference/spreadOfParamsFromGeneratorMakesRequiredParams.errors.txt +++ b/tests/baselines/reference/spreadOfParamsFromGeneratorMakesRequiredParams.errors.txt @@ -10,6 +10,6 @@ tests/cases/compiler/spreadOfParamsFromGeneratorMakesRequiredParams.ts(6,1): err ): any; call(function* (a: 'a') { }); // error, 2nd argument required - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~ !!! error TS2554: Expected 2 arguments, but got 1. !!! related TS6210 tests/cases/compiler/spreadOfParamsFromGeneratorMakesRequiredParams.ts:3:5: An argument for 'args' was not provided. \ No newline at end of file diff --git a/tests/baselines/reference/strictBindCallApply1.errors.txt b/tests/baselines/reference/strictBindCallApply1.errors.txt index 7b13d5e3181..98d8a19db06 100644 --- a/tests/baselines/reference/strictBindCallApply1.errors.txt +++ b/tests/baselines/reference/strictBindCallApply1.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(11,35): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. -tests/cases/conformance/functions/strictBindCallApply1.ts(17,11): error TS2554: Expected 3 arguments, but got 2. +tests/cases/conformance/functions/strictBindCallApply1.ts(17,15): error TS2554: Expected 3 arguments, but got 2. tests/cases/conformance/functions/strictBindCallApply1.ts(18,35): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. tests/cases/conformance/functions/strictBindCallApply1.ts(19,44): error TS2554: Expected 3 arguments, but got 4. tests/cases/conformance/functions/strictBindCallApply1.ts(22,32): error TS2345: Argument of type '[number]' is not assignable to parameter of type '[number, string]'. @@ -10,7 +10,7 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(24,32): error TS2345: Type '3' is not assignable to type '2'. tests/cases/conformance/functions/strictBindCallApply1.ts(41,29): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. tests/cases/conformance/functions/strictBindCallApply1.ts(42,22): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'C'. -tests/cases/conformance/functions/strictBindCallApply1.ts(48,11): error TS2554: Expected 3 arguments, but got 2. +tests/cases/conformance/functions/strictBindCallApply1.ts(48,17): error TS2554: Expected 3 arguments, but got 2. tests/cases/conformance/functions/strictBindCallApply1.ts(49,29): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. tests/cases/conformance/functions/strictBindCallApply1.ts(50,38): error TS2554: Expected 3 arguments, but got 4. tests/cases/conformance/functions/strictBindCallApply1.ts(51,22): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'C'. @@ -19,7 +19,7 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(55,31): error TS2322: tests/cases/conformance/functions/strictBindCallApply1.ts(56,26): error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[number, string]'. tests/cases/conformance/functions/strictBindCallApply1.ts(57,23): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'C'. tests/cases/conformance/functions/strictBindCallApply1.ts(62,33): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. -tests/cases/conformance/functions/strictBindCallApply1.ts(65,1): error TS2554: Expected 3 arguments, but got 2. +tests/cases/conformance/functions/strictBindCallApply1.ts(65,3): error TS2554: Expected 3 arguments, but got 2. tests/cases/conformance/functions/strictBindCallApply1.ts(66,15): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. tests/cases/conformance/functions/strictBindCallApply1.ts(67,24): error TS2554: Expected 3 arguments, but got 4. tests/cases/conformance/functions/strictBindCallApply1.ts(70,12): error TS2345: Argument of type '[number]' is not assignable to parameter of type '[number, string]'. @@ -47,7 +47,7 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(72,12): error TS2345: let c00 = foo.call(undefined, 10, "hello"); let c01 = foo.call(undefined, 10); // Error - ~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~ !!! error TS2554: Expected 3 arguments, but got 2. let c02 = foo.call(undefined, 10, 20); // Error ~~ @@ -97,7 +97,7 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(72,12): error TS2345: let c10 = c.foo.call(c, 10, "hello"); let c11 = c.foo.call(c, 10); // Error - ~~~~~~~~~~~~~~~~~ + ~~~~ !!! error TS2554: Expected 3 arguments, but got 2. let c12 = c.foo.call(c, 10, 20); // Error ~~ @@ -132,7 +132,7 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(72,12): error TS2345: C.call(c, 10, "hello"); C.call(c, 10); // Error - ~~~~~~~~~~~~~ + ~~~~ !!! error TS2554: Expected 3 arguments, but got 2. C.call(c, 10, 20); // Error ~~ diff --git a/tests/baselines/reference/thisTypeInFunctionsNegative.errors.txt b/tests/baselines/reference/thisTypeInFunctionsNegative.errors.txt index 0cf86610f80..4720b4556a4 100644 --- a/tests/baselines/reference/thisTypeInFunctionsNegative.errors.txt +++ b/tests/baselines/reference/thisTypeInFunctionsNegative.errors.txt @@ -10,7 +10,7 @@ tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(62,97): er Object literal may only specify known properties, and 'explicitStructural' does not exist in type '{ y: string; f: (this: { y: number; }, x: number) => number; }'. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(63,110): error TS2322: Type '{ wrongName: number; explicitStructural: (this: { y: number; }, x: number) => number; }' is not assignable to type '{ wrongName: number; f: (this: { y: number; }, x: number) => number; }'. Object literal may only specify known properties, and 'explicitStructural' does not exist in type '{ wrongName: number; f: (this: { y: number; }, x: number) => number; }'. -tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(65,1): error TS2554: Expected 1 arguments, but got 0. +tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(65,4): error TS2554: Expected 1 arguments, but got 0. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(66,6): error TS2345: Argument of type '"wrong type"' is not assignable to parameter of type 'number'. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(67,10): error TS2554: Expected 1 arguments, but got 2. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(68,1): error TS2684: The 'this' context of type '{ y: string; f: (this: { y: number; }, x: number) => number; }' is not assignable to method's 'this' of type '{ y: number; }'. @@ -18,16 +18,16 @@ tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(68,1): err Type 'string' is not assignable to type 'number'. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(69,1): error TS2684: The 'this' context of type '{ wrongName: number; f: (this: { y: number; }, x: number) => number; }' is not assignable to method's 'this' of type '{ y: number; }'. Property 'y' is missing in type '{ wrongName: number; f: (this: { y: number; }, x: number) => number; }' but required in type '{ y: number; }'. -tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(72,1): error TS2554: Expected 1 arguments, but got 0. +tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(72,3): error TS2554: Expected 1 arguments, but got 0. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(73,13): error TS2345: Argument of type '"wrong type"' is not assignable to parameter of type 'number'. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(74,17): error TS2554: Expected 1 arguments, but got 2. -tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(75,1): error TS2554: Expected 1 arguments, but got 0. +tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(75,3): error TS2554: Expected 1 arguments, but got 0. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(76,16): error TS2345: Argument of type '"wrong type 2"' is not assignable to parameter of type 'number'. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(77,20): error TS2554: Expected 1 arguments, but got 2. -tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(78,1): error TS2554: Expected 1 arguments, but got 0. +tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(78,3): error TS2554: Expected 1 arguments, but got 0. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(79,16): error TS2345: Argument of type '"wrong type 2"' is not assignable to parameter of type 'number'. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(80,20): error TS2554: Expected 1 arguments, but got 2. -tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(81,1): error TS2554: Expected 1 arguments, but got 0. +tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(81,3): error TS2554: Expected 1 arguments, but got 0. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(82,20): error TS2345: Argument of type '"wrong type 3"' is not assignable to parameter of type 'number'. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(83,24): error TS2554: Expected 1 arguments, but got 2. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(86,5): error TS2322: Type '(this: { y: number; }, x: number) => number' is not assignable to type '(this: void, x: number) => number'. @@ -182,7 +182,7 @@ tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(178,22): e !!! error TS2322: Object literal may only specify known properties, and 'explicitStructural' does not exist in type '{ wrongName: number; f: (this: { y: number; }, x: number) => number; }'. ok.f(); // not enough arguments - ~~~~~~ + ~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts:61:46: An argument for 'x' was not provided. ok.f('wrong type'); @@ -204,7 +204,7 @@ tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(178,22): e let c = new C(); c.explicitC(); // not enough arguments - ~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts:9:24: An argument for 'm' was not provided. c.explicitC('wrong type'); @@ -214,7 +214,7 @@ tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(178,22): e ~~~~~~~~~~~~~~~~~~~~ !!! error TS2554: Expected 1 arguments, but got 2. c.explicitThis(); // not enough arguments - ~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts:3:30: An argument for 'm' was not provided. c.explicitThis('wrong type 2'); @@ -224,7 +224,7 @@ tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(178,22): e ~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2554: Expected 1 arguments, but got 2. c.implicitThis(); // not enough arguments - ~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts:6:18: An argument for 'm' was not provided. c.implicitThis('wrong type 2'); @@ -234,7 +234,7 @@ tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(178,22): e ~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2554: Expected 1 arguments, but got 2. c.explicitProperty(); // not enough arguments - ~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts:12:41: An argument for 'm' was not provided. c.explicitProperty('wrong type 3'); diff --git a/tests/baselines/reference/typeAssertionToGenericFunctionType.errors.txt b/tests/baselines/reference/typeAssertionToGenericFunctionType.errors.txt index 551b863c604..ae8a5cb6897 100644 --- a/tests/baselines/reference/typeAssertionToGenericFunctionType.errors.txt +++ b/tests/baselines/reference/typeAssertionToGenericFunctionType.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/typeAssertionToGenericFunctionType.ts(5,13): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. -tests/cases/compiler/typeAssertionToGenericFunctionType.ts(6,1): error TS2554: Expected 1 arguments, but got 0. +tests/cases/compiler/typeAssertionToGenericFunctionType.ts(6,3): error TS2554: Expected 1 arguments, but got 0. ==== tests/cases/compiler/typeAssertionToGenericFunctionType.ts (2 errors) ==== @@ -11,6 +11,6 @@ tests/cases/compiler/typeAssertionToGenericFunctionType.ts(6,1): error TS2554: E ~ !!! error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. x.b(); // error - ~~~~~~~~~~~~~ + ~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 tests/cases/compiler/typeAssertionToGenericFunctionType.ts:3:12: An argument for 'x' was not provided. \ No newline at end of file diff --git a/tests/baselines/reference/unionTypeCallSignatures.errors.txt b/tests/baselines/reference/unionTypeCallSignatures.errors.txt index 2c80ac58cc8..261f0029999 100644 --- a/tests/baselines/reference/unionTypeCallSignatures.errors.txt +++ b/tests/baselines/reference/unionTypeCallSignatures.errors.txt @@ -50,7 +50,7 @@ tests/cases/conformance/types/union/unionTypeCallSignatures.ts(73,12): error TS2 ~~~~ !!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. unionOfDifferentReturnType1(); // error missing parameter - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 tests/cases/conformance/types/union/unionTypeCallSignatures.ts:12:37: An argument for 'a' was not provided. @@ -62,13 +62,13 @@ tests/cases/conformance/types/union/unionTypeCallSignatures.ts(73,12): error TS2 ~~~~~~~ !!! error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'never'. unionOfDifferentParameterTypes();// error - no call signatures - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 tests/cases/conformance/types/union/unionTypeCallSignatures.ts:18:40: An argument for 'a' was not provided. var unionOfDifferentNumberOfSignatures: { (a: number): number; } | { (a: number): Date; (a: string): boolean; }; unionOfDifferentNumberOfSignatures(); // error - no call signatures - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 tests/cases/conformance/types/union/unionTypeCallSignatures.ts:23:44: An argument for 'a' was not provided. unionOfDifferentNumberOfSignatures(10); // error - no call signatures @@ -78,11 +78,11 @@ tests/cases/conformance/types/union/unionTypeCallSignatures.ts(73,12): error TS2 var unionWithDifferentParameterCount: { (a: string): string; } | { (a: string, b: number): number; } ; unionWithDifferentParameterCount();// needs more args - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2554: Expected 2 arguments, but got 0. !!! related TS6210 tests/cases/conformance/types/union/unionTypeCallSignatures.ts:28:69: An argument for 'a' was not provided. unionWithDifferentParameterCount("hello");// needs more args - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2554: Expected 2 arguments, but got 1. !!! related TS6210 tests/cases/conformance/types/union/unionTypeCallSignatures.ts:28:80: An argument for 'b' was not provided. unionWithDifferentParameterCount("hello", 10);// OK @@ -94,13 +94,13 @@ tests/cases/conformance/types/union/unionTypeCallSignatures.ts(73,12): error TS2 ~~~~~~~ !!! error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. strOrNum = unionWithOptionalParameter1(); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2554: Expected 1-2 arguments, but got 0. !!! related TS6210 tests/cases/conformance/types/union/unionTypeCallSignatures.ts:33:37: An argument for 'a' was not provided. var unionWithOptionalParameter2: { (a: string, b?: number): string; } | { (a: string, b: number): number }; strOrNum = unionWithOptionalParameter2('hello'); // error no call signature - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2554: Expected 2 arguments, but got 1. !!! related TS6210 tests/cases/conformance/types/union/unionTypeCallSignatures.ts:39:87: An argument for 'b' was not provided. strOrNum = unionWithOptionalParameter2('hello', 10); // error no call signature @@ -108,7 +108,7 @@ tests/cases/conformance/types/union/unionTypeCallSignatures.ts(73,12): error TS2 ~~~~~~~ !!! error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. strOrNum = unionWithOptionalParameter2(); // error no call signature - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2554: Expected 2 arguments, but got 0. !!! related TS6210 tests/cases/conformance/types/union/unionTypeCallSignatures.ts:39:76: An argument for 'a' was not provided. @@ -119,7 +119,7 @@ tests/cases/conformance/types/union/unionTypeCallSignatures.ts(73,12): error TS2 ~~~~~~~ !!! error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. strOrNum = unionWithOptionalParameter3(); // needs more args - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2554: Expected 1-2 arguments, but got 0. !!! related TS6210 tests/cases/conformance/types/union/unionTypeCallSignatures.ts:45:37: An argument for 'a' was not provided. @@ -131,13 +131,13 @@ tests/cases/conformance/types/union/unionTypeCallSignatures.ts(73,12): error TS2 ~~~~~~~ !!! error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. strOrNum = unionWithRestParameter1(); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2555: Expected at least 1 arguments, but got 0. !!! related TS6210 tests/cases/conformance/types/union/unionTypeCallSignatures.ts:51:33: An argument for 'a' was not provided. var unionWithRestParameter2: { (a: string, ...b: number[]): string; } | { (a: string, b: number): number }; strOrNum = unionWithRestParameter2('hello'); // error no call signature - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2554: Expected 2 arguments, but got 1. !!! related TS6210 tests/cases/conformance/types/union/unionTypeCallSignatures.ts:58:87: An argument for 'b' was not provided. strOrNum = unionWithRestParameter2('hello', 10); // error no call signature @@ -148,7 +148,7 @@ tests/cases/conformance/types/union/unionTypeCallSignatures.ts(73,12): error TS2 ~~~~~~~ !!! error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. strOrNum = unionWithRestParameter2(); // error no call signature - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2554: Expected 2 arguments, but got 0. !!! related TS6210 tests/cases/conformance/types/union/unionTypeCallSignatures.ts:58:76: An argument for 'a' was not provided. @@ -160,13 +160,13 @@ tests/cases/conformance/types/union/unionTypeCallSignatures.ts(73,12): error TS2 ~~~~~~~ !!! error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. strOrNum = unionWithRestParameter3(); // error no call signature - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2555: Expected at least 1 arguments, but got 0. !!! related TS6210 tests/cases/conformance/types/union/unionTypeCallSignatures.ts:65:33: An argument for 'a' was not provided. var unionWithRestParameter4: { (...a: string[]): string; } | { (a: string, b: string): number; }; strOrNum = unionWithRestParameter4("hello"); // error supplied parameters do not match any call signature - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2554: Expected 2 arguments, but got 1. !!! related TS6210 tests/cases/conformance/types/union/unionTypeCallSignatures.ts:72:76: An argument for 'b' was not provided. strOrNum = unionWithRestParameter4("hello", "world"); diff --git a/tests/baselines/reference/unionTypeCallSignatures4.errors.txt b/tests/baselines/reference/unionTypeCallSignatures4.errors.txt index 37f8d7708c5..e991b211db2 100644 --- a/tests/baselines/reference/unionTypeCallSignatures4.errors.txt +++ b/tests/baselines/reference/unionTypeCallSignatures4.errors.txt @@ -26,7 +26,7 @@ tests/cases/conformance/types/union/unionTypeCallSignatures4.ts(25,18): error TS var f12345: F1 | F2 | F3 | F4 | F5; f12345("a"); // error - ~~~~~~~~~~~ + ~~~~~~ !!! error TS2554: Expected 2 arguments, but got 1. !!! related TS6210 tests/cases/conformance/types/union/unionTypeCallSignatures4.ts:5:23: An argument for 'b' was not provided. f12345("a", "b"); diff --git a/tests/cases/compiler/declarationEmitDefaultExportWithStaticAssignment.ts b/tests/cases/compiler/declarationEmitDefaultExportWithStaticAssignment.ts new file mode 100644 index 00000000000..d6638ab8e36 --- /dev/null +++ b/tests/cases/compiler/declarationEmitDefaultExportWithStaticAssignment.ts @@ -0,0 +1,32 @@ +// @declaration: true +// @filename: foo.ts +export class Foo {} + +// @filename: index1.ts +import {Foo} from './foo'; +export default function Example() {} +Example.Foo = Foo + +// @filename: index2.ts +import {Foo} from './foo'; +export {Foo}; +export default function Example() {} +Example.Foo = Foo + +// @filename: index3.ts +export class Bar {} +export default function Example() {} + +Example.Bar = Bar + +// @filename: index4.ts +function A() { } + +function B() { } + +export function C() { + return null; +} + +C.A = A; +C.B = B; \ No newline at end of file diff --git a/tests/cases/compiler/declarationEmitExpandoWithGenericConstraint.ts b/tests/cases/compiler/declarationEmitExpandoWithGenericConstraint.ts new file mode 100644 index 00000000000..79a704ce5ba --- /dev/null +++ b/tests/cases/compiler/declarationEmitExpandoWithGenericConstraint.ts @@ -0,0 +1,15 @@ +// @declaration: true +export interface Point { + readonly x: number; + readonly y: number; +} + +export interface Rect

{ + readonly a: p; + readonly b: p; +} + +export const Point = (x: number, y: number): Point => ({ x, y }); +export const Rect =

(a: p, b: p): Rect

=> ({ a, b }); + +Point.zero = (): Point => Point(0, 0); \ No newline at end of file diff --git a/tests/cases/compiler/methodChainError.ts b/tests/cases/compiler/methodChainError.ts new file mode 100644 index 00000000000..657d9a634a5 --- /dev/null +++ b/tests/cases/compiler/methodChainError.ts @@ -0,0 +1,9 @@ +class Builder { + method(param: string): Builder { + return this; + } +} + +new Builder() + .method("a") + .method(); \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/destructuringControlFlow.ts b/tests/cases/conformance/es6/destructuring/destructuringControlFlow.ts index 033f2bdb75e..ea92b09081c 100644 --- a/tests/cases/conformance/es6/destructuring/destructuringControlFlow.ts +++ b/tests/cases/conformance/es6/destructuring/destructuringControlFlow.ts @@ -34,3 +34,9 @@ function f4() { ({ ["x"]: x } = 0); // Error ({ ["x" + ""]: x } = 0); // Errpr } + +// Repro from #31770 + +type KeyValue = [string, string?]; +let [key, value]: KeyValue = ["foo"]; +value.toUpperCase(); // Error diff --git a/tests/cases/conformance/expressions/arrayLiterals/arrayLiteralInference.ts b/tests/cases/conformance/expressions/arrayLiterals/arrayLiteralInference.ts new file mode 100644 index 00000000000..311cad6236f --- /dev/null +++ b/tests/cases/conformance/expressions/arrayLiterals/arrayLiteralInference.ts @@ -0,0 +1,36 @@ +// @strict: true +// @target: es2015 + +// Repro from #31204 + +export enum AppType { + HeaderDetail = 'HeaderDetail', + HeaderMultiDetail = 'HeaderMultiDetail', + AdvancedList = 'AdvancedList', + Standard = 'Standard', + Relationship = 'Relationship', + Report = 'Report', + Composite = 'Composite', + ListOnly = 'ListOnly', + ModuleSettings = 'ModuleSettings' +} + +export enum AppStyle { + Tree, + TreeEntity, + Standard, + MiniApp, + PivotTable +} + +const appTypeStylesWithError: Map> = new Map([ + [AppType.Standard, [AppStyle.Standard, AppStyle.MiniApp]], + [AppType.Relationship, [AppStyle.Standard, AppStyle.Tree, AppStyle.TreeEntity]], + [AppType.AdvancedList, [AppStyle.Standard, AppStyle.MiniApp]] +]); + +// Repro from #31204 + +declare function foo(...args: T[]): T[]; +let b1: { x: boolean }[] = foo({ x: true }, { x: false }); +let b2: boolean[][] = foo([true], [false]); diff --git a/tests/cases/docker/README.md b/tests/cases/docker/README.md new file mode 100644 index 00000000000..f9b12e1a052 --- /dev/null +++ b/tests/cases/docker/README.md @@ -0,0 +1,21 @@ +Integrations +============ + +This repository contains `Dockerfile`s that describe how to build open source projects (usually those with complex build tasks) with a specific version of typescript. These are used for extended validations of a given typescript build. + +Contributing +----------- + +To add a new test: +* Create a new folder with the name of the project +* Create a `Dockerfile` within that folder +* The `Dockerfile` will be built with `docker build . -t tstest/folder` and then run with `docker run tstest/folder` +* Write the dockerfile such that it can build the target project and injects the typescript package from the `typescript/typescript` image (which should have a tar file at `/typescript/typescript-*.tgz`) + +Debugging +--------- + +You can open a test's container with an interactive shell to debug with `docker run -it --entrypoint "/bin/sh" tstest/folder`. +If you want to remote debug a typescript process within a container, you'll need to forward the port you instruct the +compiler or language server to listen on by passing `--expose PORT` where `PORT` is the port number you'd like forwarded to the +host. diff --git a/tests/cases/docker/azure-sdk/Dockerfile b/tests/cases/docker/azure-sdk/Dockerfile new file mode 100644 index 00000000000..e65643445aa --- /dev/null +++ b/tests/cases/docker/azure-sdk/Dockerfile @@ -0,0 +1,19 @@ +FROM node:current +RUN npm install -g @microsoft/rush +RUN git clone https://github.com/Azure/azure-sdk-for-js.git /azure-sdk +WORKDIR /azure-sdk +RUN git pull +RUN rush update +WORKDIR /azure-sdk/sdk/core/core-http +# Sync up all TS versions used internally so they're all linked from a known location +RUN rush add -p "typescript@3.5.1" --exact --dev -m +# Relink installed TSes to built TS +WORKDIR /azure-sdk/common/temp/node_modules/.registry.npmjs.org/typescript/3.5.1/node_modules +RUN rm -rf typescript +COPY --from=typescript/typescript /typescript/typescript-*.tgz /typescript.tgz +RUN mkdir /typescript +RUN tar -xzvf /typescript.tgz -C /typescript +RUN ln -s /typescript/package ./typescript +WORKDIR /azure-sdk +ENTRYPOINT [ "rush" ] +CMD [ "rebuild", "--parallelism", "1" ] \ No newline at end of file diff --git a/tests/cases/docker/office-ui-fabric/Dockerfile b/tests/cases/docker/office-ui-fabric/Dockerfile new file mode 100644 index 00000000000..718289fabe3 --- /dev/null +++ b/tests/cases/docker/office-ui-fabric/Dockerfile @@ -0,0 +1,20 @@ +FROM node:current +RUN npm install -g @microsoft/rush +RUN git clone https://github.com/OfficeDev/office-ui-fabric-react.git /office-ui-fabric-react +WORKDIR /office-ui-fabric-react +RUN git pull +RUN rush update +WORKDIR /office-ui-fabric-react/scripts +# Sync up all TS versions used internally so they're all linked from a known location +RUN rush add -p "typescript@3.5.1" --exact --dev -m +# Relink installed TSes to built TS +WORKDIR /office-ui-fabric-react/common/temp/node_modules/.registry.npmjs.org/typescript/3.5.1/node_modules +RUN rm -rf typescript +COPY --from=typescript/typescript /typescript/typescript-*.tgz /typescript.tgz +RUN mkdir /typescript +RUN tar -xzvf /typescript.tgz -C /typescript +RUN ln -s /typescript/package ./typescript +RUN npm i -g /typescript.tgz +WORKDIR /office-ui-fabric-react +ENTRYPOINT [ "rush" ] +CMD [ "rebuild", "--parallelism", "1" ] \ No newline at end of file diff --git a/tests/projects/containerOnlyReferenced/src/folder/index.ts b/tests/projects/containerOnlyReferenced/src/folder/index.ts new file mode 100644 index 00000000000..a65e4235153 --- /dev/null +++ b/tests/projects/containerOnlyReferenced/src/folder/index.ts @@ -0,0 +1 @@ +export const x = 10; \ No newline at end of file diff --git a/tests/projects/containerOnlyReferenced/src/folder/tsconfig.json b/tests/projects/containerOnlyReferenced/src/folder/tsconfig.json new file mode 100644 index 00000000000..d54f4070fe9 --- /dev/null +++ b/tests/projects/containerOnlyReferenced/src/folder/tsconfig.json @@ -0,0 +1,6 @@ +{ + "files": ["index.ts"], + "compilerOptions": { + "composite": true + } +} \ No newline at end of file diff --git a/tests/projects/containerOnlyReferenced/src/folder2/index.ts b/tests/projects/containerOnlyReferenced/src/folder2/index.ts new file mode 100644 index 00000000000..a65e4235153 --- /dev/null +++ b/tests/projects/containerOnlyReferenced/src/folder2/index.ts @@ -0,0 +1 @@ +export const x = 10; \ No newline at end of file diff --git a/tests/projects/containerOnlyReferenced/src/folder2/tsconfig.json b/tests/projects/containerOnlyReferenced/src/folder2/tsconfig.json new file mode 100644 index 00000000000..d54f4070fe9 --- /dev/null +++ b/tests/projects/containerOnlyReferenced/src/folder2/tsconfig.json @@ -0,0 +1,6 @@ +{ + "files": ["index.ts"], + "compilerOptions": { + "composite": true + } +} \ No newline at end of file diff --git a/tests/projects/containerOnlyReferenced/src/tsconfig.json b/tests/projects/containerOnlyReferenced/src/tsconfig.json new file mode 100644 index 00000000000..4d67b0f8bea --- /dev/null +++ b/tests/projects/containerOnlyReferenced/src/tsconfig.json @@ -0,0 +1,10 @@ +{ + "files": [], + "compilerOptions": { + "composite": true + }, + "references": [ + { "path": "./folder" }, + { "path": "./folder2"} + ] + } \ No newline at end of file diff --git a/tests/projects/containerOnlyReferenced/tests/index.ts b/tests/projects/containerOnlyReferenced/tests/index.ts new file mode 100644 index 00000000000..a65e4235153 --- /dev/null +++ b/tests/projects/containerOnlyReferenced/tests/index.ts @@ -0,0 +1 @@ +export const x = 10; \ No newline at end of file diff --git a/tests/projects/containerOnlyReferenced/tests/tsconfig.json b/tests/projects/containerOnlyReferenced/tests/tsconfig.json new file mode 100644 index 00000000000..987385d9745 --- /dev/null +++ b/tests/projects/containerOnlyReferenced/tests/tsconfig.json @@ -0,0 +1,9 @@ +{ + "files": ["index.ts"], + "compilerOptions": { + "composite": true + }, + "references": [ + { "path": "../src" } + ] +} \ No newline at end of file diff --git a/tests/projects/containerOnlyReferenced/tsconfig.json b/tests/projects/containerOnlyReferenced/tsconfig.json new file mode 100644 index 00000000000..28ea2a4385e --- /dev/null +++ b/tests/projects/containerOnlyReferenced/tsconfig.json @@ -0,0 +1,10 @@ +{ + "files": [], + "compilerOptions": { + "composite": true + }, + "references": [ + { "path": "./src" }, + { "path": "./tests"} + ] +} \ No newline at end of file