File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 606606
607607function  collect_var! (unknowns, parameters, var, iv; depth =  0 )
608608    isequal (var, iv) &&  return  nothing 
609+     if  Symbolics. iswrapped (var)
610+         error (""" 
611+         Internal Error. Please open an issue with an MWE. 
612+ 
613+         Encountered a wrapped value in `collect_var!`. This function should only ever \ 
614+         receive unwrapped symbolic variables. This is likely a bug in the code generating \ 
615+         an expression passed to `collect_vars!` or `collect_scoped_vars!`. A common cause \ 
616+         is using `substitute` or `fast_substitute` with rules where the values are \ 
617+         wrapped symbolic variables. 
618+         """  )
619+     end 
609620    check_scope_depth (getmetadata (var, SymScope, LocalScope ()), depth) ||  return  nothing 
610621    var =  setmetadata (var, SymScope, LocalScope ())
611622    if  iscalledparameter (var)
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments