Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(compiler-cli): fix crash during type-checking of library builds (#…
…44587) When building a library, the `rootDir` option is configured to ensure that all source files are present within the entry-point that is being build. This imposes an extra constraint on the reference emit logic, which does not allow emitting a reference into a source file outside of this `rootDir`. During the generation of type-check blocks we used to make a best-effort estimation of whether a type reference can be emitted into the type-check file. This check was relaxed in #42492 to support emitting more syntax forms and type references, but this change did not consider the `rootDir` constraint that is present in library builds. As such, the compiler might conclude that a type reference is eligible for emit into the type-check file, whereas in practice this would cause a failure. This commit changes the best-effort estimation into a "preflight" reference emit that is fully accurate as to whether emitting a type reference is possible. Fixes #43624 PR Close #44587
- Loading branch information
Showing
8 changed files
with
165 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.