-
Notifications
You must be signed in to change notification settings - Fork 238
Open
Description
function myFunction(app: Application) {
// ...
}
const app = new Application({ state: { foo: 'bar' }})
myFunction(app)
// ^^^In this code, the app constant given to myFunction will be flagged with the following type error:
Argument of type 'Application<{ foo: string; }>' is not assignable to parameter of type 'Application<Record<string, any>>'.
Types of property '#composedMiddleware' are incompatible.
Type '((context: Context<{ foo: string; }, { foo: string; }>) => Promise<unknown>) | undefined' is not assignable to type '((context: Context<Record<string, any>, Record<string, any>>) => Promise<unknown>) | undefined'.
Type '(context: Context<{ foo: string; }, { foo: string; }>) => Promise<unknown>' is not assignable to type '(context: Context<Record<string, any>, Record<string, any>>) => Promise<unknown>'.
Types of parameters 'context' and 'context' are incompatible.
Type 'Context<Record<string, any>, Record<string, any>>' is not assignable to type 'Context<{ foo: string; }, { foo: string; }>'.
Type 'Record<string, any>' is not assignable to type '{ foo: string; }'.
Despite the probable simplicity of the error, I could't find a way to fix it. I'll try a bit longer but if anybody find it, a pull request will save my day x)
Metadata
Metadata
Assignees
Labels
No labels