File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -2272,6 +2272,12 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
2272
2272
}
2273
2273
2274
2274
function isDeprecatedSymbol(symbol: Symbol) {
2275
+ if (length(symbol.declarations) > 1) {
2276
+ const parentSymbol = getParentOfSymbol(symbol);
2277
+ if (parentSymbol && parentSymbol.flags & SymbolFlags.Interface) {
2278
+ return some(symbol.declarations, d => !!(getCombinedNodeFlags(d) & NodeFlags.Deprecated));
2279
+ }
2280
+ }
2275
2281
return !!(getDeclarationNodeFlagsFromSymbol(symbol) & NodeFlags.Deprecated);
2276
2282
}
2277
2283
Original file line number Diff line number Diff line change
1
+ ///<reference path="fourslash.ts" />
2
+
3
+ ////interface I {
4
+ //// x: number;
5
+ //// y: number;
6
+ //// }
7
+ ////interface I {
8
+ //// /** @deprecated */
9
+ //// x: number;
10
+ //// }
11
+ ////const foo: I = { x: 1, y: 1 };
12
+ ////foo.[|x|];
13
+
14
+ const [ range ] = test . ranges ( ) ;
15
+ verify . getSuggestionDiagnostics ( [
16
+ {
17
+ "code" : 6385 ,
18
+ "message" : "'x' is deprecated." ,
19
+ "reportsDeprecated" : true ,
20
+ "range" : range
21
+ } ,
22
+ ] ) ;
You can’t perform that action at this time.
0 commit comments