File tree 4 files changed +81
-1
lines changed 4 files changed +81
-1
lines changed Original file line number Diff line number Diff line change @@ -4172,7 +4172,6 @@ namespace ts {
4172
4172
}
4173
4173
4174
4174
function getDeclaredTypeOfSymbol(symbol: Symbol): Type {
4175
- Debug.assert((symbol.flags & SymbolFlags.Instantiated) === 0);
4176
4175
if (symbol.flags & (SymbolFlags.Class | SymbolFlags.Interface)) {
4177
4176
return getDeclaredTypeOfClassOrInterface(symbol);
4178
4177
}
Original file line number Diff line number Diff line change
1
+ tests/cases/compiler/test.ts(4,5): error TS2322: Type 'PassportStatic' is not assignable to type 'Passport'.
2
+ Types of property 'use' are incompatible.
3
+ Type '() => PassportStatic' is not assignable to type '() => this'.
4
+ Type 'PassportStatic' is not assignable to type 'this'.
5
+
6
+
7
+ ==== tests/cases/compiler/passport.d.ts (0 errors) ====
8
+ declare module 'passport' {
9
+ namespace passport {
10
+ interface Passport {
11
+ use(): this;
12
+ }
13
+
14
+ interface PassportStatic extends Passport {
15
+ Passport: {new(): Passport};
16
+ }
17
+ }
18
+
19
+ const passport: passport.PassportStatic;
20
+ export = passport;
21
+ }
22
+
23
+ ==== tests/cases/compiler/test.ts (1 errors) ====
24
+ import * as passport from "passport";
25
+ import { Passport } from "passport";
26
+
27
+ let p: Passport = passport.use();
28
+ ~
29
+ !!! error TS2322: Type 'PassportStatic' is not assignable to type 'Passport'.
30
+ !!! error TS2322: Types of property 'use' are incompatible.
31
+ !!! error TS2322: Type '() => PassportStatic' is not assignable to type '() => this'.
32
+ !!! error TS2322: Type 'PassportStatic' is not assignable to type 'this'.
Original file line number Diff line number Diff line change
1
+ //// [tests/cases/compiler/mergedDeclarations7.ts] ////
2
+
3
+ //// [passport.d.ts]
4
+ declare module 'passport' {
5
+ namespace passport {
6
+ interface Passport {
7
+ use ( ) : this ;
8
+ }
9
+
10
+ interface PassportStatic extends Passport {
11
+ Passport: { new ( ) : Passport } ;
12
+ }
13
+ }
14
+
15
+ const passport : passport . PassportStatic ;
16
+ export = passport ;
17
+ }
18
+
19
+ //// [test.ts]
20
+ import * as passport from "passport" ;
21
+ import { Passport } from "passport" ;
22
+
23
+ let p : Passport = passport . use ( ) ;
24
+
25
+ //// [test.js]
26
+ "use strict" ;
27
+ var passport = require ( "passport" ) ;
28
+ var p = passport . use ( ) ;
Original file line number Diff line number Diff line change
1
+ // @filename : passport.d.ts
2
+ declare module 'passport' {
3
+ namespace passport {
4
+ interface Passport {
5
+ use ( ) : this;
6
+ }
7
+
8
+ interface PassportStatic extends Passport {
9
+ Passport : { new ( ) : Passport } ;
10
+ }
11
+ }
12
+
13
+ const passport : passport . PassportStatic ;
14
+ export = passport ;
15
+ }
16
+
17
+ //@filename : test.ts
18
+ import * as passport from "passport" ;
19
+ import { Passport } from "passport" ;
20
+
21
+ let p : Passport = passport . use ( ) ;
You can’t perform that action at this time.
0 commit comments