Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🤖 User test baselines have changed for fix-homomorphic-mapped-types-in-intersection-inferences #38

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/compiler/checker.ts
Expand Up @@ -15587,11 +15587,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);
Expand Down
32 changes: 18 additions & 14 deletions tests/baselines/reference/docker/azure-sdk.log
Expand Up @@ -8,26 +8,29 @@ 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-http] completed successfully in ? seconds
XX of XX: [@azure/identity] completed successfully in ? seconds
XX of XX: [@azure/core-amqp] completed successfully in ? seconds
XX of XX: [@azure/core-arm] completed successfully in ? seconds
XX of XX: [@azure/core-paging] completed successfully in ? seconds
XX of XX: [@azure/event-processor-host] completed successfully in ? seconds
XX of XX: [@azure/identity] completed successfully in ? seconds
XX of XX: [@azure/test-utils-recorder] completed successfully in ? seconds
XX of XX: [@azure/core-amqp] completed successfully in ? seconds
XX of XX: [@azure/event-processor-host] completed successfully in ? seconds
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/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/client/StoredProcedure/StoredProcedures.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/resourceThrottleRetryPolicy.js, dist-esm/retry/endpointDiscoveryRetryPolicy.js, dist-esm/retry/sessionRetryPolicy.js, dist-esm/retry/defaultRetryPolicy.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/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/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/client/Item/Items.js)
uuid/v4 (imported by dist-esm/ClientContext.js, dist-esm/client/Item/Items.js)
binary-search-bounds (imported by dist-esm/queryExecutionContext/parallelQueryExecutionContextBase.js, dist-esm/routing/inMemoryCollectionRoutingMap.js)
priorityqueuejs (imported by dist-esm/queryExecutionContext/parallelQueryExecutionContextBase.js)
semaphore (imported by dist-esm/queryExecutionContext/parallelQueryExecutionContextBase.js)
debug (imported by dist-esm/common/logger.js)
node-abort-controller (imported by dist-esm/request/RequestHandler.js)
node-fetch (imported by dist-esm/request/RequestHandler.js)
atob (imported by dist-esm/session/sessionContainer.js)
Expand All @@ -38,6 +41,7 @@ Use output.globals to specify browser global variable names corresponding to ext
universal-user-agent (guessing 'userAgent')
tslib (guessing 'tslib')
@azure/cosmos-sign (guessing 'cosmosSign')
debug (guessing 'debugLib')
binary-search-bounds (guessing 'bs')
priorityqueuejs (guessing 'PriorityQueue')
semaphore (guessing 'semaphore')
Expand All @@ -53,8 +57,6 @@ atob (guessing 'atob')
created dist/index.js in ?s
Warning: You have changed the public API signature for this project. Updating review/event-hubs.api.md
XX of XX: [@azure/keyvault-certificates] completed successfully in ? seconds
XX of XX: [@azure/keyvault-keys] completed successfully in ? seconds
XX of XX: [@azure/keyvault-secrets] completed successfully in ? seconds
Warning: You have changed the public API signature for this project. Updating review/service-bus.api.md
XX of XX: [@azure/storage-blob] completed successfully in ? seconds
XX of XX: [@azure/storage-file] completed successfully in ? seconds
Expand All @@ -66,18 +68,18 @@ SUCCESS (20)
@azure/abort-controller (? seconds)
@azure/core-auth (? seconds)
@azure/core-http (? seconds)
@azure/identity (? seconds)
@azure/core-amqp (? seconds)
@azure/core-arm (? seconds)
@azure/core-paging (? seconds)
@azure/event-processor-host (? seconds)
@azure/identity (? seconds)
@azure/test-utils-recorder (? seconds)
@azure/core-amqp (? seconds)
@azure/event-processor-host (? seconds)
@azure/keyvault-keys (? seconds)
@azure/keyvault-secrets (? seconds)
@azure/app-configuration (? seconds)
@azure/core-asynciterator-polyfill (? seconds)
@azure/core-tracing (? seconds)
@azure/keyvault-certificates (? seconds)
@azure/keyvault-keys (? seconds)
@azure/keyvault-secrets (? seconds)
@azure/storage-blob (? seconds)
@azure/storage-file (? seconds)
@azure/storage-queue (? seconds)
Expand All @@ -91,13 +93,14 @@ 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/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/client/StoredProcedure/StoredProcedures.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/resourceThrottleRetryPolicy.js, dist-esm/retry/endpointDiscoveryRetryPolicy.js, dist-esm/retry/sessionRetryPolicy.js, dist-esm/retry/defaultRetryPolicy.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/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/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/client/Item/Items.js)
uuid/v4 (imported by dist-esm/ClientContext.js, dist-esm/client/Item/Items.js)
binary-search-bounds (imported by dist-esm/queryExecutionContext/parallelQueryExecutionContextBase.js, dist-esm/routing/inMemoryCollectionRoutingMap.js)
priorityqueuejs (imported by dist-esm/queryExecutionContext/parallelQueryExecutionContextBase.js)
semaphore (imported by dist-esm/queryExecutionContext/parallelQueryExecutionContextBase.js)
debug (imported by dist-esm/common/logger.js)
node-abort-controller (imported by dist-esm/request/RequestHandler.js)
node-fetch (imported by dist-esm/request/RequestHandler.js)
atob (imported by dist-esm/session/sessionContainer.js)
Expand All @@ -108,6 +111,7 @@ Use output.globals to specify browser global variable names corresponding to ext
universal-user-agent (guessing 'userAgent')
tslib (guessing 'tslib')
@azure/cosmos-sign (guessing 'cosmosSign')
debug (guessing 'debugLib')
binary-search-bounds (guessing 'bs')
priorityqueuejs (guessing 'PriorityQueue')
semaphore (guessing 'semaphore')
Expand Down
2 changes: 1 addition & 1 deletion tests/baselines/reference/docker/office-ui-fabric.log
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
17 changes: 2 additions & 15 deletions tests/baselines/reference/docker/vscode.log
@@ -1,27 +1,14 @@
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.



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.
63 changes: 63 additions & 0 deletions tests/baselines/reference/vueLikeDataAndPropsInference.js
@@ -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;
}
}
});