Open cache-nez opened 3 years ago
New thing: DefDef
s don't have a SignedName
at definition site. It needs to be recomputed from the erasure, which requires dereferencing all the types in the signautre.
TermRef
s for private
(and even local like non-val constructor param) members should always be TERMREFsymbol
s, so that name-based field selection can systematically filter out Private
and be done with it. private
members are never accessible from another .tasty
file, so we always have access to the symbol.
SuperType
s should not exist at all. They may have had a reason to exist when it was possible to shadow an inherited class with another class, but that is not allowed in Scala 3 anymore.
Super
nodes should not exist as a dedicated thing. They should be fused with their enclosing Select
as SuperSelect
, and be reserved to term selection.
https://github.com/lampepfl/dotty/issues/19307
The param of AnyVal
classes should never have the LOCAL flag, because it gets automatically accessed on another instance in the generated equals
method. Example:
class ValueClassNonVal(self: String) extends AnyVal:
def get: String = self // TERMREFsymbol, OK
def getThroughThis: String = this.self // SELECT, ~OK because this prefix
// def getOther(that: ValueClassNonVal): String = that.self // does not compile, rightly so
// <generated>
def equals(x$0: Any): Boolean = x$0 match
case x$0: ValueClassNonVal =>
this.self // SELECT, ~OK because this prefix
== x$0.self // SELECT, definitely not OK
case _ =>
false
end ValueClassNonVal
This is the list of my impressions from working with the TASTy grammar, which can hopefully be useful for an eventual discussion of TASTy. Additions are welcome.