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

Enforce identical enum values in compatibility checks #55924

Merged
merged 17 commits into from
Dec 20, 2023

Conversation

DanielRosenwasser
Copy link
Member

@DanielRosenwasser DanielRosenwasser commented Sep 30, 2023

Fixes #55915.

This change proposes a new check for compatibility between two distinct enum declarations. On top of previous expectations around enum compatibility, where

  1. the declared enum must have an identical name
  2. each of the enum members in the source must have an enum member declared in the target with an identical name

this change checks that each enum member in the source must have a known value, and that value must have an identical known value in the target.

You can view some examples here.
// Example 1.
// Both declarations of `SomeEnum` should be compatible.
// All enum members have identical values.
namespace example1 {
    namespace First {
        export enum SomeEnum {
            A = 0,
            B = 1,
        }
    }

    namespace Second {
        export enum SomeEnum {
            A = 0,
            B = 1,
        }
    }

    function foo(x: First.SomeEnum, y: Second.SomeEnum) {
        x = y;
        y = x;
    }
}

// Example 2.
// Declarations of `SomeEnum` should be *incompatible*.
// The value of `SomeEnum.B` is different.
namespace example2 {
    namespace First {
        export enum SomeEnum {
            A = 0,
            B = 1,
        }
    }

    namespace Second {
        export enum SomeEnum {
            A = 0,
            B = 2,
        }
    }

    function foo(x: First.SomeEnum, y: Second.SomeEnum) {
        x = y;
//      ~~~~~ error!
//      Type 'Second.SomeEnum' is not assignable to type 'First.SomeEnum'.
//        Each declaration of 'SomeEnum.B' differs in its value,
//        where '1' was expected but '2' was given.
        y = x;
//      ~~~~~ error!
//      Type 'First.SomeEnum' is not assignable to type 'Second.SomeEnum'.
//        Each declaration of 'SomeEnum.B' differs in its value,
//        where '2' was expected but '1' was given.
    }
}

// Example 3.
// Declarations of `SomeEnum` should be *incompatible*.
// The value of `Second.SomeEnum.B` is not fully known because
// `Second.SomeEnum` is ambient and it does not specify a value for `B`.
namespace example3 {
    namespace First {
        export enum SomeEnum {
            A = 0,
            B,
        }
    }

    namespace Second {
        export declare enum SomeEnum {
            A = 0,
            B,
        }
    }

    function foo(x: First.SomeEnum, y: Second.SomeEnum) {
        x = y;
//      ~~~~~ error!
//      Type 'Second.SomeEnum' is not assignable to type 'First.SomeEnum'.
//        Values of 'SomeEnum.B' are not sufficiently known.
        y = x;
//      ~~~~~ error!
//      Type 'Second.SomeEnum' is not assignable to type 'First.SomeEnum'.
//        Values of 'SomeEnum.B' are not sufficiently known.
    }
}

// Example 4.
// Declarations of `SomeEnum` should be *incompatible*.
// The value of `Second.SomeEnum.B` is not fully known because
// all members are dynamically computed.
namespace example4 {
    declare function random(): number;

    namespace First {
        export enum SomeEnum {
            A = random(),
            B = random(),
        }
    }

    namespace Second {
        export enum SomeEnum {
            A = random(),
            B = random(),
        }
    }

    function foo(x: First.SomeEnum, y: Second.SomeEnum) {
//      ~~~~~ error!
//      Type 'Second.SomeEnum' is not assignable to type 'First.SomeEnum'.
//        Values of 'SomeEnum.A' are not sufficiently known.
        y = x;
//      ~~~~~ error!
//      Type 'Second.SomeEnum' is not assignable to type 'First.SomeEnum'.
//        Values of 'SomeEnum.A' are not sufficiently known.
    }
}

You can also see these in action in a recent playground build.

Important

This is an update that the aforementioned playground link and examples reflect older behavior where known values were incompatible with unknown values. Check the introduced tests to get a sense of the new behavior.

@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Sep 30, 2023
@DanielRosenwasser
Copy link
Member Author

