We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5724806 commit 23efe7bCopy full SHA for 23efe7b
checker/types.go
@@ -98,7 +98,7 @@ func isTime(t reflect.Type) bool {
98
return true
99
}
100
101
- return isAny(t)
+ return false
102
103
104
func isDuration(t reflect.Type) bool {
expr_test.go
@@ -1791,3 +1791,17 @@ func TestEnv_keyword(t *testing.T) {
1791
1792
1793
1794
+
1795
+func TestIssue401(t *testing.T) {
1796
+ program, err := expr.Compile("(a - b + c) / d", expr.AllowUndefinedVariables())
1797
+ require.NoError(t, err, "compile error")
1798
1799
+ output, err := expr.Run(program, map[string]interface{}{
1800
+ "a": 1,
1801
+ "b": 2,
1802
+ "c": 3,
1803
+ "d": 4,
1804
+ })
1805
+ require.NoError(t, err, "run error")
1806
+ require.Equal(t, 0.5, output)
1807
+}
0 commit comments