-
Notifications
You must be signed in to change notification settings - Fork 47k
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
feat(compiler): Handle TSSatisfiesExpression #29818
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Comparing: c2ae9e2...a4b0ec0 Critical size changesIncludes critical production bundles, as well as any change greater than 2%:
Significant size changesIncludes any change greater than 0.2%: Expand to show
|
Still fighting with linter dependencies, converting to draft. |
```ts // Returns `true` if the result is `Ok`. isOk(): this is OkImpl<T>; // Returns `true` if the result is `Err`. isErr(): this is ErrImpl<E>; ``` The implementations just return `boolean`, which seems to break in TS 5.5: Running `tsc` in current `main`: ``` tsc src/Utils/Result.ts:202:3 - error TS2416: Property 'isOk' in type 'ErrImpl<E>' is not assignable to the same property in base type 'Result<never, E>'. Type '() => boolean' is not assignable to type '() => this is OkImpl<never>'. Signature '(): boolean' must be a type predicate. 202 isOk(): boolean { ~~~~ src/Utils/Result.ts:206:3 - error TS2416: Property 'isErr' in type 'ErrImpl<E>' is not assignable to the same property in base type 'Result<never, E>'. Type '() => boolean' is not assignable to type '() => this is ErrImpl<E>'. Signature '(): boolean' must be a type predicate. 206 isErr(): boolean { Found 38 errors in 7 files. Errors Files 2 src/HIR/BuildHIR.ts:196 2 src/HIR/Environment.ts:745 2 src/ReactiveScopes/CodegenReactiveFunction.ts:290 14 src/Utils/Result.ts:96 2 src/Validation/ValidateNoRefAccesInRender.ts:201 2 src/Validation/ValidateNoSetStateInRender.ts:115 14 src/__tests__/Result-test.ts:13 ```sh tsc tsc --version Version 5.5.3 ```
7226694
to
57f8183
Compare
This pull request has been automatically marked as stale. If this pull request is still relevant, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize reviewing it yet. Your contribution is very much appreciated. |
Thank you for the contribution! I think we'll have to redo this one given the conflicts and issues with babel versioning. |
Summary
Resolves #29754
Details
I tried keeping
@babel/types
as low as possible, to match the actual used implementation. However, there were multiple issues:SourceLocation
seems to now have identifiers, filename andindex
. It is used in scope merging. Since filename and identifier cannot be "merged", I chose theright
location as the one supplying these, because the only usage of that function passesidentifier
for theright
location. This might not be what we want, please check this and assume that I don't know what I am doing :)How did you test this change?
Added a test for a simple case. I think we don't need a more complex one, since we're only interested in the inner expression and not in the
satisfies
constraint.