File tree Expand file tree Collapse file tree
packages/compiler-cli/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -654,7 +654,10 @@ class AngularCompilerProgram implements Program {
654654 // - we cache all the files in the hostAdapter
655655 // - new new stubs use the exactly same imports/exports as the old once (we assert that in
656656 // hostAdapter.updateGeneratedFile).
657- if ( tsStructureIsReused ( tmpProgram ) !== StructureIsReused . Completely ) {
657+ // TS 4.1+ stores the reuse state in the new program
658+ const checkReuseProgram =
659+ ( ts . versionMajorMinor as string ) === '4.0' ? tmpProgram : this . _tsProgram ;
660+ if ( tsStructureIsReused ( checkReuseProgram ) !== StructureIsReused . Completely ) {
658661 throw new Error ( `Internal Error: The structure of the program changed during codegen.` ) ;
659662 }
660663 }
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ const MIN_TS_VERSION = '4.0.0';
2525 * Note: this check is disabled in g3, search for
2626 * `angularCompilerOptions.disableTypeScriptVersionCheck` config param value in g3.
2727 */
28- const MAX_TS_VERSION = '4.1 .0' ;
28+ const MAX_TS_VERSION = '4.2 .0' ;
2929
3030/**
3131 * The currently used version of TypeScript, which can be adjusted for testing purposes using
You can’t perform that action at this time.
0 commit comments