@@ -43,7 +43,8 @@ object SymDenotations {
43
43
44
44
// private[SymDenotations]
45
45
var defTree : tpd.Tree | Null = null
46
- // private[SymDenotations]
46
+ // private[SymDenotations
47
+ def isClass : Boolean = isInstanceOf [ClassCommon ]
47
48
def asClass : ClassCommon = asInstanceOf [ClassCommon ]
48
49
49
50
def reset () =
@@ -69,14 +70,14 @@ object SymDenotations {
69
70
* during a period.
70
71
*/
71
72
class SymDenotation private [SymDenotations ] (
72
- symbol : Symbol ,
73
+ symbolHint : Symbol | Null ,
73
74
final val common : SymCommon ,
74
75
final val maybeOwner : Symbol ,
75
76
final val name : Name ,
76
77
initFlags : FlagSet ,
77
78
initInfo : Type ,
78
79
initPrivateWithin : Symbol = NoSymbol )
79
- extends SingleDenotation (symbol , initInfo, name.isTypeName), ParamInfo , SrcPos , Named {
80
+ extends SingleDenotation (symbolHint , initInfo, name.isTypeName), ParamInfo , SrcPos , Named {
80
81
81
82
// assert(symbol.id != 4940, name)
82
83
@@ -1845,14 +1846,14 @@ object SymDenotations {
1845
1846
/** The contents of a class definition during a period
1846
1847
*/
1847
1848
class ClassDenotation private [SymDenotations ] (
1848
- symbol : Symbol ,
1849
+ symbolHint : Symbol | Null ,
1849
1850
common : ClassCommon ,
1850
1851
maybeOwner : Symbol ,
1851
1852
name : Name ,
1852
1853
initFlags : FlagSet ,
1853
1854
initInfo : Type ,
1854
1855
initPrivateWithin : Symbol )
1855
- extends SymDenotation (symbol , common, maybeOwner, name, initFlags, initInfo, initPrivateWithin) {
1856
+ extends SymDenotation (symbolHint , common, maybeOwner, name, initFlags, initInfo, initPrivateWithin) {
1856
1857
1857
1858
import util .EqHashMap
1858
1859
@@ -2505,14 +2506,14 @@ object SymDenotations {
2505
2506
* It overrides ClassDenotation to take account of package objects when looking for members
2506
2507
*/
2507
2508
final class PackageClassDenotation private [SymDenotations ] (
2508
- symbol : Symbol ,
2509
+ symbolHint : Symbol | Null ,
2509
2510
common : ClassCommon ,
2510
2511
ownerIfExists : Symbol ,
2511
2512
name : Name ,
2512
2513
initFlags : FlagSet ,
2513
2514
initInfo : Type ,
2514
2515
initPrivateWithin : Symbol )
2515
- extends ClassDenotation (symbol , common, ownerIfExists, name, initFlags, initInfo, initPrivateWithin) {
2516
+ extends ClassDenotation (symbolHint , common, ownerIfExists, name, initFlags, initInfo, initPrivateWithin) {
2516
2517
2517
2518
private var packageObjsCache : List [ClassDenotation ] = _
2518
2519
private var packageObjsRunId : RunId = NoRunId
@@ -2713,21 +2714,21 @@ object SymDenotations {
2713
2714
* should be done via this method.
2714
2715
*/
2715
2716
def SymDenotation (
2716
- symbol : Symbol ,
2717
+ symbolHint : Symbol | Null ,
2717
2718
common : SymCommon ,
2718
2719
owner : Symbol ,
2719
2720
name : Name ,
2720
2721
initFlags : FlagSet ,
2721
2722
initInfo : Type ,
2722
2723
initPrivateWithin : Symbol = NoSymbol )(using Context ): SymDenotation = {
2723
2724
val result =
2724
- if symbol .isClass then
2725
+ if common .isClass then
2725
2726
if initFlags.is(Package ) then
2726
- new PackageClassDenotation (symbol , common.asClass, owner, name, initFlags, initInfo, initPrivateWithin)
2727
+ new PackageClassDenotation (symbolHint , common.asClass, owner, name, initFlags, initInfo, initPrivateWithin)
2727
2728
else
2728
- new ClassDenotation (symbol , common.asClass, owner, name, initFlags, initInfo, initPrivateWithin)
2729
+ new ClassDenotation (symbolHint , common.asClass, owner, name, initFlags, initInfo, initPrivateWithin)
2729
2730
else
2730
- new SymDenotation (symbol , common, owner, name, initFlags, initInfo, initPrivateWithin)
2731
+ new SymDenotation (symbolHint , common, owner, name, initFlags, initInfo, initPrivateWithin)
2731
2732
result.validFor = currentStablePeriod
2732
2733
result
2733
2734
}
0 commit comments