-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add compilation unit info to
ClassSymbol
(#19010)
- [x] Add `compilationUnitInfo` to class symbols - [x] Move `assocFile` into `CompilationUnitInfo` - [x] Add tasty version to `CompilationUnitInfo` - [x] Include #18925 to have test for `CompilationUnitInfo` - [x] Add explicit nulls to `CompilationUnitInfo` Fixes #18933
- Loading branch information
Showing
48 changed files
with
329 additions
and
123 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
compiler/src/dotty/tools/dotc/core/CompilationUnitInfo.scala
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package dotty.tools.dotc.core | ||
|
||
import dotty.tools.io.AbstractFile | ||
import dotty.tools.tasty.TastyVersion | ||
|
||
/** Information about the compilation unit of a class symbol. | ||
* | ||
* @param associatedFile The source or class file from which this class or | ||
* the class containing this symbol was generated, | ||
* null if not applicable. | ||
* @param tastyVersion The TASTy version (major, minor, experimental) | ||
* @param explicitNulls This compilation unit has explicit nulls enabled? | ||
*/ | ||
class CompilationUnitInfo( | ||
val associatedFile: AbstractFile, | ||
val tastyVersion: Option[TastyVersion], | ||
val explicitNulls: Boolean | ||
) { | ||
|
||
override def toString(): String = | ||
s"CompilationUnitInfo($associatedFile, $tastyVersion)" | ||
} | ||
|
||
object CompilationUnitInfo: | ||
def apply(assocFile: AbstractFile | Null, explicitNulls: Boolean = false): CompilationUnitInfo | Null = | ||
if assocFile == null then null | ||
else new CompilationUnitInfo( | ||
assocFile, | ||
tastyVersion = None, | ||
explicitNulls = explicitNulls, | ||
) |
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.