-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix bootstrap #1270
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
Fix bootstrap #1270
Changes from all commits
c0c0a54
7f52d17
624561d
df58b45
1ab71ca
67d5660
e4f87d9
f99d3fb
1bce89e
c793085
1f8cf78
7f08c1f
c204a96
bef7363
1b4ca37
d894be6
c996e42
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -398,10 +398,10 @@ object Symbols { | |
|
||
/** Subclass tests and casts */ | ||
final def isTerm(implicit ctx: Context): Boolean = | ||
(if(isDefinedInCurrentRun) lastDenot else denot).isTerm | ||
(if (defRunId == ctx.runId) lastDenot else denot).isTerm | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not change the definition of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because it's used elsewhere to mean: In a compilation unit that's currently being compiled. |
||
|
||
final def isType(implicit ctx: Context): Boolean = | ||
(if(isDefinedInCurrentRun) lastDenot else denot).isType | ||
(if (defRunId == ctx.runId) lastDenot else denot).isType | ||
|
||
final def isClass: Boolean = isInstanceOf[ClassSymbol] | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -485,4 +485,15 @@ object TastyFormat { | |
case PRIVATEqualified => "PRIVATEqualified" | ||
case PROTECTEDqualified => "PROTECTEDqualified" | ||
} | ||
|
||
/** @return If non-negative, the number of leading references of a length/trees entry. | ||
* If negative, minus the number of leading non-reference trees. | ||
*/ | ||
def numRefs(tag: Int) = tag match { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This method seem to only be used by unpickler. Maybe move it there? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it is essentially an information about the format. So the place looks right to me. Otherwise put, if we change the format of some entries, this method needs to be updated in sync. With the information provided by it, we enable generic traversals of Tasty trees in other (future) modules as well. |
||
case VALDEF | DEFDEF | TYPEDEF | TYPEPARAM | PARAM | NAMEDARG | RETURN | BIND | | ||
SELFDEF | REFINEDtype => 1 | ||
case RENAMED | PARAMtype => 2 | ||
case POLYtype | METHODtype => -1 | ||
case _ => 0 | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -217,8 +217,8 @@ class TreePickler(pickler: TastyPickler) { | |
case tpe: RefinedType => | ||
writeByte(REFINEDtype) | ||
withLength { | ||
pickleType(tpe.parent) | ||
pickleName(tpe.refinedName) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is an incompatible change. Why was the order changed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To harmonize the layout. Non-trees now always come before trees in Tasty entries (except for some cases where trailing non-trees are optional as explained in numRefs.) |
||
pickleType(tpe.parent) | ||
pickleType(tpe.refinedInfo, richTypes = true) | ||
} | ||
case tpe: TypeAlias => | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this happen in practice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, there are tests that break (the tests don't start a full compiler).