File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed 
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -477,7 +477,10 @@ object SymDenotations {
477477
478478    /**  The expanded name of this denotation. */  
479479    final  def  expandedName (using  Context ):  Name  = 
480-       if  (name.is(ExpandedName ) ||  isConstructor) name
480+       if  name.is(ExpandedName ) ||  isConstructor
481+       ||  name.is(DefaultGetterName ) &&  name.match  { case  DefaultGetterName (nme.CONSTRUCTOR , _) =>  true  case  _ =>  false  }
482+       then 
483+         name
481484      else  name.expandedName(initial.owner)
482485        //  need to use initial owner to disambiguate, as multiple private symbols with the same name
483486        //  might have been moved from different origins into the same class
Original file line number Diff line number Diff line change @@ -25,8 +25,8 @@ import ValueClasses.*
2525 *  This is necessary since private methods are not allowed to have the same name 
2626 *  as inherited public ones. 
2727 * 
28-  * Also, make non-private any private constructor that is annotated with `@publicInBinary`. 
29-  * (See SIP-52) 
28+  *   Also, make non-private any private constructor that is annotated with `@publicInBinary`. 
29+  *   (See SIP-52) 
3030 * 
3131 *  See discussion in https://github.com/scala/scala3/pull/784 
3232 *  and https://github.com/scala/scala3/issues/783 
Original file line number Diff line number Diff line change 1+ //>  using  options  -Ycheck:expandPrivate 
2+ 
3+ class  C  private  (x : Int , y : Int  =  1 ): 
4+   def  this () =  this (1 )
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments