Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint

This commit is contained in:
Alexander T 2019-09-05 09:52:04 +03:00
commit 7ea134bacd
36 changed files with 1079 additions and 44 deletions

View file

@ -123,7 +123,10 @@
"fs": false,
"os": false,
"path": false,
"@microsoft/typescript-etw": false
"crypto": false,
"buffer": false,
"@microsoft/typescript-etw": false,
"source-map-support": false
},
"dependencies": {}
}

View file

@ -1827,7 +1827,23 @@ namespace ts {
bindPotentiallyMissingNamespaces(file.symbol, declName.parent, isTopLevel,
!!findAncestor(declName, d => isPropertyAccessExpression(d) && d.name.escapedText === "prototype"), /*containerIsClass*/ false);
const oldContainer = container;
container = isPropertyAccessExpression(declName.parent.expression) ? declName.parent.expression.name : declName.parent.expression;
switch (getAssignmentDeclarationPropertyAccessKind(declName.parent)) {
case AssignmentDeclarationKind.ExportsProperty:
case AssignmentDeclarationKind.ModuleExports:
container = file;
break;
case AssignmentDeclarationKind.ThisProperty:
container = declName.parent.expression;
break;
case AssignmentDeclarationKind.PrototypeProperty:
container = (declName.parent.expression as PropertyAccessExpression).name;
break;
case AssignmentDeclarationKind.Property:
container = isPropertyAccessExpression(declName.parent.expression) ? declName.parent.expression.name : declName.parent.expression;
break;
case AssignmentDeclarationKind.None:
return Debug.fail("Shouldn't have detected typedef or enum on non-assignment declaration");
}
declareModuleMember(typeAlias, SymbolFlags.TypeAlias, SymbolFlags.TypeAliasExcludes);
container = oldContainer;
}

View file

@ -12882,7 +12882,7 @@ namespace ts {
// and we need to handle "each" relations before "some" relations for the same kind of type.
if (source.flags & TypeFlags.Union) {
result = relation === comparableRelation ?
someTypeRelatedToType(source as UnionType, target, reportErrors && !(source.flags & TypeFlags.Primitive)) :
someTypeRelatedToType(source as UnionType, target, reportErrors && !(source.flags & TypeFlags.Primitive), isIntersectionConstituent) :
eachTypeRelatedToType(source as UnionType, target, reportErrors && !(source.flags & TypeFlags.Primitive));
}
else {
@ -12920,7 +12920,7 @@ namespace ts {
//
// - For a primitive type or type parameter (such as 'number = A & B') there is no point in
// breaking the intersection apart.
result = someTypeRelatedToType(<IntersectionType>source, target, /*reportErrors*/ false);
result = someTypeRelatedToType(<IntersectionType>source, target, /*reportErrors*/ false, /*isIntersectionConstituent*/ true);
}
if (!result && (source.flags & TypeFlags.StructuredOrInstantiable || target.flags & TypeFlags.StructuredOrInstantiable)) {
if (result = recursiveTypeRelatedTo(source, target, reportErrors, isIntersectionConstituent)) {
@ -13199,14 +13199,14 @@ namespace ts {
return result;
}
function someTypeRelatedToType(source: UnionOrIntersectionType, target: Type, reportErrors: boolean): Ternary {
function someTypeRelatedToType(source: UnionOrIntersectionType, target: Type, reportErrors: boolean, isIntersectionConstituent: boolean): Ternary {
const sourceTypes = source.types;
if (source.flags & TypeFlags.Union && containsType(sourceTypes, target)) {
return Ternary.True;
}
const len = sourceTypes.length;
for (let i = 0; i < len; i++) {
const related = isRelatedTo(sourceTypes[i], target, reportErrors && i === len - 1);
const related = isRelatedTo(sourceTypes[i], target, reportErrors && i === len - 1, /*headMessage*/ undefined, isIntersectionConstituent);
if (related) {
return related;
}
@ -14546,6 +14546,9 @@ namespace ts {
// though highly unlikely, for this test to be true in a situation where a chain of instantiations is not infinitely
// expanding. Effectively, we will generate a false positive when two types are structurally equal to at least 5
// levels, but unequal at some level beyond that.
// In addition, this will also detect when an indexed access has been chained off of 5 or more times (which is essentially
// the dual of the structural comparison), and likewise mark the type as deeply nested, potentially adding false positives
// for finite but deeply expanding indexed accesses (eg, for `Q[P1][P2][P3][P4][P5]`).
function isDeeplyNestedType(type: Type, stack: Type[], depth: number): boolean {
// We track all object types that have an associated symbol (representing the origin of the type)
if (depth >= 5 && type.flags & TypeFlags.Object) {
@ -14561,9 +14564,31 @@ namespace ts {
}
}
}
if (depth >= 5 && type.flags & TypeFlags.IndexedAccess) {
const root = getRootObjectTypeFromIndexedAccessChain(type);
let count = 0;
for (let i = 0; i < depth; i++) {
const t = stack[i];
if (getRootObjectTypeFromIndexedAccessChain(t) === root) {
count++;
if (count >= 5) return true;
}
}
}
return false;
}
/**
* Gets the leftmost object type in a chain of indexed accesses, eg, in A[P][Q], returns A
*/
function getRootObjectTypeFromIndexedAccessChain(type: Type) {
let t = type;
while (t.flags & TypeFlags.IndexedAccess) {
t = (t as IndexedAccessType).objectType;
}
return t;
}
function isPropertyIdenticalTo(sourceProp: Symbol, targetProp: Symbol): boolean {
return compareProperties(sourceProp, targetProp, compareTypesIdentical) !== Ternary.False;
}
@ -15584,11 +15609,14 @@ namespace ts {
if (inferFromMatchingType(source, (<UnionType>target).types, isTypeCloselyMatchedBy)) return;
}
}
else if (target.flags & TypeFlags.Intersection && some((<IntersectionType>target).types, t => !!getInferenceInfoForType(t))) {
else if (target.flags & TypeFlags.Intersection && some((<IntersectionType>target).types,
t => !!getInferenceInfoForType(t) || (isGenericMappedType(t) && !!getInferenceInfoForType(getHomomorphicTypeVariable(t) || neverType)))) {
// We reduce intersection types only when they contain naked type parameters. For example, when
// inferring from 'string[] & { extra: any }' to 'string[] & T' we want to remove string[] and
// infer { extra: any } for T. But when inferring to 'string[] & Iterable<T>' we want to keep the
// string[] on the source side and infer string for T.
// Likewise, we consider a homomorphic mapped type constrainted to the target type parameter as similar to a "naked type variable"
// in such scenarios.
if (source.flags & TypeFlags.Intersection) {
// Infer between identically matching source and target constituents and remove the matching types.
const [sources, targets] = inferFromMatchingTypes((<IntersectionType>source).types, (<IntersectionType>target).types, isTypeIdenticalTo);
@ -21574,13 +21602,13 @@ namespace ts {
checkMode: CheckMode,
reportErrors: boolean,
containingMessageChain: (() => DiagnosticMessageChain | undefined) | undefined,
) {
): ReadonlyArray<Diagnostic> | undefined {
const errorOutputContainer: { errors?: Diagnostic[], skipLogging?: boolean } = { errors: undefined, skipLogging: true };
if (isJsxOpeningLikeElement(node)) {
if (!checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation, checkMode, reportErrors, containingMessageChain, errorOutputContainer)) {
Debug.assert(!reportErrors || !!errorOutputContainer.errors, "jsx should have errors when reporting errors");
return errorOutputContainer.errors || [];
return errorOutputContainer.errors || emptyArray;
}
return undefined;
}
@ -21595,7 +21623,7 @@ namespace ts {
const headMessage = Diagnostics.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1;
if (!checkTypeRelatedTo(thisArgumentType, thisType, relation, errorNode, headMessage, containingMessageChain, errorOutputContainer)) {
Debug.assert(!reportErrors || !!errorOutputContainer.errors, "this parameter should have errors when reporting errors");
return errorOutputContainer.errors || [];
return errorOutputContainer.errors || emptyArray;
}
}
const headMessage = Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1;
@ -21613,7 +21641,7 @@ namespace ts {
if (!checkTypeRelatedToAndOptionallyElaborate(checkArgType, paramType, relation, reportErrors ? arg : undefined, arg, headMessage, containingMessageChain, errorOutputContainer)) {
Debug.assert(!reportErrors || !!errorOutputContainer.errors, "parameter should have errors when reporting errors");
maybeAddMissingAwaitInfo(arg, checkArgType, paramType);
return errorOutputContainer.errors || [];
return errorOutputContainer.errors || emptyArray;
}
}
}
@ -21623,7 +21651,7 @@ namespace ts {
if (!checkTypeRelatedTo(spreadType, restType, relation, errorNode, headMessage, /*containingMessageChain*/ undefined, errorOutputContainer)) {
Debug.assert(!reportErrors || !!errorOutputContainer.errors, "rest parameter should have errors when reporting errors");
maybeAddMissingAwaitInfo(errorNode, spreadType, restType);
return errorOutputContainer.errors || [];
return errorOutputContainer.errors || emptyArray;
}
}
return undefined;
@ -22014,7 +22042,7 @@ namespace ts {
}
}
else {
const allDiagnostics: DiagnosticRelatedInformation[][] = [];
const allDiagnostics: (readonly DiagnosticRelatedInformation[])[] = [];
let max = 0;
let min = Number.MAX_VALUE;
let minIndex = 0;

View file

@ -36,8 +36,8 @@ namespace ts {
etwModule = undefined;
}
/** Performance logger that will generate ETW events if possible */
export const perfLogger: PerfLogger = etwModule ? etwModule : nullLogger;
perfLogger.logInfoEvent(`Starting TypeScript v${versionMajorMinor} with command line: ${JSON.stringify(process.argv)}`);
/** Performance logger that will generate ETW events if possible - check for `logEvent` member, as `etwModule` will be `{}` when browserified */
export const perfLogger: PerfLogger = etwModule && etwModule.logEvent ? etwModule : nullLogger;
const args = typeof process === "undefined" ? [] : process.argv;
perfLogger.logInfoEvent(`Starting TypeScript v${versionMajorMinor} with command line: ${JSON.stringify(args)}`);
}

View file

@ -0,0 +1,17 @@
//// [comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts]
type PartialDeep<T> = {[K in keyof T]?: PartialDeep<T[K]>};
type Many<T> = T | readonly T[];
interface Collection<T> {
sortBy(...iteratees: Many<PartialDeep<T>>[]): Collection<T>;
}
const x: Collection<{x: number}> = (null as any as Collection<{x: number, y: number}>);
export {};
//// [comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.js]
"use strict";
exports.__esModule = true;
var x = null;

View file

@ -0,0 +1,40 @@
=== tests/cases/compiler/comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts ===
type PartialDeep<T> = {[K in keyof T]?: PartialDeep<T[K]>};
>PartialDeep : Symbol(PartialDeep, Decl(comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts, 0, 0))
>T : Symbol(T, Decl(comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts, 0, 17))
>K : Symbol(K, Decl(comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts, 0, 24))
>T : Symbol(T, Decl(comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts, 0, 17))
>PartialDeep : Symbol(PartialDeep, Decl(comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts, 0, 0))
>T : Symbol(T, Decl(comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts, 0, 17))
>K : Symbol(K, Decl(comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts, 0, 24))
type Many<T> = T | readonly T[];
>Many : Symbol(Many, Decl(comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts, 0, 59))
>T : Symbol(T, Decl(comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts, 1, 10))
>T : Symbol(T, Decl(comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts, 1, 10))
>T : Symbol(T, Decl(comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts, 1, 10))
interface Collection<T> {
>Collection : Symbol(Collection, Decl(comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts, 1, 32))
>T : Symbol(T, Decl(comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts, 3, 21))
sortBy(...iteratees: Many<PartialDeep<T>>[]): Collection<T>;
>sortBy : Symbol(Collection.sortBy, Decl(comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts, 3, 25))
>iteratees : Symbol(iteratees, Decl(comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts, 4, 11))
>Many : Symbol(Many, Decl(comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts, 0, 59))
>PartialDeep : Symbol(PartialDeep, Decl(comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts, 0, 0))
>T : Symbol(T, Decl(comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts, 3, 21))
>Collection : Symbol(Collection, Decl(comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts, 1, 32))
>T : Symbol(T, Decl(comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts, 3, 21))
}
const x: Collection<{x: number}> = (null as any as Collection<{x: number, y: number}>);
>x : Symbol(x, Decl(comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts, 7, 5))
>Collection : Symbol(Collection, Decl(comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts, 1, 32))
>x : Symbol(x, Decl(comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts, 7, 21))
>Collection : Symbol(Collection, Decl(comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts, 1, 32))
>x : Symbol(x, Decl(comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts, 7, 63))
>y : Symbol(y, Decl(comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts, 7, 73))
export {};

View file

@ -0,0 +1,25 @@
=== tests/cases/compiler/comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts ===
type PartialDeep<T> = {[K in keyof T]?: PartialDeep<T[K]>};
>PartialDeep : PartialDeep<T>
type Many<T> = T | readonly T[];
>Many : Many<T>
interface Collection<T> {
sortBy(...iteratees: Many<PartialDeep<T>>[]): Collection<T>;
>sortBy : (...iteratees: Many<PartialDeep<T>>[]) => Collection<T>
>iteratees : Many<PartialDeep<T>>[]
}
const x: Collection<{x: number}> = (null as any as Collection<{x: number, y: number}>);
>x : Collection<{ x: number; }>
>x : number
>(null as any as Collection<{x: number, y: number}>) : Collection<{ x: number; y: number; }>
>null as any as Collection<{x: number, y: number}> : Collection<{ x: number; y: number; }>
>null as any : any
>null : null
>x : number
>y : number
export {};

View file

@ -7,6 +7,7 @@ Starting "rush rebuild"
Executing a maximum of ?simultaneous processes...
XX of XX: [@azure/abort-controller] completed successfully in ? seconds
XX of XX: [@azure/core-auth] completed successfully in ? seconds
XX of XX: [@azure/core-tracing] completed successfully in ? seconds
XX of XX: [@azure/core-http] completed successfully in ? seconds
XX of XX: [@azure/core-arm] completed successfully in ? seconds
XX of XX: [@azure/core-paging] completed successfully in ? seconds
@ -18,12 +19,11 @@ XX of XX: [@azure/keyvault-keys] completed successfully in ? seconds
XX of XX: [@azure/keyvault-secrets] completed successfully in ? seconds
XX of XX: [@azure/app-configuration] completed successfully in ? seconds
XX of XX: [@azure/core-asynciterator-polyfill] completed successfully in ? seconds
XX of XX: [@azure/core-tracing] completed successfully in ? seconds
Warning: You have changed the public API signature for this project. Updating review/cosmos.api.md
dist-esm/index.js → dist/index.js...
(!) Unresolved dependencies
https://rollupjs.org/guide/en/#warning-treating-module-as-external-dependency
tslib (imported by dist-esm/auth.js, dist-esm/queryIterator.js, dist-esm/CosmosClient.js, dist-esm/plugins/Plugin.js, dist-esm/ClientContext.js, dist-esm/globalEndpointManager.js, dist-esm/client/Conflict/Conflict.js, dist-esm/client/Container/Container.js, dist-esm/client/Container/Containers.js, dist-esm/client/Database/Database.js, dist-esm/client/Database/Databases.js, dist-esm/client/Item/Item.js, dist-esm/client/Item/Items.js, dist-esm/client/Offer/Offer.js, dist-esm/client/Permission/Permission.js, dist-esm/client/Permission/Permissions.js, dist-esm/client/StoredProcedure/StoredProcedure.js, dist-esm/client/StoredProcedure/StoredProcedures.js, dist-esm/client/Trigger/Trigger.js, dist-esm/client/Trigger/Triggers.js, dist-esm/client/User/User.js, dist-esm/client/User/Users.js, dist-esm/client/UserDefinedFunction/UserDefinedFunction.js, dist-esm/client/UserDefinedFunction/UserDefinedFunctions.js, dist-esm/queryExecutionContext/defaultQueryExecutionContext.js, dist-esm/queryExecutionContext/documentProducer.js, dist-esm/queryExecutionContext/parallelQueryExecutionContextBase.js, dist-esm/queryExecutionContext/pipelinedQueryExecutionContext.js, dist-esm/request/request.js, dist-esm/request/RequestHandler.js, dist-esm/ChangeFeedIterator.js, dist-esm/routing/smartRoutingMapProvider.js, dist-esm/queryExecutionContext/EndpointComponent/AggregateEndpointComponent.js, dist-esm/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.js, dist-esm/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.js, dist-esm/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.js, dist-esm/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.js, dist-esm/retry/retryUtility.js, dist-esm/retry/defaultRetryPolicy.js, dist-esm/retry/endpointDiscoveryRetryPolicy.js, dist-esm/routing/partitionKeyRangeCache.js, dist-esm/retry/resourceThrottleRetryPolicy.js, dist-esm/retry/sessionRetryPolicy.js)
tslib (imported by dist-esm/auth.js, dist-esm/queryIterator.js, dist-esm/CosmosClient.js, dist-esm/plugins/Plugin.js, dist-esm/ClientContext.js, dist-esm/globalEndpointManager.js, dist-esm/client/Conflict/Conflict.js, dist-esm/client/Container/Container.js, dist-esm/client/Container/Containers.js, dist-esm/client/Database/Database.js, dist-esm/client/Database/Databases.js, dist-esm/client/Item/Item.js, dist-esm/client/Item/Items.js, dist-esm/client/Offer/Offer.js, dist-esm/client/Permission/Permission.js, dist-esm/client/Permission/Permissions.js, dist-esm/client/StoredProcedure/StoredProcedure.js, dist-esm/client/StoredProcedure/StoredProcedures.js, dist-esm/client/Trigger/Trigger.js, dist-esm/client/Trigger/Triggers.js, dist-esm/client/User/User.js, dist-esm/client/User/Users.js, dist-esm/client/UserDefinedFunction/UserDefinedFunctions.js, dist-esm/client/UserDefinedFunction/UserDefinedFunction.js, dist-esm/queryExecutionContext/documentProducer.js, dist-esm/queryExecutionContext/defaultQueryExecutionContext.js, dist-esm/queryExecutionContext/parallelQueryExecutionContextBase.js, dist-esm/queryExecutionContext/pipelinedQueryExecutionContext.js, dist-esm/request/request.js, dist-esm/request/RequestHandler.js, dist-esm/ChangeFeedIterator.js, dist-esm/routing/smartRoutingMapProvider.js, dist-esm/queryExecutionContext/EndpointComponent/AggregateEndpointComponent.js, dist-esm/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.js, dist-esm/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.js, dist-esm/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.js, dist-esm/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.js, dist-esm/retry/retryUtility.js, dist-esm/routing/partitionKeyRangeCache.js, dist-esm/retry/defaultRetryPolicy.js, dist-esm/retry/endpointDiscoveryRetryPolicy.js, dist-esm/retry/resourceThrottleRetryPolicy.js, dist-esm/retry/sessionRetryPolicy.js)
@azure/cosmos-sign (imported by dist-esm/auth.js)
universal-user-agent (imported by dist-esm/common/platform.js)
uuid/v4 (imported by dist-esm/ClientContext.js, dist-esm/client/Item/Items.js)
@ -67,6 +67,7 @@ SUCCESS (20)
================================
@azure/abort-controller (? seconds)
@azure/core-auth (? seconds)
@azure/core-tracing (? seconds)
@azure/core-http (? seconds)
@azure/core-arm (? seconds)
@azure/core-paging (? seconds)
@ -78,7 +79,6 @@ SUCCESS (20)
@azure/keyvault-secrets (? seconds)
@azure/app-configuration (? seconds)
@azure/core-asynciterator-polyfill (? seconds)
@azure/core-tracing (? seconds)
@azure/keyvault-certificates (? seconds)
@azure/storage-blob (? seconds)
@azure/storage-file (? seconds)
@ -93,7 +93,7 @@ Warning: You have changed the public API signature for this project. Updating re
dist-esm/index.js → dist/index.js...
(!) Unresolved dependencies
https://rollupjs.org/guide/en/#warning-treating-module-as-external-dependency
tslib (imported by dist-esm/auth.js, dist-esm/queryIterator.js, dist-esm/CosmosClient.js, dist-esm/plugins/Plugin.js, dist-esm/ClientContext.js, dist-esm/globalEndpointManager.js, dist-esm/client/Conflict/Conflict.js, dist-esm/client/Container/Container.js, dist-esm/client/Container/Containers.js, dist-esm/client/Database/Database.js, dist-esm/client/Database/Databases.js, dist-esm/client/Item/Item.js, dist-esm/client/Item/Items.js, dist-esm/client/Offer/Offer.js, dist-esm/client/Permission/Permission.js, dist-esm/client/Permission/Permissions.js, dist-esm/client/StoredProcedure/StoredProcedure.js, dist-esm/client/StoredProcedure/StoredProcedures.js, dist-esm/client/Trigger/Trigger.js, dist-esm/client/Trigger/Triggers.js, dist-esm/client/User/User.js, dist-esm/client/User/Users.js, dist-esm/client/UserDefinedFunction/UserDefinedFunction.js, dist-esm/client/UserDefinedFunction/UserDefinedFunctions.js, dist-esm/queryExecutionContext/defaultQueryExecutionContext.js, dist-esm/queryExecutionContext/documentProducer.js, dist-esm/queryExecutionContext/parallelQueryExecutionContextBase.js, dist-esm/queryExecutionContext/pipelinedQueryExecutionContext.js, dist-esm/request/request.js, dist-esm/request/RequestHandler.js, dist-esm/ChangeFeedIterator.js, dist-esm/routing/smartRoutingMapProvider.js, dist-esm/queryExecutionContext/EndpointComponent/AggregateEndpointComponent.js, dist-esm/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.js, dist-esm/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.js, dist-esm/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.js, dist-esm/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.js, dist-esm/retry/retryUtility.js, dist-esm/retry/defaultRetryPolicy.js, dist-esm/retry/endpointDiscoveryRetryPolicy.js, dist-esm/routing/partitionKeyRangeCache.js, dist-esm/retry/resourceThrottleRetryPolicy.js, dist-esm/retry/sessionRetryPolicy.js)
tslib (imported by dist-esm/auth.js, dist-esm/queryIterator.js, dist-esm/CosmosClient.js, dist-esm/plugins/Plugin.js, dist-esm/ClientContext.js, dist-esm/globalEndpointManager.js, dist-esm/client/Conflict/Conflict.js, dist-esm/client/Container/Container.js, dist-esm/client/Container/Containers.js, dist-esm/client/Database/Database.js, dist-esm/client/Database/Databases.js, dist-esm/client/Item/Item.js, dist-esm/client/Item/Items.js, dist-esm/client/Offer/Offer.js, dist-esm/client/Permission/Permission.js, dist-esm/client/Permission/Permissions.js, dist-esm/client/StoredProcedure/StoredProcedure.js, dist-esm/client/StoredProcedure/StoredProcedures.js, dist-esm/client/Trigger/Trigger.js, dist-esm/client/Trigger/Triggers.js, dist-esm/client/User/User.js, dist-esm/client/User/Users.js, dist-esm/client/UserDefinedFunction/UserDefinedFunctions.js, dist-esm/client/UserDefinedFunction/UserDefinedFunction.js, dist-esm/queryExecutionContext/documentProducer.js, dist-esm/queryExecutionContext/defaultQueryExecutionContext.js, dist-esm/queryExecutionContext/parallelQueryExecutionContextBase.js, dist-esm/queryExecutionContext/pipelinedQueryExecutionContext.js, dist-esm/request/request.js, dist-esm/request/RequestHandler.js, dist-esm/ChangeFeedIterator.js, dist-esm/routing/smartRoutingMapProvider.js, dist-esm/queryExecutionContext/EndpointComponent/AggregateEndpointComponent.js, dist-esm/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.js, dist-esm/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.js, dist-esm/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.js, dist-esm/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.js, dist-esm/retry/retryUtility.js, dist-esm/routing/partitionKeyRangeCache.js, dist-esm/retry/defaultRetryPolicy.js, dist-esm/retry/endpointDiscoveryRetryPolicy.js, dist-esm/retry/resourceThrottleRetryPolicy.js, dist-esm/retry/sessionRetryPolicy.js)
@azure/cosmos-sign (imported by dist-esm/auth.js)
universal-user-agent (imported by dist-esm/common/platform.js)
uuid/v4 (imported by dist-esm/ClientContext.js, dist-esm/client/Item/Items.js)

View file

@ -84,6 +84,7 @@ Standard output:
@uifabric/merge-styles: PASS src/Stylesheet.test.ts
@uifabric/merge-styles: PASS src/extractStyleParts.test.ts
@uifabric/merge-styles: PASS src/server.test.ts
@uifabric/merge-styles: PASS src/fontFace.test.ts
@uifabric/merge-styles: [XX:XX:XX XM] ■ Extracting Public API surface from '/office-ui-fabric-react/packages/merge-styles/lib/index.d.ts'
@uifabric/merge-styles: Done in ?s.
@uifabric/jest-serializer-merge-styles: yarn run vX.X.X
@ -179,7 +180,6 @@ Standard output:
@uifabric/styling: PASS src/styles/theme.test.ts
@uifabric/styling: PASS src/styles/scheme.test.ts
@uifabric/styling: PASS src/styles/getGlobalClassNames.test.ts
@uifabric/styling: PASS src/utilities/icons.test.ts
@uifabric/styling: [XX:XX:XX XM] ■ Extracting Public API surface from '/office-ui-fabric-react/packages/styling/lib/index.d.ts'
@uifabric/styling: Done in ?s.
@uifabric/file-type-icons: yarn run vX.X.X
@ -459,7 +459,6 @@ lerna info Executing command in 41 packages: "yarn run build --production --lint
@uifabric/foundation: at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
@uifabric/foundation: [XX:XX:XX XM] x ------------------------------------
@uifabric/foundation: [XX:XX:XX XM] x Error previously detected. See above for error messages.
@uifabric/foundation: [XX:XX:XX XM] x Other tasks that did not complete: [webpack]
@uifabric/foundation: error Command failed with exit code 1.
lerna ERR! yarn run build --production --lint exited 1 in '@uifabric/foundation'
lerna WARN complete Waiting for 1 child process to exit. CTRL-C to exit immediately.

View file

@ -1,11 +1,10 @@
Exit Code: 1
Exit Code: 0
Standard output:
yarn run vX.X.X
$ gulp compile --max_old_space_size=4095
[XX:XX:XX] Node flags detected: --max_old_space_size=4095
[XX:XX:XX] Using gulpfile /vscode/gulpfile.js
[XX:XX:XX] Error: /vscode/node_modules/@types/node/index.d.ts(179,11): Duplicate identifier 'IteratorResult'.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Done in ?s.
@ -13,15 +12,3 @@ Standard error:
{"type":"warning","data":"package.json: No license field"}
{"type":"warning","data":"../package.json: No license field"}
{"type":"warning","data":"vscode-web@X.X.X: No license field"}
[XX:XX:XX] 'compile' errored after ?s
[XX:XX:XX] Error: Found 1 errors
at Stream.<anonymous> (/vscode/build/lib/reporter.js:74:29)
at _end (/vscode/node_modules/through/index.js:65:9)
at Stream.stream.end (/vscode/node_modules/through/index.js:74:5)
at StreamFilter.onend (/vscode/node_modules/readable-stream/lib/_stream_readable.js:570:10)
at Object.onceWrapper (events.js:286:20)
at StreamFilter.emit (events.js:203:15)
at StreamFilter.EventEmitter.emit (domain.js:466:23)
at endReadableNT (/vscode/node_modules/readable-stream/lib/_stream_readable.js:992:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
error Command failed with exit code 1.

View file

@ -0,0 +1,15 @@
=== tests/cases/conformance/jsdoc/enumTagOnExports.js ===
/** @enum {number} */
exports.a = {};
>exports.a : Symbol(a, Decl(enumTagOnExports.js, 0, 0), Decl(enumTagOnExports.js, 1, 8), Decl(enumTagOnExports.js, 0, 4))
>exports : Symbol(a, Decl(enumTagOnExports.js, 0, 0), Decl(enumTagOnExports.js, 1, 8), Decl(enumTagOnExports.js, 0, 4))
>a : Symbol(a, Decl(enumTagOnExports.js, 0, 0), Decl(enumTagOnExports.js, 1, 8), Decl(enumTagOnExports.js, 0, 4))
/** @enum {string} */
module.exports.b = {};
>module.exports.b : Symbol(b, Decl(enumTagOnExports.js, 1, 15), Decl(enumTagOnExports.js, 4, 15), Decl(enumTagOnExports.js, 3, 4))
>module.exports : Symbol(b, Decl(enumTagOnExports.js, 1, 15), Decl(enumTagOnExports.js, 4, 15), Decl(enumTagOnExports.js, 3, 4))
>module : Symbol(module, Decl(enumTagOnExports.js, 1, 15))
>exports : Symbol("tests/cases/conformance/jsdoc/enumTagOnExports", Decl(enumTagOnExports.js, 0, 0))
>b : Symbol(b, Decl(enumTagOnExports.js, 1, 15), Decl(enumTagOnExports.js, 4, 15), Decl(enumTagOnExports.js, 3, 4))

View file

@ -0,0 +1,19 @@
=== tests/cases/conformance/jsdoc/enumTagOnExports.js ===
/** @enum {number} */
exports.a = {};
>exports.a = {} : {}
>exports.a : typeof a
>exports : typeof import("tests/cases/conformance/jsdoc/enumTagOnExports")
>a : typeof a
>{} : {}
/** @enum {string} */
module.exports.b = {};
>module.exports.b = {} : {}
>module.exports.b : typeof b
>module.exports : typeof import("tests/cases/conformance/jsdoc/enumTagOnExports")
>module : { "tests/cases/conformance/jsdoc/enumTagOnExports": typeof import("tests/cases/conformance/jsdoc/enumTagOnExports"); }
>exports : typeof import("tests/cases/conformance/jsdoc/enumTagOnExports")
>b : typeof b
>{} : {}

View file

@ -0,0 +1,7 @@
=== tests/cases/conformance/jsdoc/enumTagOnExports.js ===
/** @enum {string} */
module.exports = {};
>module.exports : Symbol("tests/cases/conformance/jsdoc/enumTagOnExports", Decl(enumTagOnExports.js, 0, 0))
>module : Symbol(module, Decl(enumTagOnExports.js, 0, 0))
>exports : Symbol("tests/cases/conformance/jsdoc/enumTagOnExports", Decl(enumTagOnExports.js, 0, 0))

View file

@ -0,0 +1,9 @@
=== tests/cases/conformance/jsdoc/enumTagOnExports.js ===
/** @enum {string} */
module.exports = {};
>module.exports = {} : typeof import("tests/cases/conformance/jsdoc/enumTagOnExports")
>module.exports : typeof import("tests/cases/conformance/jsdoc/enumTagOnExports")
>module : { "tests/cases/conformance/jsdoc/enumTagOnExports": typeof import("tests/cases/conformance/jsdoc/enumTagOnExports"); }
>exports : typeof import("tests/cases/conformance/jsdoc/enumTagOnExports")
>{} : {}

View file

@ -0,0 +1,20 @@
tests/cases/compiler/quickIntersectionCheckCorrectlyCachesErrors.tsx(10,21): error TS2304: Cannot find name 'React'.
==== tests/cases/compiler/quickIntersectionCheckCorrectlyCachesErrors.tsx (1 errors) ====
interface F<P> {
(props: P & { children?: boolean }): void;
propTypes: { [K in keyof P]: null extends P ? K : K };
}
declare function g(C: F<unknown>): string;
export function wu<CP extends { o: object }>(CC: F<CP>) {
class WU {
m() {
g(CC)
return <CC {...(null as unknown as CP)} />;
~~
!!! error TS2304: Cannot find name 'React'.
}
}
}

View file

@ -0,0 +1,42 @@
//// [quickIntersectionCheckCorrectlyCachesErrors.tsx]
interface F<P> {
(props: P & { children?: boolean }): void;
propTypes: { [K in keyof P]: null extends P ? K : K };
}
declare function g(C: F<unknown>): string;
export function wu<CP extends { o: object }>(CC: F<CP>) {
class WU {
m() {
g(CC)
return <CC {...(null as unknown as CP)} />;
}
}
}
//// [quickIntersectionCheckCorrectlyCachesErrors.js]
"use strict";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
exports.__esModule = true;
function wu(CC) {
var WU = /** @class */ (function () {
function WU() {
}
WU.prototype.m = function () {
g(CC);
return React.createElement(CC, __assign({}, null));
};
return WU;
}());
}
exports.wu = wu;

View file

@ -0,0 +1,48 @@
=== tests/cases/compiler/quickIntersectionCheckCorrectlyCachesErrors.tsx ===
interface F<P> {
>F : Symbol(F, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 0, 0))
>P : Symbol(P, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 0, 12))
(props: P & { children?: boolean }): void;
>props : Symbol(props, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 1, 5))
>P : Symbol(P, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 0, 12))
>children : Symbol(children, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 1, 17))
propTypes: { [K in keyof P]: null extends P ? K : K };
>propTypes : Symbol(F.propTypes, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 1, 46))
>K : Symbol(K, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 2, 18))
>P : Symbol(P, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 0, 12))
>P : Symbol(P, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 0, 12))
>K : Symbol(K, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 2, 18))
>K : Symbol(K, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 2, 18))
}
declare function g(C: F<unknown>): string;
>g : Symbol(g, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 3, 1))
>C : Symbol(C, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 4, 19))
>F : Symbol(F, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 0, 0))
export function wu<CP extends { o: object }>(CC: F<CP>) {
>wu : Symbol(wu, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 4, 42))
>CP : Symbol(CP, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 5, 19))
>o : Symbol(o, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 5, 31))
>CC : Symbol(CC, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 5, 45))
>F : Symbol(F, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 0, 0))
>CP : Symbol(CP, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 5, 19))
class WU {
>WU : Symbol(WU, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 5, 57))
m() {
>m : Symbol(WU.m, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 6, 14))
g(CC)
>g : Symbol(g, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 3, 1))
>CC : Symbol(CC, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 5, 45))
return <CC {...(null as unknown as CP)} />;
>CC : Symbol(CC, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 5, 45))
>CP : Symbol(CP, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 5, 19))
}
}
}

View file

@ -0,0 +1,41 @@
=== tests/cases/compiler/quickIntersectionCheckCorrectlyCachesErrors.tsx ===
interface F<P> {
(props: P & { children?: boolean }): void;
>props : P & { children?: boolean; }
>children : boolean
propTypes: { [K in keyof P]: null extends P ? K : K };
>propTypes : { [K in keyof P]: null extends P ? K : K; }
>null : null
}
declare function g(C: F<unknown>): string;
>g : (C: F<unknown>) => string
>C : F<unknown>
export function wu<CP extends { o: object }>(CC: F<CP>) {
>wu : <CP extends { o: object; }>(CC: F<CP>) => void
>o : object
>CC : F<CP>
class WU {
>WU : WU
m() {
>m : () => any
g(CC)
>g(CC) : string
>g : (C: F<unknown>) => string
>CC : F<CP>
return <CC {...(null as unknown as CP)} />;
><CC {...(null as unknown as CP)} /> : any
>CC : F<CP>
>(null as unknown as CP) : CP
>null as unknown as CP : CP
>null as unknown : unknown
>null : null
}
}
}

View file

@ -0,0 +1,63 @@
//// [vueLikeDataAndPropsInference.ts]
interface Instance {
_instanceBrand: never
}
type DataDef<Data, Props> = (this: Readonly<Props> & Instance) => Data
type PropsDefinition<T> = {
[K in keyof T]: T[K]
}
interface Options<
Data = ((this: Instance) => object),
PropsDef = {}
> {
data?: Data
props?: PropsDef
watch?: Record<string, WatchHandler<any>>
}
type WatchHandler<T> = (val: T, oldVal: T) => void;
type ThisTypedOptions<Data, Props> =
Options<DataDef<Data, Props>, PropsDefinition<Props>> &
ThisType<Data & Readonly<Props> & Instance>
declare function test<Data, Props>(fn: ThisTypedOptions<Data, Props>): void;
declare function test(fn: Options): void;
test({
props: {
foo: ''
},
data(): { bar: boolean } {
return {
bar: true
}
},
watch: {
foo(newVal: string, oldVal: string): void {
this.bar = false
}
}
})
//// [vueLikeDataAndPropsInference.js]
test({
props: {
foo: ''
},
data: function () {
return {
bar: true
};
},
watch: {
foo: function (newVal, oldVal) {
this.bar = false;
}
}
});

View file

@ -0,0 +1,130 @@
=== tests/cases/compiler/vueLikeDataAndPropsInference.ts ===
interface Instance {
>Instance : Symbol(Instance, Decl(vueLikeDataAndPropsInference.ts, 0, 0))
_instanceBrand: never
>_instanceBrand : Symbol(Instance._instanceBrand, Decl(vueLikeDataAndPropsInference.ts, 0, 20))
}
type DataDef<Data, Props> = (this: Readonly<Props> & Instance) => Data
>DataDef : Symbol(DataDef, Decl(vueLikeDataAndPropsInference.ts, 2, 1))
>Data : Symbol(Data, Decl(vueLikeDataAndPropsInference.ts, 4, 13))
>Props : Symbol(Props, Decl(vueLikeDataAndPropsInference.ts, 4, 18))
>this : Symbol(this, Decl(vueLikeDataAndPropsInference.ts, 4, 29))
>Readonly : Symbol(Readonly, Decl(lib.es5.d.ts, --, --))
>Props : Symbol(Props, Decl(vueLikeDataAndPropsInference.ts, 4, 18))
>Instance : Symbol(Instance, Decl(vueLikeDataAndPropsInference.ts, 0, 0))
>Data : Symbol(Data, Decl(vueLikeDataAndPropsInference.ts, 4, 13))
type PropsDefinition<T> = {
>PropsDefinition : Symbol(PropsDefinition, Decl(vueLikeDataAndPropsInference.ts, 4, 70))
>T : Symbol(T, Decl(vueLikeDataAndPropsInference.ts, 6, 21))
[K in keyof T]: T[K]
>K : Symbol(K, Decl(vueLikeDataAndPropsInference.ts, 7, 5))
>T : Symbol(T, Decl(vueLikeDataAndPropsInference.ts, 6, 21))
>T : Symbol(T, Decl(vueLikeDataAndPropsInference.ts, 6, 21))
>K : Symbol(K, Decl(vueLikeDataAndPropsInference.ts, 7, 5))
}
interface Options<
>Options : Symbol(Options, Decl(vueLikeDataAndPropsInference.ts, 8, 1))
Data = ((this: Instance) => object),
>Data : Symbol(Data, Decl(vueLikeDataAndPropsInference.ts, 10, 18))
>this : Symbol(this, Decl(vueLikeDataAndPropsInference.ts, 11, 13))
>Instance : Symbol(Instance, Decl(vueLikeDataAndPropsInference.ts, 0, 0))
PropsDef = {}
>PropsDef : Symbol(PropsDef, Decl(vueLikeDataAndPropsInference.ts, 11, 40))
> {
data?: Data
>data : Symbol(Options.data, Decl(vueLikeDataAndPropsInference.ts, 13, 7))
>Data : Symbol(Data, Decl(vueLikeDataAndPropsInference.ts, 10, 18))
props?: PropsDef
>props : Symbol(Options.props, Decl(vueLikeDataAndPropsInference.ts, 14, 15))
>PropsDef : Symbol(PropsDef, Decl(vueLikeDataAndPropsInference.ts, 11, 40))
watch?: Record<string, WatchHandler<any>>
>watch : Symbol(Options.watch, Decl(vueLikeDataAndPropsInference.ts, 15, 20))
>Record : Symbol(Record, Decl(lib.es5.d.ts, --, --))
>WatchHandler : Symbol(WatchHandler, Decl(vueLikeDataAndPropsInference.ts, 17, 1))
}
type WatchHandler<T> = (val: T, oldVal: T) => void;
>WatchHandler : Symbol(WatchHandler, Decl(vueLikeDataAndPropsInference.ts, 17, 1))
>T : Symbol(T, Decl(vueLikeDataAndPropsInference.ts, 19, 18))
>val : Symbol(val, Decl(vueLikeDataAndPropsInference.ts, 19, 24))
>T : Symbol(T, Decl(vueLikeDataAndPropsInference.ts, 19, 18))
>oldVal : Symbol(oldVal, Decl(vueLikeDataAndPropsInference.ts, 19, 31))
>T : Symbol(T, Decl(vueLikeDataAndPropsInference.ts, 19, 18))
type ThisTypedOptions<Data, Props> =
>ThisTypedOptions : Symbol(ThisTypedOptions, Decl(vueLikeDataAndPropsInference.ts, 19, 51))
>Data : Symbol(Data, Decl(vueLikeDataAndPropsInference.ts, 21, 22))
>Props : Symbol(Props, Decl(vueLikeDataAndPropsInference.ts, 21, 27))
Options<DataDef<Data, Props>, PropsDefinition<Props>> &
>Options : Symbol(Options, Decl(vueLikeDataAndPropsInference.ts, 8, 1))
>DataDef : Symbol(DataDef, Decl(vueLikeDataAndPropsInference.ts, 2, 1))
>Data : Symbol(Data, Decl(vueLikeDataAndPropsInference.ts, 21, 22))
>Props : Symbol(Props, Decl(vueLikeDataAndPropsInference.ts, 21, 27))
>PropsDefinition : Symbol(PropsDefinition, Decl(vueLikeDataAndPropsInference.ts, 4, 70))
>Props : Symbol(Props, Decl(vueLikeDataAndPropsInference.ts, 21, 27))
ThisType<Data & Readonly<Props> & Instance>
>ThisType : Symbol(ThisType, Decl(lib.es5.d.ts, --, --))
>Data : Symbol(Data, Decl(vueLikeDataAndPropsInference.ts, 21, 22))
>Readonly : Symbol(Readonly, Decl(lib.es5.d.ts, --, --))
>Props : Symbol(Props, Decl(vueLikeDataAndPropsInference.ts, 21, 27))
>Instance : Symbol(Instance, Decl(vueLikeDataAndPropsInference.ts, 0, 0))
declare function test<Data, Props>(fn: ThisTypedOptions<Data, Props>): void;
>test : Symbol(test, Decl(vueLikeDataAndPropsInference.ts, 23, 47), Decl(vueLikeDataAndPropsInference.ts, 25, 76))
>Data : Symbol(Data, Decl(vueLikeDataAndPropsInference.ts, 25, 22))
>Props : Symbol(Props, Decl(vueLikeDataAndPropsInference.ts, 25, 27))
>fn : Symbol(fn, Decl(vueLikeDataAndPropsInference.ts, 25, 35))
>ThisTypedOptions : Symbol(ThisTypedOptions, Decl(vueLikeDataAndPropsInference.ts, 19, 51))
>Data : Symbol(Data, Decl(vueLikeDataAndPropsInference.ts, 25, 22))
>Props : Symbol(Props, Decl(vueLikeDataAndPropsInference.ts, 25, 27))
declare function test(fn: Options): void;
>test : Symbol(test, Decl(vueLikeDataAndPropsInference.ts, 23, 47), Decl(vueLikeDataAndPropsInference.ts, 25, 76))
>fn : Symbol(fn, Decl(vueLikeDataAndPropsInference.ts, 26, 22))
>Options : Symbol(Options, Decl(vueLikeDataAndPropsInference.ts, 8, 1))
test({
>test : Symbol(test, Decl(vueLikeDataAndPropsInference.ts, 23, 47), Decl(vueLikeDataAndPropsInference.ts, 25, 76))
props: {
>props : Symbol(props, Decl(vueLikeDataAndPropsInference.ts, 28, 6))
foo: ''
>foo : Symbol(foo, Decl(vueLikeDataAndPropsInference.ts, 29, 12))
},
data(): { bar: boolean } {
>data : Symbol(data, Decl(vueLikeDataAndPropsInference.ts, 31, 6))
>bar : Symbol(bar, Decl(vueLikeDataAndPropsInference.ts, 33, 13))
return {
bar: true
>bar : Symbol(bar, Decl(vueLikeDataAndPropsInference.ts, 34, 16))
}
},
watch: {
>watch : Symbol(watch, Decl(vueLikeDataAndPropsInference.ts, 37, 6))
foo(newVal: string, oldVal: string): void {
>foo : Symbol(foo, Decl(vueLikeDataAndPropsInference.ts, 39, 12))
>newVal : Symbol(newVal, Decl(vueLikeDataAndPropsInference.ts, 40, 12))
>oldVal : Symbol(oldVal, Decl(vueLikeDataAndPropsInference.ts, 40, 27))
this.bar = false
}
}
})

View file

@ -0,0 +1,97 @@
=== tests/cases/compiler/vueLikeDataAndPropsInference.ts ===
interface Instance {
_instanceBrand: never
>_instanceBrand : never
}
type DataDef<Data, Props> = (this: Readonly<Props> & Instance) => Data
>DataDef : DataDef<Data, Props>
>this : Readonly<Props> & Instance
type PropsDefinition<T> = {
>PropsDefinition : PropsDefinition<T>
[K in keyof T]: T[K]
}
interface Options<
Data = ((this: Instance) => object),
>this : Instance
PropsDef = {}
> {
data?: Data
>data : Data
props?: PropsDef
>props : PropsDef
watch?: Record<string, WatchHandler<any>>
>watch : Record<string, WatchHandler<any>>
}
type WatchHandler<T> = (val: T, oldVal: T) => void;
>WatchHandler : WatchHandler<T>
>val : T
>oldVal : T
type ThisTypedOptions<Data, Props> =
>ThisTypedOptions : ThisTypedOptions<Data, Props>
Options<DataDef<Data, Props>, PropsDefinition<Props>> &
ThisType<Data & Readonly<Props> & Instance>
declare function test<Data, Props>(fn: ThisTypedOptions<Data, Props>): void;
>test : { <Data, Props>(fn: ThisTypedOptions<Data, Props>): void; (fn: Options<(this: Instance) => object, {}>): void; }
>fn : ThisTypedOptions<Data, Props>
declare function test(fn: Options): void;
>test : { <Data, Props>(fn: ThisTypedOptions<Data, Props>): void; (fn: Options<(this: Instance) => object, {}>): void; }
>fn : Options<(this: Instance) => object, {}>
test({
>test({ props: { foo: '' }, data(): { bar: boolean } { return { bar: true } }, watch: { foo(newVal: string, oldVal: string): void { this.bar = false } }}) : void
>test : { <Data, Props>(fn: ThisTypedOptions<Data, Props>): void; (fn: Options<(this: Instance) => object, {}>): void; }
>{ props: { foo: '' }, data(): { bar: boolean } { return { bar: true } }, watch: { foo(newVal: string, oldVal: string): void { this.bar = false } }} : { props: { foo: string; }; data(this: Readonly<{ foo: string; }> & Instance): { bar: boolean; }; watch: { foo(newVal: string, oldVal: string): void; }; }
props: {
>props : { foo: string; }
>{ foo: '' } : { foo: string; }
foo: ''
>foo : string
>'' : ""
},
data(): { bar: boolean } {
>data : (this: Readonly<{ foo: string; }> & Instance) => { bar: boolean; }
>bar : boolean
return {
>{ bar: true } : { bar: true; }
bar: true
>bar : true
>true : true
}
},
watch: {
>watch : { foo(newVal: string, oldVal: string): void; }
>{ foo(newVal: string, oldVal: string): void { this.bar = false } } : { foo(newVal: string, oldVal: string): void; }
foo(newVal: string, oldVal: string): void {
>foo : (newVal: string, oldVal: string) => void
>newVal : string
>oldVal : string
this.bar = false
>this.bar = false : false
>this.bar : any
>this : any
>bar : any
>false : false
}
}
})

View file

@ -0,0 +1,64 @@
//// [vueLikeDataAndPropsInference2.ts]
interface Instance {
_instanceBrand: never
}
type DataDef<Data, Props> = (this: Readonly<Props> & Instance) => Data
type PropsDefinition<T> = {
[K in keyof T]: T[K]
}
interface Options<
Data = object | ((this: Instance) => object),
PropsDef = PropsDefinition<Record<string, any>>
> {
data?: Data
props?: PropsDef
watch?: Record<string, WatchHandler<any>>
}
type WatchHandler<T> = (val: T, oldVal: T) => void;
type ThisTypedOptions<Data, Props> =
object &
Options<DataDef<Data, Props>, PropsDefinition<Props>> &
ThisType<Data & Readonly<Props> & Instance>
declare function test<Data, Props>(fn: ThisTypedOptions<Data, Props>): void;
declare function test(fn: Options): void;
test({
props: {
foo: ''
},
data(): { bar: boolean } {
return {
bar: true
}
},
watch: {
foo(newVal: string, oldVal: string): void {
this.bar = false
}
}
})
//// [vueLikeDataAndPropsInference2.js]
test({
props: {
foo: ''
},
data: function () {
return {
bar: true
};
},
watch: {
foo: function (newVal, oldVal) {
this.bar = false;
}
}
});

View file

@ -0,0 +1,133 @@
=== tests/cases/compiler/vueLikeDataAndPropsInference2.ts ===
interface Instance {
>Instance : Symbol(Instance, Decl(vueLikeDataAndPropsInference2.ts, 0, 0))
_instanceBrand: never
>_instanceBrand : Symbol(Instance._instanceBrand, Decl(vueLikeDataAndPropsInference2.ts, 0, 20))
}
type DataDef<Data, Props> = (this: Readonly<Props> & Instance) => Data
>DataDef : Symbol(DataDef, Decl(vueLikeDataAndPropsInference2.ts, 2, 1))
>Data : Symbol(Data, Decl(vueLikeDataAndPropsInference2.ts, 4, 13))
>Props : Symbol(Props, Decl(vueLikeDataAndPropsInference2.ts, 4, 18))
>this : Symbol(this, Decl(vueLikeDataAndPropsInference2.ts, 4, 29))
>Readonly : Symbol(Readonly, Decl(lib.es5.d.ts, --, --))
>Props : Symbol(Props, Decl(vueLikeDataAndPropsInference2.ts, 4, 18))
>Instance : Symbol(Instance, Decl(vueLikeDataAndPropsInference2.ts, 0, 0))
>Data : Symbol(Data, Decl(vueLikeDataAndPropsInference2.ts, 4, 13))
type PropsDefinition<T> = {
>PropsDefinition : Symbol(PropsDefinition, Decl(vueLikeDataAndPropsInference2.ts, 4, 70))
>T : Symbol(T, Decl(vueLikeDataAndPropsInference2.ts, 6, 21))
[K in keyof T]: T[K]
>K : Symbol(K, Decl(vueLikeDataAndPropsInference2.ts, 7, 5))
>T : Symbol(T, Decl(vueLikeDataAndPropsInference2.ts, 6, 21))
>T : Symbol(T, Decl(vueLikeDataAndPropsInference2.ts, 6, 21))
>K : Symbol(K, Decl(vueLikeDataAndPropsInference2.ts, 7, 5))
}
interface Options<
>Options : Symbol(Options, Decl(vueLikeDataAndPropsInference2.ts, 8, 1))
Data = object | ((this: Instance) => object),
>Data : Symbol(Data, Decl(vueLikeDataAndPropsInference2.ts, 10, 18))
>this : Symbol(this, Decl(vueLikeDataAndPropsInference2.ts, 11, 22))
>Instance : Symbol(Instance, Decl(vueLikeDataAndPropsInference2.ts, 0, 0))
PropsDef = PropsDefinition<Record<string, any>>
>PropsDef : Symbol(PropsDef, Decl(vueLikeDataAndPropsInference2.ts, 11, 49))
>PropsDefinition : Symbol(PropsDefinition, Decl(vueLikeDataAndPropsInference2.ts, 4, 70))
>Record : Symbol(Record, Decl(lib.es5.d.ts, --, --))
> {
data?: Data
>data : Symbol(Options.data, Decl(vueLikeDataAndPropsInference2.ts, 13, 7))
>Data : Symbol(Data, Decl(vueLikeDataAndPropsInference2.ts, 10, 18))
props?: PropsDef
>props : Symbol(Options.props, Decl(vueLikeDataAndPropsInference2.ts, 14, 15))
>PropsDef : Symbol(PropsDef, Decl(vueLikeDataAndPropsInference2.ts, 11, 49))
watch?: Record<string, WatchHandler<any>>
>watch : Symbol(Options.watch, Decl(vueLikeDataAndPropsInference2.ts, 15, 20))
>Record : Symbol(Record, Decl(lib.es5.d.ts, --, --))
>WatchHandler : Symbol(WatchHandler, Decl(vueLikeDataAndPropsInference2.ts, 17, 1))
}
type WatchHandler<T> = (val: T, oldVal: T) => void;
>WatchHandler : Symbol(WatchHandler, Decl(vueLikeDataAndPropsInference2.ts, 17, 1))
>T : Symbol(T, Decl(vueLikeDataAndPropsInference2.ts, 19, 18))
>val : Symbol(val, Decl(vueLikeDataAndPropsInference2.ts, 19, 24))
>T : Symbol(T, Decl(vueLikeDataAndPropsInference2.ts, 19, 18))
>oldVal : Symbol(oldVal, Decl(vueLikeDataAndPropsInference2.ts, 19, 31))
>T : Symbol(T, Decl(vueLikeDataAndPropsInference2.ts, 19, 18))
type ThisTypedOptions<Data, Props> =
>ThisTypedOptions : Symbol(ThisTypedOptions, Decl(vueLikeDataAndPropsInference2.ts, 19, 51))
>Data : Symbol(Data, Decl(vueLikeDataAndPropsInference2.ts, 21, 22))
>Props : Symbol(Props, Decl(vueLikeDataAndPropsInference2.ts, 21, 27))
object &
Options<DataDef<Data, Props>, PropsDefinition<Props>> &
>Options : Symbol(Options, Decl(vueLikeDataAndPropsInference2.ts, 8, 1))
>DataDef : Symbol(DataDef, Decl(vueLikeDataAndPropsInference2.ts, 2, 1))
>Data : Symbol(Data, Decl(vueLikeDataAndPropsInference2.ts, 21, 22))
>Props : Symbol(Props, Decl(vueLikeDataAndPropsInference2.ts, 21, 27))
>PropsDefinition : Symbol(PropsDefinition, Decl(vueLikeDataAndPropsInference2.ts, 4, 70))
>Props : Symbol(Props, Decl(vueLikeDataAndPropsInference2.ts, 21, 27))
ThisType<Data & Readonly<Props> & Instance>
>ThisType : Symbol(ThisType, Decl(lib.es5.d.ts, --, --))
>Data : Symbol(Data, Decl(vueLikeDataAndPropsInference2.ts, 21, 22))
>Readonly : Symbol(Readonly, Decl(lib.es5.d.ts, --, --))
>Props : Symbol(Props, Decl(vueLikeDataAndPropsInference2.ts, 21, 27))
>Instance : Symbol(Instance, Decl(vueLikeDataAndPropsInference2.ts, 0, 0))
declare function test<Data, Props>(fn: ThisTypedOptions<Data, Props>): void;
>test : Symbol(test, Decl(vueLikeDataAndPropsInference2.ts, 24, 47), Decl(vueLikeDataAndPropsInference2.ts, 26, 76))
>Data : Symbol(Data, Decl(vueLikeDataAndPropsInference2.ts, 26, 22))
>Props : Symbol(Props, Decl(vueLikeDataAndPropsInference2.ts, 26, 27))
>fn : Symbol(fn, Decl(vueLikeDataAndPropsInference2.ts, 26, 35))
>ThisTypedOptions : Symbol(ThisTypedOptions, Decl(vueLikeDataAndPropsInference2.ts, 19, 51))
>Data : Symbol(Data, Decl(vueLikeDataAndPropsInference2.ts, 26, 22))
>Props : Symbol(Props, Decl(vueLikeDataAndPropsInference2.ts, 26, 27))
declare function test(fn: Options): void;
>test : Symbol(test, Decl(vueLikeDataAndPropsInference2.ts, 24, 47), Decl(vueLikeDataAndPropsInference2.ts, 26, 76))
>fn : Symbol(fn, Decl(vueLikeDataAndPropsInference2.ts, 27, 22))
>Options : Symbol(Options, Decl(vueLikeDataAndPropsInference2.ts, 8, 1))
test({
>test : Symbol(test, Decl(vueLikeDataAndPropsInference2.ts, 24, 47), Decl(vueLikeDataAndPropsInference2.ts, 26, 76))
props: {
>props : Symbol(props, Decl(vueLikeDataAndPropsInference2.ts, 29, 6))
foo: ''
>foo : Symbol(foo, Decl(vueLikeDataAndPropsInference2.ts, 30, 12))
},
data(): { bar: boolean } {
>data : Symbol(data, Decl(vueLikeDataAndPropsInference2.ts, 32, 6))
>bar : Symbol(bar, Decl(vueLikeDataAndPropsInference2.ts, 34, 13))
return {
bar: true
>bar : Symbol(bar, Decl(vueLikeDataAndPropsInference2.ts, 35, 16))
}
},
watch: {
>watch : Symbol(watch, Decl(vueLikeDataAndPropsInference2.ts, 38, 6))
foo(newVal: string, oldVal: string): void {
>foo : Symbol(foo, Decl(vueLikeDataAndPropsInference2.ts, 40, 12))
>newVal : Symbol(newVal, Decl(vueLikeDataAndPropsInference2.ts, 41, 12))
>oldVal : Symbol(oldVal, Decl(vueLikeDataAndPropsInference2.ts, 41, 27))
this.bar = false
}
}
})

View file

@ -0,0 +1,98 @@
=== tests/cases/compiler/vueLikeDataAndPropsInference2.ts ===
interface Instance {
_instanceBrand: never
>_instanceBrand : never
}
type DataDef<Data, Props> = (this: Readonly<Props> & Instance) => Data
>DataDef : DataDef<Data, Props>
>this : Readonly<Props> & Instance
type PropsDefinition<T> = {
>PropsDefinition : PropsDefinition<T>
[K in keyof T]: T[K]
}
interface Options<
Data = object | ((this: Instance) => object),
>this : Instance
PropsDef = PropsDefinition<Record<string, any>>
> {
data?: Data
>data : Data
props?: PropsDef
>props : PropsDef
watch?: Record<string, WatchHandler<any>>
>watch : Record<string, WatchHandler<any>>
}
type WatchHandler<T> = (val: T, oldVal: T) => void;
>WatchHandler : WatchHandler<T>
>val : T
>oldVal : T
type ThisTypedOptions<Data, Props> =
>ThisTypedOptions : ThisTypedOptions<Data, Props>
object &
Options<DataDef<Data, Props>, PropsDefinition<Props>> &
ThisType<Data & Readonly<Props> & Instance>
declare function test<Data, Props>(fn: ThisTypedOptions<Data, Props>): void;
>test : { <Data, Props>(fn: ThisTypedOptions<Data, Props>): void; (fn: Options<object | ((this: Instance) => object), PropsDefinition<Record<string, any>>>): void; }
>fn : ThisTypedOptions<Data, Props>
declare function test(fn: Options): void;
>test : { <Data, Props>(fn: ThisTypedOptions<Data, Props>): void; (fn: Options<object | ((this: Instance) => object), PropsDefinition<Record<string, any>>>): void; }
>fn : Options<object | ((this: Instance) => object), PropsDefinition<Record<string, any>>>
test({
>test({ props: { foo: '' }, data(): { bar: boolean } { return { bar: true } }, watch: { foo(newVal: string, oldVal: string): void { this.bar = false } }}) : void
>test : { <Data, Props>(fn: ThisTypedOptions<Data, Props>): void; (fn: Options<object | ((this: Instance) => object), PropsDefinition<Record<string, any>>>): void; }
>{ props: { foo: '' }, data(): { bar: boolean } { return { bar: true } }, watch: { foo(newVal: string, oldVal: string): void { this.bar = false } }} : { props: { foo: string; }; data(this: Readonly<{ foo: string; }> & Instance): { bar: boolean; }; watch: { foo(newVal: string, oldVal: string): void; }; }
props: {
>props : { foo: string; }
>{ foo: '' } : { foo: string; }
foo: ''
>foo : string
>'' : ""
},
data(): { bar: boolean } {
>data : (this: Readonly<{ foo: string; }> & Instance) => { bar: boolean; }
>bar : boolean
return {
>{ bar: true } : { bar: true; }
bar: true
>bar : true
>true : true
}
},
watch: {
>watch : { foo(newVal: string, oldVal: string): void; }
>{ foo(newVal: string, oldVal: string): void { this.bar = false } } : { foo(newVal: string, oldVal: string): void; }
foo(newVal: string, oldVal: string): void {
>foo : (newVal: string, oldVal: string) => void
>newVal : string
>oldVal : string
this.bar = false
>this.bar = false : false
>this.bar : any
>this : any
>bar : any
>false : false
}
}
})

View file

@ -0,0 +1,11 @@
// @strict: true
type PartialDeep<T> = {[K in keyof T]?: PartialDeep<T[K]>};
type Many<T> = T | readonly T[];
interface Collection<T> {
sortBy(...iteratees: Many<PartialDeep<T>>[]): Collection<T>;
}
const x: Collection<{x: number}> = (null as any as Collection<{x: number, y: number}>);
export {};

View file

@ -0,0 +1,15 @@
// @jsx: react
// @filename: quickIntersectionCheckCorrectlyCachesErrors.tsx
interface F<P> {
(props: P & { children?: boolean }): void;
propTypes: { [K in keyof P]: null extends P ? K : K };
}
declare function g(C: F<unknown>): string;
export function wu<CP extends { o: object }>(CC: F<CP>) {
class WU {
m() {
g(CC)
return <CC {...(null as unknown as CP)} />;
}
}
}

View file

@ -0,0 +1,45 @@
interface Instance {
_instanceBrand: never
}
type DataDef<Data, Props> = (this: Readonly<Props> & Instance) => Data
type PropsDefinition<T> = {
[K in keyof T]: T[K]
}
interface Options<
Data = ((this: Instance) => object),
PropsDef = {}
> {
data?: Data
props?: PropsDef
watch?: Record<string, WatchHandler<any>>
}
type WatchHandler<T> = (val: T, oldVal: T) => void;
type ThisTypedOptions<Data, Props> =
Options<DataDef<Data, Props>, PropsDefinition<Props>> &
ThisType<Data & Readonly<Props> & Instance>
declare function test<Data, Props>(fn: ThisTypedOptions<Data, Props>): void;
declare function test(fn: Options): void;
test({
props: {
foo: ''
},
data(): { bar: boolean } {
return {
bar: true
}
},
watch: {
foo(newVal: string, oldVal: string): void {
this.bar = false
}
}
})

View file

@ -0,0 +1,46 @@
interface Instance {
_instanceBrand: never
}
type DataDef<Data, Props> = (this: Readonly<Props> & Instance) => Data
type PropsDefinition<T> = {
[K in keyof T]: T[K]
}
interface Options<
Data = object | ((this: Instance) => object),
PropsDef = PropsDefinition<Record<string, any>>
> {
data?: Data
props?: PropsDef
watch?: Record<string, WatchHandler<any>>
}
type WatchHandler<T> = (val: T, oldVal: T) => void;
type ThisTypedOptions<Data, Props> =
object &
Options<DataDef<Data, Props>, PropsDefinition<Props>> &
ThisType<Data & Readonly<Props> & Instance>
declare function test<Data, Props>(fn: ThisTypedOptions<Data, Props>): void;
declare function test(fn: Options): void;
test({
props: {
foo: ''
},
data(): { bar: boolean } {
return {
bar: true
}
},
watch: {
foo(newVal: string, oldVal: string): void {
this.bar = false
}
}
})

View file

@ -0,0 +1,10 @@
// @filename: enumTagOnExports.js
// @allowjs: true
// @checkjs: true
// @noemit: true
/** @enum {number} */
exports.a = {};
/** @enum {string} */
module.exports.b = {};

View file

@ -0,0 +1,7 @@
// @filename: enumTagOnExports.js
// @allowjs: true
// @checkjs: true
// @noemit: true
/** @enum {string} */
module.exports = {};

@ -1 +1 @@
Subproject commit 722ebf8053d2bf82bb66134b21c7e291ccae35c4
Subproject commit 1bf5836cae5246b89bbf7063c3e84e110222fcdf

@ -1 +1 @@
Subproject commit 19c71f2c6a2b874b1b2bb28a8526b19185b8eece
Subproject commit bfc20b2f17c0206105e2cdd42cd35d79dd03a884

@ -1 +1 @@
Subproject commit 6dec056de3c646fa1bce41acadc31641237863a0
Subproject commit 437b83f0337a5d57ce7dd976d2c3b44cb2037e45

@ -1 +1 @@
Subproject commit 223443c057e64ca04cda5c0f37f5d15daaf69337
Subproject commit 23146404850011972f695fb6bc2b8113c3cffbfc

@ -1 +1 @@
Subproject commit cba0f98a2ac7edd3c2bffd0ac53185877403da6b
Subproject commit b6b29502eb6a75fe3869806f0e7b27195fe51b0d

@ -1 +1 @@
Subproject commit c3ed21fb73ea352e17421540cc28ffc5e30969cd
Subproject commit 743ae6da9a6fc3b459a7ab3bb250fb07d14f9c5d