-
-
Notifications
You must be signed in to change notification settings - Fork 412
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't compile function with slice as a parameter #725
Comments
I think the problem is in checker.go if !t.AssignableTo(in) && t.Kind() != reflect.Interface {
return v.error(arg, "cannot use %v as argument (type %v) to call %v ", t, in, name)
} If |
By the way, func main() {
_, err := expr.Eval("Client.HasPhones([\"7\"])", env{})
if err != nil {
panic(err)
}
} Same is for func main() {
p, err := expr.Compile("Client.HasPhones([\"7\"])")
if err != nil {
panic(err)
}
_, err = expr.Run(p, env{})
if err != nil {
panic(err)
}
} |
Test case to prove problem MEZk@527303c . Concerns:
So if we know that |
The following code results in compilation error:
cannot use []interface {} as argument (type []string) to call HasPhones (1:18)
go 1.22.5
github.com/expr-lang/expr v1.16.9
I expect that the code can be compiled without errors.
The text was updated successfully, but these errors were encountered: