File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed 
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -244,13 +244,21 @@ object Types extends TypeUtils {
244244    def  isExactlyNothing (using  Context ):  Boolean  =  this  match  {
245245      case  tp : TypeRef  => 
246246        tp.name ==  tpnme.Nothing  &&  (tp.symbol eq defn.NothingClass )
247+       case  AndType (tp1, tp2) => 
248+         tp1.isExactlyNothing ||  tp2.isExactlyNothing
249+       case  OrType (tp1, tp2) => 
250+         tp1.isExactlyNothing &&  tp2.isExactlyNothing
247251      case  _ =>  false 
248252    }
249253
250254    /**  Is this type exactly Any (no vars, aliases, refinements etc allowed)? */  
251255    def  isExactlyAny (using  Context ):  Boolean  =  this  match  {
252256      case  tp : TypeRef  => 
253257        tp.name ==  tpnme.Any  &&  (tp.symbol eq defn.AnyClass )
258+       case  AndType (tp1, tp2) => 
259+         tp1.isExactlyAny &&  tp2.isExactlyAny
260+       case  OrType (tp1, tp2) => 
261+         tp1.isExactlyAny ||  tp2.isExactlyAny
254262      case  _ =>  false 
255263    }
256264
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments