File tree 2 files changed +11
-2
lines changed
compiler/src/dotty/tools/dotc/core/tasty
tasty/src/dotty/tools/tasty
2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,9 @@ object TreePickler {
33
33
}
34
34
35
35
/** Select tree cannot be unambiguously resolved with signature alone,
36
- * needs to be pickled using the SELECTin tag.
36
+ * needs to be pickled using the SELECTin tag. This is set by Typer, if
37
+ * after overloading resolution it is discovered that other alternatives
38
+ * have the same signature as the one that was selected.
37
39
*/
38
40
val NeedsSelectIn = new Property .StickyKey [Unit ]
39
41
}
@@ -391,6 +393,9 @@ class TreePickler(pickler: TastyPickler) {
391
393
val sig = tree.tpe.signature
392
394
val needsSelectIn = tree.hasAttachment(NeedsSelectIn )
393
395
if checkAmbiguousSelects then
396
+ // We use needsSelectIn instead of isAmbiguous since isAmbiguous
397
+ // is more expensive to compute. This matters since either criterion
398
+ // is false in almost all cases.
394
399
val isAmbiguous = qual.tpe.nonPrivateMember(name) match
395
400
case d : MultiDenotation => d.atSignature(sig).isInstanceOf [MultiDenotation ]
396
401
case _ => false
Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ Standard-Section: "ASTs" TopLevelStat*
75
75
Term = Path -- Paths represent both types and terms
76
76
IDENT NameRef Type -- Used when term ident’s type is not a TermRef
77
77
SELECT possiblySigned_NameRef qual_Term -- qual.name
78
- SELECTin Length possiblySigned_NameRef qual_Term owner_Type -- qual.name, referring to a symbol declared in owner that has the given signature
78
+ SELECTin Length possiblySigned_NameRef qual_Term owner_Type -- qual.name, referring to a symbol declared in owner that has the given signature (see note below)
79
79
QUALTHIS typeIdent_Tree -- id.this, different from THIS in that it contains a qualifier ident with position.
80
80
NEW clsType_Term -- new cls
81
81
THROW throwableExpr_Term -- throw throwableExpr
@@ -213,6 +213,10 @@ Standard-Section: "ASTs" TopLevelStat*
213
213
214
214
Annotation = ANNOTATION Length tycon_Type fullAnnotation_Term -- An annotation, given (class) type of constructor, and full application tree
215
215
216
+ Note: The signature of a SELECTin node is the signature of the selected symbol, not
217
+ the signature of the reference. The latter undergoes an asSeenFrom but the former
218
+ does not. TODO: Also use symbol signatures in TERMREFin
219
+
216
220
Note: Tree tags are grouped into 5 categories that determine what follows, and thus allow to compute the size of the tagged tree in a generic way.
217
221
218
222
Category 1 (tags 1-49) : tag
You can’t perform that action at this time.
0 commit comments