API: add checker methods to get true and false types of a conditional type#4337
API: add checker methods to get true and false types of a conditional type#4337piotrtomiak wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds API surface to retrieve the true/false branch types of a conditional type through the Checker, wiring it through the Go RPC layer and exposing it in both sync and async TypeScript clients.
Changes:
- Exported
Checker.GetTrueTypeOfConditionalType/Checker.GetFalseTypeOfConditionalTypein Go. - Added new RPC methods/handlers and proto method registration for both operations.
- Added sync/async TypeScript client methods plus corresponding tests.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/checker/exports.go | Exposes conditional-type branch getters on the public Checker API. |
| internal/api/session.go | Routes and implements new RPC handlers that resolve a type handle and return the corresponding branch type. |
| internal/api/proto.go | Registers two new RPC method names and their unmarshallers. |
| _packages/native-preview/src/api/sync/api.ts | Adds sync TS client methods for conditional-type true/false branches. |
| _packages/native-preview/src/api/async/api.ts | Adds async TS client methods for conditional-type true/false branches. |
| _packages/native-preview/test/sync/api.test.ts | Adds sync test coverage validating branch types for a conditional type alias. |
| _packages/native-preview/test/async/api.test.ts | Adds async test coverage validating branch types for a conditional type alias. |
ff1231d to
7029cb0
Compare
|
Could you link to #2851, please? I was suggesting adding |
|
@mrazauskas - what do you mean by link? In the git commit message?
I am planning to make this change once #4341 is merged, since this requires association between Type and |
No description provided.