@typescript-bot pack this
@typescript-bot test this
@typescript-bot test top300
@typescript-bot run dt
@typescript-bot perf test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Sep 30, 2023

Heya @DanielRosenwasser, I've started to run the parallelized Definitely Typed test suite on this PR at 41e7790. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Sep 30, 2023

Heya @DanielRosenwasser, I've started to run the regular perf test suite on this PR at 41e7790. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Sep 30, 2023

Heya @DanielRosenwasser, I've started to run the diff-based top-repos suite on this PR at 41e7790. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Sep 30, 2023

Heya @DanielRosenwasser, I've started to run the tarball bundle task on this PR at 41e7790. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Sep 30, 2023

Hey @DanielRosenwasser, I've packed this into an installable tgz. You can install it for testing by referencing it in your package.json like so:

{
    "devDependencies": {
        "typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/158034/artifacts?artifactName=tgz&fileId=67DB04192934E1DD37668DD2D239A0103C85A5572F439C5A8870481CE0771FF302&fileName=/typescript-5.3.0-insiders.20230930.tgz"
    }
}

and then running npm install.


There is also a playground for this build and an npm module you can use via "typescript": "npm:@typescript-deploys/pr-build@5.3.0-pr-55924-5".;

@typescript-bot
Copy link
Collaborator

@DanielRosenwasser
The results of the perf run you requested are in!

Here they are:

Compiler

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
Angular - node (v18.15.0, x64)
Memory used 295,041k (± 0.01%) 295,096k (± 0.01%) +56k (+ 0.02%) 295,066k 295,139k p=0.013 n=6
Parse Time 2.63s (± 0.88%) 2.64s (± 0.20%) ~ 2.63s 2.64s p=0.797 n=6
Bind Time 0.84s (± 0.90%) 0.84s (± 1.30%) ~ 0.83s 0.85s p=0.865 n=6
Check Time 8.06s (± 0.30%) 8.06s (± 0.26%) ~ 8.04s 8.09s p=1.000 n=6
Emit Time 7.05s (± 0.42%) 7.03s (± 0.42%) ~ 6.99s 7.07s p=0.294 n=6
Total Time 18.59s (± 0.21%) 18.57s (± 0.19%) ~ 18.51s 18.62s p=0.809 n=6
Compiler-Unions - node (v18.15.0, x64)
Memory used 192,080k (± 1.26%) 192,660k (± 1.56%) ~ 190,702k 196,603k p=0.173 n=6
Parse Time 1.35s (± 0.87%) 1.34s (± 0.47%) ~ 1.33s 1.35s p=0.177 n=6
Bind Time 0.73s (± 0.00%) 0.73s (± 0.00%) ~ 0.73s 0.73s p=1.000 n=6
Check Time 9.24s (± 0.97%) 9.17s (± 0.39%) ~ 9.13s 9.23s p=0.173 n=6
Emit Time 2.63s (± 0.48%) 2.62s (± 0.95%) ~ 2.60s 2.67s p=0.157 n=6
Total Time 13.95s (± 0.64%) 13.86s (± 0.27%) -0.08s (- 0.60%) 13.83s 13.91s p=0.043 n=6
Monaco - node (v18.15.0, x64)
Memory used 347,318k (± 0.01%) 347,306k (± 0.00%) ~ 347,286k 347,317k p=0.261 n=6
Parse Time 2.46s (± 0.66%) 2.46s (± 0.48%) ~ 2.45s 2.48s p=0.805 n=6
Bind Time 0.94s (± 0.43%) 0.94s (± 0.00%) ~ 0.94s 0.94s p=0.405 n=6
Check Time 6.90s (± 0.44%) 6.92s (± 0.46%) ~ 6.89s 6.98s p=0.414 n=6
Emit Time 4.02s (± 0.48%) 4.01s (± 0.47%) ~ 3.99s 4.04s p=0.627 n=6
Total Time 14.32s (± 0.27%) 14.34s (± 0.21%) ~ 14.31s 14.39s p=0.575 n=6
TFS - node (v18.15.0, x64)
Memory used 302,541k (± 0.01%) 302,550k (± 0.00%) ~ 302,532k 302,563k p=0.261 n=6
Parse Time 1.99s (± 0.53%) 2.00s (± 0.88%) +0.02s (+ 1.01%) 1.98s 2.03s p=0.048 n=6
Bind Time 1.01s (± 1.22%) 1.00s (± 1.22%) ~ 0.99s 1.02s p=1.000 n=6
Check Time 6.25s (± 0.53%) 6.25s (± 0.46%) ~ 6.21s 6.29s p=0.936 n=6
Emit Time 3.56s (± 0.68%) 3.57s (± 0.41%) ~ 3.55s 3.59s p=0.627 n=6
Total Time 12.81s (± 0.35%) 12.82s (± 0.29%) ~ 12.77s 12.88s p=0.629 n=6
material-ui - node (v18.15.0, x64)
Memory used 470,492k (± 0.00%) 470,499k (± 0.00%) ~ 470,468k 470,537k p=0.748 n=6
Parse Time 2.58s (± 0.45%) 2.58s (± 0.68%) ~ 2.55s 2.60s p=0.680 n=6
Bind Time 0.99s (± 0.82%) 1.00s (± 1.05%) ~ 0.98s 1.01s p=0.865 n=6
Check Time 16.60s (± 0.43%) 16.57s (± 0.45%) ~ 16.49s 16.68s p=0.688 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 20.17s (± 0.40%) 20.14s (± 0.35%) ~ 20.06s 20.25s p=0.575 n=6
xstate - node (v18.15.0, x64)
Memory used 512,562k (± 0.01%) 512,573k (± 0.01%) ~ 512,497k 512,675k p=0.810 n=6
Parse Time 3.26s (± 0.41%) 3.27s (± 0.16%) ~ 3.26s 3.27s p=0.437 n=6
Bind Time 1.55s (± 0.26%) 1.55s (± 0.41%) ~ 1.54s 1.56s p=0.673 n=6
Check Time 2.88s (± 0.48%) 2.88s (± 1.31%) ~ 2.83s 2.92s p=1.000 n=6
Emit Time 0.08s (± 0.00%) 0.08s (± 0.00%) ~ 0.08s 0.08s p=1.000 n=6
Total Time 7.76s (± 0.19%) 7.77s (± 0.49%) ~ 7.72s 7.81s p=0.624 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • Angular - node (v18.15.0, x64)
  • Compiler-Unions - node (v18.15.0, x64)
  • Monaco - node (v18.15.0, x64)
  • TFS - node (v18.15.0, x64)
  • material-ui - node (v18.15.0, x64)
  • xstate - node (v18.15.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

tsserver

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
Compiler-UnionsTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,372ms (± 1.64%) 2,403ms (± 1.06%) ~ 2,352ms 2,419ms p=0.173 n=6
Req 2 - geterr 5,356ms (± 1.63%) 5,297ms (± 0.31%) ~ 5,275ms 5,315ms p=0.296 n=6
Req 3 - references 331ms (± 1.25%) 343ms (± 8.00%) ~ 326ms 398ms p=0.520 n=6
Req 4 - navto 277ms (± 0.74%) 277ms (± 1.90%) ~ 267ms 283ms p=0.739 n=6
Req 5 - completionInfo count 1,356 (± 0.00%) 1,356 (± 0.00%) ~ 1,356 1,356 p=1.000 n=6
Req 5 - completionInfo 79ms (± 8.93%) 77ms (± 5.45%) ~ 74ms 85ms p=0.933 n=6
CompilerTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,470ms (± 0.50%) 2,470ms (± 0.72%) ~ 2,437ms 2,489ms p=0.810 n=6
Req 2 - geterr 4,105ms (± 1.75%) 4,081ms (± 1.44%) ~ 4,048ms 4,200ms p=0.575 n=6
Req 3 - references 337ms (± 1.28%) 340ms (± 1.54%) ~ 332ms 344ms p=0.256 n=6
Req 4 - navto 284ms (± 0.29%) 284ms (± 0.59%) ~ 282ms 287ms p=0.866 n=6
Req 5 - completionInfo count 1,518 (± 0.00%) 1,518 (± 0.00%) ~ 1,518 1,518 p=1.000 n=6
Req 5 - completionInfo 80ms (± 6.82%) 83ms (± 7.14%) ~ 75ms 87ms p=0.342 n=6
xstateTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,590ms (± 0.44%) 2,596ms (± 0.54%) ~ 2,577ms 2,614ms p=0.575 n=6
Req 2 - geterr 1,705ms (± 3.02%) 1,687ms (± 2.88%) ~ 1,619ms 1,742ms p=0.471 n=6
Req 3 - references 109ms (± 7.82%) 106ms (± 1.25%) ~ 104ms 108ms p=0.735 n=6
Req 4 - navto 359ms (± 0.29%) 360ms (± 0.37%) ~ 358ms 362ms p=0.098 n=6
Req 5 - completionInfo count 2,071 (± 0.00%) 2,071 (± 0.00%) ~ 2,071 2,071 p=1.000 n=6
Req 5 - completionInfo 305ms (± 2.03%) 305ms (± 2.68%) ~ 295ms 318ms p=1.000 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • CompilerTSServer - node (v18.15.0, x64)
  • Compiler-UnionsTSServer - node (v18.15.0, x64)
  • xstateTSServer - node (v18.15.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

Startup

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
tsc-startup - node (v18.15.0, x64)
Execution time 152.34ms (± 0.18%) 152.11ms (± 0.15%) -0.23ms (- 0.15%) 151.14ms 154.47ms p=0.000 n=600
tsserver-startup - node (v18.15.0, x64)
Execution time 227.11ms (± 0.17%) 226.88ms (± 0.17%) -0.23ms (- 0.10%) 225.55ms 230.75ms p=0.000 n=600
tsserverlibrary-startup - node (v18.15.0, x64)
Execution time 228.95ms (± 0.16%) 228.95ms (± 0.16%) ~ 227.17ms 233.82ms p=0.689 n=600
typescript-startup - node (v18.15.0, x64)
Execution time 228.44ms (± 0.16%) 228.51ms (± 0.16%) ~ 226.95ms 232.28ms p=0.158 n=600
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • tsc-startup - node (v18.15.0, x64)
  • tsserver-startup - node (v18.15.0, x64)
  • tsserverlibrary-startup - node (v18.15.0, x64)
  • typescript-startup - node (v18.15.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

Developer Information:

Download Benchmarks

@typescript-bot
Copy link
Collaborator

Hey @DanielRosenwasser, the results of running the DT tests are ready.
Everything looks the same!
You can check the log here.

@typescript-bot
Copy link
Collaborator

@DanielRosenwasser Here are the results of running the top-repos suite comparing main and refs/pull/55924/merge:

Everything looks good!

@DanielRosenwasser DanielRosenwasser marked this pull request as ready for review October 2, 2023 05:09
@sandersn sandersn self-requested a review October 27, 2023 22:24
Copy link
Member

@sandersn sandersn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is worth trying for 5.4.

@@ -4132,6 +4132,10 @@
"category": "Error",
"code": 4124
},
"The values of '{0}.{1}' differ in their declarations, where '{2}' was expected but '{3}' was given.": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'First.E.c' has value '2' but 'Decl.E.c' has value '3'.

Suggested change
"The values of '{0}.{1}' differ in their declarations, where '{2}' was expected but '{3}' was given.": {
"'{0}.{1}' has value '{2}', but '{3}.{1}' has value '{4}'.": {

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is that each of them have identical names between members and enums 😄

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless I fully qualified the name - but the earlier error message will have done that anyway.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with Nathan's suggestion that it would be better to use the fully qualified names when talking about the members and the different values, even though you can figure it out with the current error message + elaboration.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's definitely redundant, but the redundancy makes it easier to read in this case because there's less context to piece together, and less work to do overall to read the message.

tests/baselines/reference/enumAssignmentCompat3.errors.txt Outdated Show resolved Hide resolved
@DanielRosenwasser
Copy link
Member Author

@typescript-bot test this
@typescript-bot test top300
@typescript-bot run dt

@typescript-bot
Copy link
Collaborator

typescript-bot commented Nov 3, 2023

Heya @DanielRosenwasser, I've started to run the diff-based top-repos suite on this PR at b2033b3. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

@DanielRosenwasser Here are the results of running the top-repos suite comparing main and refs/pull/55924/merge:

Everything looks good!

@typescript-bot typescript-bot added For Milestone Bug PRs that fix a bug with a specific milestone and removed For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Nov 17, 2023
@DanielRosenwasser
Copy link
Member Author

@typescript-bot pack this
@typescript-bot test this
@typescript-bot test top300
@typescript-bot run dt
@typescript-bot perf test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Dec 7, 2023

Heya @DanielRosenwasser, I've started to run the parallelized Definitely Typed test suite on this PR at af7f5b8. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Dec 7, 2023

Heya @DanielRosenwasser, I've started to run the regular perf test suite on this PR at af7f5b8. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Dec 7, 2023

Heya @DanielRosenwasser, I've started to run the tarball bundle task on this PR at af7f5b8. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Dec 7, 2023

Heya @DanielRosenwasser, I've started to run the diff-based top-repos suite on this PR at af7f5b8. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Dec 7, 2023

Hey @DanielRosenwasser, I've packed this into an installable tgz. You can install it for testing by referencing it in your package.json like so:

{
    "devDependencies": {
        "typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/158992/artifacts?artifactName=tgz&fileId=2722BB2A780D85F3D4B196A2255D19D8292C1A506716247F2DAB09B95737127B02&fileName=/typescript-5.4.0-insiders.20231207.tgz"
    }
}

and then running npm install.


There is also a playground for this build and an npm module you can use via "typescript": "npm:@typescript-deploys/pr-build@5.4.0-pr-55924-28".;

@typescript-bot
Copy link
Collaborator

@DanielRosenwasser
The results of the perf run you requested are in!

Here they are:

Compiler

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
Angular - node (v18.15.0, x64)
Memory used 295,371k (± 0.01%) 295,365k (± 0.01%) ~ 295,318k 295,428k p=0.810 n=6
Parse Time 2.65s (± 0.32%) 2.65s (± 0.19%) ~ 2.64s 2.65s p=0.923 n=6
Bind Time 0.82s (± 0.50%) 0.82s (± 0.00%) ~ 0.82s 0.82s p=0.405 n=6
Check Time 8.12s (± 0.29%) 8.12s (± 0.15%) ~ 8.11s 8.14s p=0.871 n=6
Emit Time 7.09s (± 0.25%) 7.08s (± 0.19%) ~ 7.05s 7.09s p=0.304 n=6
Total Time 18.68s (± 0.18%) 18.67s (± 0.10%) ~ 18.64s 18.69s p=1.000 n=6
Compiler-Unions - node (v18.15.0, x64)
Memory used 192,374k (± 1.23%) 191,817k (± 0.55%) ~ 191,373k 193,965k p=0.336 n=6
Parse Time 1.36s (± 0.93%) 1.36s (± 0.89%) ~ 1.35s 1.38s p=0.675 n=6
Bind Time 0.72s (± 0.00%) 0.72s (± 1.13%) ~ 0.72s 0.74s p=0.405 n=6
Check Time 9.27s (± 0.41%) 9.27s (± 0.36%) ~ 9.22s 9.32s p=0.687 n=6
Emit Time 2.62s (± 0.37%) 2.62s (± 0.56%) ~ 2.59s 2.63s p=0.865 n=6
Total Time 13.98s (± 0.36%) 13.97s (± 0.31%) ~ 13.94s 14.05s p=0.570 n=6
Monaco - node (v18.15.0, x64)
Memory used 347,375k (± 0.00%) 347,380k (± 0.00%) ~ 347,366k 347,396k p=0.936 n=6
Parse Time 2.46s (± 0.81%) 2.45s (± 0.66%) ~ 2.43s 2.47s p=0.684 n=6
Bind Time 0.92s (± 0.56%) 0.93s (± 0.44%) ~ 0.92s 0.93s p=0.112 n=6
Check Time 6.90s (± 0.39%) 6.92s (± 0.65%) ~ 6.88s 7.00s p=0.518 n=6
Emit Time 4.04s (± 0.43%) 4.06s (± 0.48%) ~ 4.04s 4.09s p=0.164 n=6
Total Time 14.33s (± 0.28%) 14.36s (± 0.34%) ~ 14.30s 14.42s p=0.198 n=6
TFS - node (v18.15.0, x64)
Memory used 302,628k (± 0.00%) 302,644k (± 0.00%) ~ 302,627k 302,653k p=0.078 n=6
Parse Time 1.99s (± 0.93%) 2.00s (± 0.99%) ~ 1.96s 2.02s p=0.411 n=6
Bind Time 1.01s (± 0.97%) 1.00s (± 1.17%) ~ 0.99s 1.02s p=0.314 n=6
Check Time 6.30s (± 0.33%) 6.28s (± 0.33%) ~ 6.25s 6.31s p=0.222 n=6
Emit Time 3.57s (± 0.47%) 3.59s (± 0.35%) +0.02s (+ 0.56%) 3.58s 3.61s p=0.040 n=6
Total Time 12.88s (± 0.25%) 12.87s (± 0.27%) ~ 12.82s 12.91s p=0.936 n=6
material-ui - node (v18.15.0, x64)
Memory used 506,741k (± 0.01%) 506,759k (± 0.00%) ~ 506,741k 506,797k p=0.335 n=6
Parse Time 2.57s (± 0.32%) 2.58s (± 0.53%) ~ 2.56s 2.60s p=0.858 n=6
Bind Time 1.00s (± 1.09%) 0.99s (± 1.18%) ~ 0.98s 1.01s p=0.246 n=6
Check Time 16.86s (± 0.30%) 16.82s (± 0.18%) ~ 16.79s 16.87s p=0.191 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 20.44s (± 0.23%) 20.39s (± 0.17%) ~ 20.34s 20.43s p=0.107 n=6
xstate - node (v18.15.0, x64)
Memory used 512,707k (± 0.01%) 512,721k (± 0.01%) ~ 512,663k 512,795k p=0.936 n=6
Parse Time 3.28s (± 0.25%) 3.28s (± 0.31%) ~ 3.27s 3.30s p=0.270 n=6
Bind Time 1.53s (± 0.34%) 1.54s (± 0.49%) ~ 1.53s 1.55s p=0.069 n=6
Check Time 2.80s (± 0.45%) 2.79s (± 0.45%) ~ 2.78s 2.81s p=0.187 n=6
Emit Time 0.08s (± 0.00%) 0.08s (± 0.00%) ~ 0.08s 0.08s p=1.000 n=6
Total Time 7.69s (± 0.15%) 7.69s (± 0.28%) ~ 7.67s 7.72s p=0.807 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • Angular - node (v18.15.0, x64)
  • Compiler-Unions - node (v18.15.0, x64)
  • Monaco - node (v18.15.0, x64)
  • TFS - node (v18.15.0, x64)
  • material-ui - node (v18.15.0, x64)
  • xstate - node (v18.15.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

tsserver

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
Compiler-UnionsTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,346ms (± 0.59%) 2,342ms (± 0.25%) ~ 2,336ms 2,353ms p=0.936 n=6
Req 2 - geterr 5,399ms (± 1.51%) 5,411ms (± 1.85%) ~ 5,335ms 5,541ms p=0.689 n=6
Req 3 - references 326ms (± 1.46%) 323ms (± 1.17%) ~ 320ms 330ms p=0.142 n=6
Req 4 - navto 278ms (± 1.03%) 278ms (± 1.26%) ~ 273ms 280ms p=1.000 n=6
Req 5 - completionInfo count 1,356 (± 0.00%) 1,356 (± 0.00%) ~ 1,356 1,356 p=1.000 n=6
Req 5 - completionInfo 85ms (± 6.05%) 86ms (± 5.88%) ~ 82ms 93ms p=0.273 n=6
CompilerTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,471ms (± 1.12%) 2,463ms (± 1.21%) ~ 2,433ms 2,514ms p=0.575 n=6
Req 2 - geterr 4,132ms (± 2.28%) 4,139ms (± 1.99%) ~ 4,053ms 4,222ms p=0.575 n=6
Req 3 - references 342ms (± 1.47%) 342ms (± 1.42%) ~ 335ms 346ms p=0.936 n=6
Req 4 - navto 287ms (± 1.46%) 286ms (± 1.01%) ~ 283ms 291ms p=0.517 n=6
Req 5 - completionInfo count 1,518 (± 0.00%) 1,518 (± 0.00%) ~ 1,518 1,518 p=1.000 n=6
Req 5 - completionInfo 83ms (± 7.90%) 85ms (± 7.17%) ~ 77ms 90ms p=0.623 n=6
xstateTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,595ms (± 0.69%) 2,612ms (± 0.31%) ~ 2,597ms 2,618ms p=0.173 n=6
Req 2 - geterr 1,683ms (± 2.22%) 1,690ms (± 1.73%) ~ 1,647ms 1,720ms p=0.936 n=6
Req 3 - references 112ms (± 9.29%) 115ms (± 8.53%) ~ 102ms 123ms p=0.935 n=6
Req 4 - navto 368ms (± 2.39%) 365ms (± 0.41%) ~ 363ms 367ms p=0.743 n=6
Req 5 - completionInfo count 2,073 (± 0.00%) 2,073 (± 0.00%) ~ 2,073 2,073 p=1.000 n=6
Req 5 - completionInfo 305ms (± 2.04%) 308ms (± 1.56%) ~ 301ms 313ms p=0.377 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • CompilerTSServer - node (v18.15.0, x64)
  • Compiler-UnionsTSServer - node (v18.15.0, x64)
  • xstateTSServer - node (v18.15.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

Startup

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
tsc-startup - node (v18.15.0, x64)
Execution time 152.94ms (± 0.22%) 152.85ms (± 0.20%) -0.09ms (- 0.06%) 151.79ms 155.54ms p=0.004 n=600
tsserver-startup - node (v18.15.0, x64)
Execution time 228.46ms (± 0.17%) 228.41ms (± 0.14%) ~ 227.00ms 231.60ms p=0.252 n=600
tsserverlibrary-startup - node (v18.15.0, x64)
Execution time 229.70ms (± 0.19%) 229.75ms (± 0.18%) ~ 228.03ms 233.30ms p=0.079 n=600
typescript-startup - node (v18.15.0, x64)
Execution time 229.34ms (± 0.18%) 229.40ms (± 0.18%) ~ 227.95ms 235.79ms p=0.058 n=600
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • tsc-startup - node (v18.15.0, x64)
  • tsserver-startup - node (v18.15.0, x64)
  • tsserverlibrary-startup - node (v18.15.0, x64)
  • typescript-startup - node (v18.15.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

Developer Information:

Download Benchmarks

@typescript-bot
Copy link
Collaborator

Hey @DanielRosenwasser, the results of running the DT tests are ready.
Everything looks the same!
You can check the log here.

@typescript-bot
Copy link
Collaborator

@DanielRosenwasser Here are the results of running the top-repos suite comparing main and refs/pull/55924/merge:

Everything looks good!

@DanielRosenwasser DanielRosenwasser merged commit 93e6b9d into main Dec 20, 2023
19 checks passed
@DanielRosenwasser DanielRosenwasser deleted the enum-value-checks branch December 20, 2023 21:52
@DanielRosenwasser DanielRosenwasser added this to the TypeScript 5.4.0 milestone Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team Breaking Change Would introduce errors in existing code For Milestone Bug PRs that fix a bug with a specific milestone
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

TypeScript silently omits enum assignment type error between two enums with the same name
4 participants