fix(tvix/eval): Force thunks when comparing against ground vals
Thunks correctly force when comparing for equality against other thunks, but weren't being forced correctly when comparing against non-thunk values, in either direction. Change-Id: Ia03702895ec4d70aed3445c1b0a9a7a641d1a300 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6897 Autosubmit: grfn <grfn@gws.fyi> Reviewed-by: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI
This commit is contained in:
		
							parent
							
								
									1677186144
								
							
						
					
					
						commit
						f6bcd11cad
					
				
					 3 changed files with 13 additions and 3 deletions
				
			
		|  | @ -288,8 +288,14 @@ impl Value { | |||
| 
 | ||||
|                 Ok(*lhs.value() == *rhs.value()) | ||||
|             } | ||||
|             (Value::Thunk(lhs), rhs) => Ok(&*lhs.value() == rhs), | ||||
|             (lhs, Value::Thunk(rhs)) => Ok(lhs == &*rhs.value()), | ||||
|             (Value::Thunk(lhs), rhs) => { | ||||
|                 lhs.force(vm)?; | ||||
|                 Ok(&*lhs.value() == rhs) | ||||
|             } | ||||
|             (lhs, Value::Thunk(rhs)) => { | ||||
|                 rhs.force(vm)?; | ||||
|                 Ok(lhs == &*rhs.value()) | ||||
|             } | ||||
| 
 | ||||
|             // Everything else is either incomparable (e.g. internal
 | ||||
|             // types) or false.
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue