Currently, this check:
  
  
    
        
           | 
           fun ensure-distinct-lines(loc :: Loc, prev-is-template :: Boolean, stmts :: List<A.Expr>):  | 
        
    
   
 
Only takes lines, but not files, into account.
But, it is not relatively straightforward to take syntax from different files and combine them into single files and run them. However, if you happen to have two expressions on the same line in the separate files, this will result in a well-formedness error.
This function should presumably be taking the first argument to srcloc into account when doing the comparison, as if those are different, then the two expressions should not be considered on the same line.