-
-
Notifications
You must be signed in to change notification settings - Fork 413
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
How to recognize aliases? #596
Comments
I see the problem. In Go, custom int types are separate types. I think we can modify int() builtin to be able to convert to a regular int. |
Sounds like it will take a while to support ? |
I don’t know 🤷 you can boost speed with github donations. |
We can try this but actually you can add your constants into env like this: env := map[string]any{
"Service_FLY": Service_FLY,
"Service_BUS": Service_BUS,
// ...
}
// ...
out, err := expr.Compile(`Value == Service_FLY`)
// ... |
What if the alias is a pointer type?
If I use |
When I run the code , it crash:
--- FAIL: TestAAA (0.00s)
panic: invalid operation: int(main.ServiceType) (1:27)
| let arr = filter(AAA.BBB, int(#) == 32) ; len(arr) > 1
| ..........................^ [recovered]
panic: invalid operation: int(main.ServiceType) (1:27)
| let arr = filter(AAA.BBB, int(#) == 32) ; len(arr) > 1
| ..........................^
I want to be able to force the type of an array into an int type for me to recognize, how should I write the expression?
The text was updated successfully, but these errors were encountered: