@@ -1350,6 +1350,49 @@ export class B
1350
1350
assert . equal ( host . getModifiedTime ( `${ currentDirectory } /a.js` ) , modifiedTimeOfAJs ) ;
1351
1351
} ) ;
1352
1352
1353
+ it ( "updates errors when deep import through declaration file changes" , ( ) => {
1354
+ const currentDirectory = "/user/username/projects/myproject" ;
1355
+ const aFile : File = {
1356
+ path : `${ currentDirectory } /a.ts` ,
1357
+ content : `import {B} from './b';
1358
+ declare var console: any;
1359
+ let b = new B();
1360
+ console.log(b.c.d);`
1361
+ } ;
1362
+ const bFile : File = {
1363
+ path : `${ currentDirectory } /b.d.ts` ,
1364
+ content : `import {C} from './c';
1365
+ export class B
1366
+ {
1367
+ c: C;
1368
+ }`
1369
+ } ;
1370
+ const cFile : File = {
1371
+ path : `${ currentDirectory } /c.d.ts` ,
1372
+ content : `export class C
1373
+ {
1374
+ d: number;
1375
+ }`
1376
+ } ;
1377
+ const config : File = {
1378
+ path : `${ currentDirectory } /tsconfig.json` ,
1379
+ content : `{}`
1380
+ } ;
1381
+ const files = [ aFile , bFile , cFile , config , libFile ] ;
1382
+ const host = createWatchedSystem ( files , { currentDirectory } ) ;
1383
+ const watch = createWatchOfConfigFile ( "tsconfig.json" , host ) ;
1384
+ checkProgramActualFiles ( watch ( ) , [ aFile . path , bFile . path , cFile . path , libFile . path ] ) ;
1385
+ checkOutputErrorsInitial ( host , emptyArray ) ;
1386
+ const modifiedTimeOfAJs = host . getModifiedTime ( `${ currentDirectory } /a.js` ) ;
1387
+ host . writeFile ( cFile . path , cFile . content . replace ( "d" , "d2" ) ) ;
1388
+ host . runQueuedTimeoutCallbacks ( ) ;
1389
+ checkOutputErrorsIncremental ( host , [
1390
+ getDiagnosticOfFileFromProgram ( watch ( ) , aFile . path , aFile . content . lastIndexOf ( "d" ) , 1 , Diagnostics . Property_0_does_not_exist_on_type_1 , "d" , "C" )
1391
+ ] ) ;
1392
+ // File a need not be rewritten
1393
+ assert . equal ( host . getModifiedTime ( `${ currentDirectory } /a.js` ) , modifiedTimeOfAJs ) ;
1394
+ } ) ;
1395
+
1353
1396
it ( "updates errors when strictNullChecks changes" , ( ) => {
1354
1397
const currentDirectory = "/user/username/projects/myproject" ;
1355
1398
const aFile : File = {
0 commit comments