You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
leohhhn
changed the title
Constant Expressions Not Work With Some Built-in Functions
GnoVM: Constant expressions do not work with some built-in functions
Sep 23, 2024
As far as I can see, min & max were introduced in Go 1.21; Gno is based on 1.17, so this is not supported yet. Will keep the issue open for visibility.
if you find this is the case for other constant expressions (like len([2]int{1, 2}), which should yield the constant-expr 2), then please open another issue.
as leon said, min/max are not supported yet, we'll need generics #1748 before that
Description
In Go, the following code snippet compiles and runs correctly, using the built-in
min
/max
function within a constant expression:However, when using the same code in Gno, it returns an error:
Expected Behavior
The code should compile successfully in Gno, similar to how it works in Go, allowing the use of built-in functions in constant expressions.
The text was updated successfully, but these errors were encountered: