Skip to content
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

[BUG] Compilation fails when injection token is typed with default type params #1667

Open
griest024 opened this issue Jul 6, 2021 · 0 comments
Assignees
Labels
needs more info This issue needs more information p3 low priority

Comments

@griest024
Copy link
Member

🐛 Bug report

Current Behavior

Basically this except the imports are not present in the scope of the injection token.

Expected Behavior

I expect the code to compile.

Minimal reproduction of the problem with instructions

my-type.ts

export type MyType<T extends MyInterface = MyInterface> = () => T

my-token.ts

export const MyToken = new InjectionToken<MyType>('MyToken ')

my-token.ts will fail to compile unless MyInterface is imported (not even used) in my-token.ts.

What is the motivation / use case for changing the behavior?

I want to type injection tokens with default type params.

Environment


Daffodil version: 0.37.0
Angular version: 10

Other

A workaround exists so this isn't critical but it is rather annoying.

@griest024 griest024 added the bug A confirmed bug report label Jul 6, 2021
@AnnieMi888 AnnieMi888 added needs more info This issue needs more information p3 low priority labels Dec 19, 2023
@xelaint xelaint removed the bug A confirmed bug report label Jan 17, 2025
@damienwebdev damienwebdev removed their assignment Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs more info This issue needs more information p3 low priority
Projects
None yet
Development

No branches or pull requests

5 participants