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 57aae3f commit f177237Copy full SHA for f177237
2 files changed
vlib/v/ast/table.v
@@ -2557,6 +2557,9 @@ pub fn (t &Table) dependent_names_in_expr(expr Expr) []string {
2557
names << util.no_dots(expr.name)
2558
}
2559
2560
+ IndexExpr {
2561
+ names << t.dependent_names_in_expr(expr.left)
2562
+ }
2563
IfExpr {
2564
for branch in expr.branches {
2565
names << t.dependent_names_in_expr(branch.cond)
vlib/v/tests/consts/const_indexexpr_dep_test.v
@@ -0,0 +1,7 @@
1
+const array1 = [1]
2
+const array2 = [array1]
3
+const array3 = array2[0]
4
+
5
+fn test_main() {
6
+ assert array3 == array1
7
+}
0 commit comments