Browse Source

Only show suggestions for really simple factors

David Peter 2 years ago
parent
commit
e4123b148b
2 changed files with 1 additions and 3 deletions
  1. 1 1
      numbat/src/typechecker.rs
  2. 0 2
      numbat/tests/interpreter.rs

+ 1 - 1
numbat/src/typechecker.rs

@@ -66,7 +66,7 @@ fn suggested_fix(
     let delta_type = expected_type.clone() / actual_type.clone();
 
     let num_factors = delta_type.iter().count();
-    if num_factors > 2 {
+    if num_factors > 1 {
         return None; // Do not suggest fixes with complicated dimensions
     }
 

+ 0 - 2
numbat/tests/interpreter.rs

@@ -237,8 +237,6 @@ fn test_incompatible_dimension_errors() {
         @r###"
      left hand side: Length  × Mass × Time⁻²    [= Force]
     right hand side: Length² × Mass             [= MomentOfInertia]
-
-    Suggested fix: divide the expression on the right hand side by a `Length × Time²` factor
     "###
     );