File tree Expand file tree Collapse file tree 3 files changed +44
-14
lines changed
biome_js_analyze/tests/specs/correctness/noUnusedVariables Expand file tree Collapse file tree 3 files changed +44
-14
lines changed Original file line number Diff line number Diff line change 11/* should not generate diagnostics */
22
33interface A {
4- f ( a : number ) ;
5- set a ( a : number ) ;
6- [ key : string ] : string ;
4+ f ( a : number ) ;
5+ set a ( a : number ) ;
6+ [ key : string ] : string ;
7+ }
8+
9+ // Construct signature type members with generic parameters
10+ export interface Constructor {
11+ new < T > ( ) : T ;
12+ new < T > ( value : T ) : T ;
13+ }
14+
15+ export interface ConstructorWithMultipleOverloads {
16+ new < T > ( ) : T ;
17+ < T > ( ) : T ;
718}
819
920class B implements A {
10- f ( a : number ) { console . log ( a ) }
11- set a ( a : number ) { console . log ( a ) }
12- [ key : string ] : string ;
21+ f ( a : number ) {
22+ console . log ( a ) ;
23+ }
24+ set a ( a : number ) {
25+ console . log ( a ) ;
26+ }
27+ [ key : string ] : string ;
1328}
1429
1530console . log ( new B ( ) ) ;
Original file line number Diff line number Diff line change @@ -7,19 +7,32 @@ expression: validInterface.ts
77/* should not generate diagnostics */
88
99interface A {
10- f (a : number );
11- set a (a : number );
12- [key : string ]: string ;
10+ f (a : number );
11+ set a (a : number );
12+ [key : string ]: string ;
13+ }
14+
15+ // Construct signature type members with generic parameters
16+ export interface Constructor {
17+ new <T >(): T ;
18+ new <T >(value : T ): T ;
19+ }
20+
21+ export interface ConstructorWithMultipleOverloads {
22+ new <T >(): T ;
23+ <T >(): T;
1324}
1425
1526class B implements A {
16- f (a : number ) {console.log(a )}
17- set a (a : number ) {console.log(a )}
18- [key : string ]: string ;
27+ f (a : number ) {
28+ console.log(a );
29+ }
30+ set a (a : number ) {
31+ console.log(a );
32+ }
33+ [key : string ]: string ;
1934}
2035
2136console.log(new B());
2237
2338```
24-
25-
Original file line number Diff line number Diff line change @@ -461,6 +461,7 @@ impl SemanticEventExtractor {
461461 | TS_DECLARE_FUNCTION_DECLARATION
462462 | TS_DECLARE_FUNCTION_EXPORT_DEFAULT_DECLARATION
463463 | TS_CALL_SIGNATURE_TYPE_MEMBER
464+ | TS_CONSTRUCT_SIGNATURE_TYPE_MEMBER
464465 | TS_METHOD_SIGNATURE_CLASS_MEMBER
465466 | TS_METHOD_SIGNATURE_TYPE_MEMBER
466467 | TS_INDEX_SIGNATURE_CLASS_MEMBER
@@ -866,6 +867,7 @@ impl SemanticEventExtractor {
866867 | TS_DECLARE_FUNCTION_DECLARATION
867868 | TS_DECLARE_FUNCTION_EXPORT_DEFAULT_DECLARATION
868869 | TS_CALL_SIGNATURE_TYPE_MEMBER
870+ | TS_CONSTRUCT_SIGNATURE_TYPE_MEMBER
869871 | TS_METHOD_SIGNATURE_CLASS_MEMBER
870872 | TS_METHOD_SIGNATURE_TYPE_MEMBER
871873 | TS_INDEX_SIGNATURE_CLASS_MEMBER
You can’t perform that action at this time.
0 commit comments