-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add compilation unit info to ClassSymbol
#19010
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
bishabosha
merged 10 commits into
scala:main
from
dotty-staging:keep-compilation-unit-info-in-symbol
Nov 23, 2023
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
5e714dd
Add `CompilationUnitInfo` to `ClassSymbol`
nicolasstucki 83c05b6
Keep `TastyVersion` in `CompilationUnitInfo`
nicolasstucki ff0b153
Allow `infix enum`
nicolasstucki 8b44ffa
Deprecation warnings for old syntax: alphanumeric infix operators
nicolasstucki 0291fa8
Read TASTy header eagerly to avoid var in CompilationUnitInfo
nicolasstucki 91f8e3a
Add explicit nulls tasty attribute to CompilationUnit
nicolasstucki 2f36da4
Set explicit nulls in CompilationUnitInfo symbols from source
nicolasstucki e152b56
Review feedback
nicolasstucki 97d8171
Cache stable TASTyVersion
nicolasstucki 050859e
add scala3 library to tasty-core-scala2 project
bishabosha File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.