File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed 
compiler/src/dotty/tools/dotc/ast Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -55,11 +55,11 @@ abstract class Positioned(implicit @constructorOnly src: SourceFile) extends Src
5555  def  sourcePos (using  Context ):  SourcePosition  = 
5656    val  info  =  WrappedSourceFile .locateMagicHeader(source)
5757    info match 
58-       case  HasHeader (offset, originalFile) => 
59-         if  span.start >=  offset then   //  This span is in user code
58+       //  This span is in user code
59+       case  HasHeader (offset, originalFile)
60+         if  span !=  NoSpan  &&  span.start >=  offset => 
6061          originalFile.atSpan(span.shift(- offset))
61-         else   //  Otherwise, return the source position in the wrapper code
62-           source.atSpan(span)
62+       //  Otherwise, return the source position in the wrapper code
6363      case  _ =>  source.atSpan(span)
6464
6565  /**  This positioned item, widened to `SrcPos`. Used to make clear we only need the 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments