Commit 27eecbc
committed
Support @deprecated on namespace aliases (ImportEqualsDeclaration)
Fixes #62340
When a namespace re-exports a type using `export import Bar = example.Bar`
with a `@deprecated` JSDoc comment, the deprecation warning was not being
reported when accessing `JSX.Bar` as a type.
The issue was that in `checkTypeReferenceOrImport`, the `resolvedSymbol`
is the resolved target of the alias, not the alias itself. To detect
deprecation on the alias, we now also resolve the entity name without
resolving aliases and check if the alias symbol itself is deprecated.1 parent db3ae1b commit 27eecbc
File tree
2 files changed
+62
-0
lines changed- src/compiler
- tests/cases/fourslash
2 files changed
+62
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42740 | 42740 | | |
42741 | 42741 | | |
42742 | 42742 | | |
| 42743 | + | |
| 42744 | + | |
| 42745 | + | |
| 42746 | + | |
| 42747 | + | |
| 42748 | + | |
| 42749 | + | |
| 42750 | + | |
| 42751 | + | |
| 42752 | + | |
| 42753 | + | |
| 42754 | + | |
| 42755 | + | |
| 42756 | + | |
| 42757 | + | |
| 42758 | + | |
42743 | 42759 | | |
42744 | 42760 | | |
42745 | 42761 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
0 commit comments