File tree Expand file tree Collapse file tree 2 files changed +33
-22
lines changed 
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 2 files changed +33
-22
lines changed Original file line number Diff line number Diff line change @@ -2842,9 +2842,10 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
28422842  }
28432843
28442844  private  def  setAbstractTrackedInfo (sym : Symbol , rhs : Tree , tpt : untpd.Tree )(using  Context ):  Unit  = 
2845-     if  sym.allOverriddenSymbols.exists(_.flags.is(Tracked )) &&  ! sym.flags.is(ParamAccessor ) &&  ! sym.flags.is(Param ) then 
2846-       sym.setFlag(Tracked )
2847-       if  tpt.isEmpty then 
2845+     if  ! sym.flags.is(ParamAccessor ) &&  ! sym.flags.is(Param ) then 
2846+       if  sym.allOverriddenSymbols.exists(_.flags.is(Tracked )) then 
2847+         sym.setFlag(Tracked )
2848+       if  sym.flags.is(Tracked ) &&  tpt.isEmpty then 
28482849        sym.info =  rhs.tpe
28492850
28502851  private  def  retractDefDef (sym : Symbol )(using  Context ):  Tree  = 
Original file line number Diff line number Diff line change @@ -2,39 +2,49 @@ import scala.language.experimental.modularity
22import  scala .language .future 
33
44trait  F : 
5-   tracked val  x :  Int 
5+   tracked val  a :  Int 
66
77trait  G : 
8-   tracked val  y :  Int 
8+   tracked val  b :  Int 
99
1010trait  H : 
11-   tracked val  z :  Int  =  3 
11+   tracked val  c :  Int  =  3 
1212
1313trait  I  extends  F 
1414
1515trait  J  extends  F : 
16-   val  x :  Int  =  1 
16+   val  a :  Int  =  1 
1717
18- class  K (tracked val  x :  Int )
18+ class  K (tracked val  d :  Int )
19+ 
20+ class  L 
21+ 
22+ trait  M : 
23+   val  f :  Int 
1924
2025object  Test : 
21-   //  val f : F(1) /*: F { val x: 1 }*/ = new F:
22-   //    val x: 1 = 1
2326  val  f  =  new  F : 
24-     val  x  =  1 
27+     val  a  =  1 
2528  val  g  =  new  G : 
26-     val  y :  2  =  2 
29+     val  b :  2  =  2 
2730  val  h  =  new  H : 
28-     override  val  z  =  4 
31+     override  val  c  =  4 
2932  val  i  =  new  I : 
30-     val  x  =  5 
33+     val  a  =  5 
3134  val  j  =  new  J : 
32-     override  val  x  =  6 
35+     override  val  a  =  6 
3336  val  k  =  new  K (7 )
34- 
35-   summon[f.x.type  <:<  1 ]
36-   summon[g.y.type  <:<  2 ]
37-   summon[h.z.type  <:<  4 ]
38-   summon[i.x.type  <:<  5 ]
39-   summon[j.x.type  <:<  6 ]
40-   summon[k.x.type  <:<  7 ]
37+   val  l  =  new  L  {
38+     tracked val  e  =  8 
39+   }
40+   val  m  =  new  M : 
41+     tracked val  f  =  9 
42+ 
43+   summon[f.a.type  <:<  1 ]
44+   summon[g.b.type  <:<  2 ]
45+   summon[h.c.type  <:<  4 ]
46+   summon[i.a.type  <:<  5 ]
47+   summon[j.a.type  <:<  6 ]
48+   summon[k.d.type  <:<  7 ]
49+   //  summon[l.e.type <:< 8] // unrelated issue -- error: e is not a member of L
50+   summon[m.f.type  <:<  9 ]
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments