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

Unused template parameter in interface template #5489

Closed
chunyu3 opened this issue Jan 6, 2025 · 0 comments · Fixed by #5494
Closed

Unused template parameter in interface template #5489

chunyu3 opened this issue Jan 6, 2025 · 0 comments · Fixed by #5494
Assignees
Labels
ide Issues for VS, VSCode, Monaco, etc.

Comments

@chunyu3
Copy link
Contributor

chunyu3 commented Jan 6, 2025

No diagnostic is issues for a templated interface with a template parameter that is not used.
e.g.

interface TemplateOperations<
  InterfaceTraits extends TypeSpec.Reflection.Model,
  ErrorResponse = Azure.Core.Foundations.ErrorResponse
> {
 op read(): ErrorResponse;
}

template parameter InterfaceTrains is not used.

@chunyu3 chunyu3 changed the title Unused template parameter in interface Unused template parameter in interface template Jan 6, 2025
@markcowl markcowl added the needs-info Mark an issue that needs reply from the author or it will be closed automatically label Jan 7, 2025
@RodgeFu RodgeFu added the ide Issues for VS, VSCode, Monaco, etc. label Jan 8, 2025
@chunyu3 chunyu3 removed the needs-info Mark an issue that needs reply from the author or it will be closed automatically label Jan 16, 2025
@josefree josefree added 1_0_E2E and removed 1_0_E2E labels Feb 26, 2025
github-merge-queue bot pushed a commit that referenced this issue Feb 28, 2025
… is not used. (#5494)

Fix #181
Fix #5488
Fix #5489

- check all the usage of the template parameter, if a template parameter
is not used, issue diagnostic and dim the template parameter.
- implement codeFix for unused-template-parameter diagnostic: remove the
unused template parameter.

---------

Co-authored-by: Mark Cowlishaw <markcowl@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ide Issues for VS, VSCode, Monaco, etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants