Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Dec 29, 2025. It is now read-only.
This repository was archived by the owner on Dec 29, 2025. It is now read-only.

ts@3.9 incompatible #3

Copy link
Copy link

Description

@yeliex
Issue body actions

in ts@3.9, there is a type incompatible with interface declaration merge

// application.ts
class App extends Preon.Application {
    test: string
}

// typings/index.d.ts
declare module 'preon' {
    interface Context {
        app: Application
    }
}

// controller/system.ts
export default class System extends Preon.Controller {
    test(ctx: Preon.Context) {
        ctx.app.test // TS2339: Property 'test' does not exist on type 'Application'.
    }
}

Because the extended class Application is not the same as the original one

For more detail:
microsoft/TypeScript#36696
https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-9.html#intersections-reduced-by-discriminant-properties

Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

Morty Proxy This is a proxified and sanitized view of the page, visit original site.