-
-
Notifications
You must be signed in to change notification settings - Fork 264
Closed
Labels
bug 🔥Something isn't workingSomething isn't workingjavascriptPull requests that update Javascript codePull requests that update Javascript codeneeds info ⏳Further information is requiredFurther information is required
Description
Description
This is similar to #2896. Before 0.86, the generated type for IR$1.Context was:
declare namespace IR$1 {
...
export type Context<Spec extends Record<string, any> = any> = IRContext<Spec>;
...
}After 0.86, it becomes:
declare namespace IR$1 {
...
export type Context<Spec extends Record<string, any> = any> = Context<Spec>;
...
}which makes the type of Context to the type of itself, and thus TypeScript evaluates it to any.
Reproducible example or configuration
function f(schema: IR.SchemaObject, plugin: MyPlugin["Instance"]) {
plugin.context.resolveIrRef(schema.$ref)
}TypeScript now yells unsafe access to context which is any type.
OpenAPI specification (optional)
No response
System information (optional)
No response
Copilot
Metadata
Metadata
Assignees
Labels
bug 🔥Something isn't workingSomething isn't workingjavascriptPull requests that update Javascript codePull requests that update Javascript codeneeds info ⏳Further information is requiredFurther information is required