-
Notifications
You must be signed in to change notification settings - Fork 230
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[core] Widen signature of isTemplateDeclaration/isTemplateDeclaration…
…OrInstance (#5527) As described in #5447 This changes the signature of `isTemplateDeclaration` and `isTemplateDeclarationOrInstance` so that they accept any `Type` rather than just `TemplatedType`. This makes them consistent with `isTemplateInstance`. `isTemplateDeclarationOrInstance` also gains a type guard to refine the input type when it returns true. Closes #5447 --------- Co-authored-by: Will Temple <will@wtemple.net>
- Loading branch information
1 parent
49387ea
commit 1536482
Showing
2 changed files
with
12 additions
and
3 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
.chronus/changes/witemple-msft-widen-template-detect-sig-2025-0-8-11-34-58.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
changeKind: feature | ||
packages: | ||
- "@typespec/compiler" | ||
--- | ||
|
||
Widen type signature of `isTemplateDeclaration` and `isTemplateDeclarationOrInstance` to accept any type and assert the return type. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters