1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

parser: disallow the array init: attr, when the len: attr is not provided (#16735)

This commit is contained in:
Swastik Baranwal
2022-12-22 00:54:16 +05:30
committed by GitHub
parent 87f8069728
commit 3c5cfa22d1
8 changed files with 40 additions and 11 deletions

View File

@@ -16,7 +16,7 @@ fn main() {
// Breadth-First Search (BFS) allows you to find the shortest distance between two nodes in the graph.
fn breadth_first_search_path(graph map[string][]string, vertex string, target string) []string {
mut path := []string{}
mut visited := []string{init: vertex}
mut visited := []string{len: 6, init: vertex}
mut queue := [][][]string{}
queue << [[vertex], path]
for queue.len > 0 {