Commit 9a32a2c
committed
Fix #7683: Fix CompilationUnit handling in Context#withSource
In e07a728, I changed
Context#withSource to set a new CompilationUnit based on the source if
no compilation unit is currently set (always having a CompilationUnit
set is now needed since I moved the fresh name generator inside
CompilationUnit), however CompilationUnit#apply will error out if the
source file does not exist, which might happen for library code.
Fixed by adding a parameter to disable this check, but this is not very
pretty and we should really try to design a better way to distinguish
between user source files and source files we happen to know the name of
because it's stored in Tasty.1 parent 0a33ad3 commit 9a32a2c
File tree
2 files changed
+11
-3
lines changed- compiler/src/dotty/tools/dotc
- core
2 files changed
+11
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
87 | 90 | | |
88 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
89 | 94 | | |
90 | 95 | | |
91 | 96 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
468 | 468 | | |
469 | 469 | | |
470 | 470 | | |
471 | | - | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
472 | 475 | | |
473 | 476 | | |
474 | 477 | | |
| |||
0 commit comments