-
Notifications
You must be signed in to change notification settings - Fork 716
Open
Labels
Domain: Porting MetaMeta-level porting concernsMeta-level porting concerns
Description
Replace CompareTypes
with:
func CompareTypes(t1, t2 *Type) int {
return -compareTypes2(t2, t1)
}
func compareTypes2(t1, t2 *Type) int {
if t1 == t2 {
return 0
}
// ...
And then tests say:
✖ internal/testrunner (12.194s)
=== Failed
=== FAIL: internal/testrunner TestSubmodule/dynamicImportsDeclaration.ts/output (0.01s)
baseline.go:202: the baseline file /home/jabaile/work/TypeScript-go/testdata/baselines/reference/submodule/compiler/dynamicImportsDeclaration.js has changed. (Run `hereby baseline-accept` if the new baseline is correct.)
baseline.go:202: the baseline file /home/jabaile/work/TypeScript-go/testdata/baselines/reference/submodule/compiler/dynamicImportsDeclaration.js.diff has changed. (Run `hereby baseline-accept` if the new baseline is correct.)
=== FAIL: internal/testrunner TestSubmodule/dynamicImportsDeclaration.ts/type (0.00s)
baseline.go:202: the baseline file /home/jabaile/work/TypeScript-go/testdata/baselines/reference/submodule/compiler/dynamicImportsDeclaration.types has changed. (Run `hereby baseline-accept` if the new baseline is correct.)
baseline.go:197: new baseline created at /home/jabaile/work/TypeScript-go/testdata/baselines/local/submodule/compiler/dynamicImportsDeclaration.types.diff.
=== FAIL: internal/testrunner TestSubmodule/dynamicImportsDeclaration.ts (0.01s)
=== FAIL: internal/testrunner TestSubmodule/instantiationExpressions.ts/type (0.01s)
baseline.go:202: the baseline file /home/jabaile/work/TypeScript-go/testdata/baselines/reference/submodule/conformance/instantiationExpressions.types has changed. (Run `hereby baseline-accept` if the new baseline is correct.)
baseline.go:202: the baseline file /home/jabaile/work/TypeScript-go/testdata/baselines/reference/submodule/conformance/instantiationExpressions.types.diff has changed. (Run `hereby baseline-accept` if the new baseline is correct.)
=== FAIL: internal/testrunner TestSubmodule/instantiationExpressions.ts (0.17s)
=== FAIL: internal/testrunner TestSubmodule (1.16s)
So, there's something not quite right in the type comparison algorithm.
Noticed this while trying to cache these comparisons in Strada's version of this (doing the common trick of using a canonical ordering for the cache key to halve its size).
Metadata
Metadata
Assignees
Labels
Domain: Porting MetaMeta-level porting concernsMeta-level porting concerns