From be8023be2ce46dfc18dd38c360752b018f8a044e Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Wed, 22 Oct 2025 15:29:36 +0300 Subject: [PATCH] tests: simplify vlib/v/tests/skip_unused/generic_call_from_json.vv --- .../generic_call_from_json.run.out | 1 + ...generic_call_from_json.skip_unused.run.out | 1 + .../skip_unused/generic_call_from_json.vv | 25 +++++-------------- 3 files changed, 8 insertions(+), 19 deletions(-) diff --git a/vlib/v/tests/skip_unused/generic_call_from_json.run.out b/vlib/v/tests/skip_unused/generic_call_from_json.run.out index e69de29bb..9766475a4 100644 --- a/vlib/v/tests/skip_unused/generic_call_from_json.run.out +++ b/vlib/v/tests/skip_unused/generic_call_from_json.run.out @@ -0,0 +1 @@ +ok diff --git a/vlib/v/tests/skip_unused/generic_call_from_json.skip_unused.run.out b/vlib/v/tests/skip_unused/generic_call_from_json.skip_unused.run.out index e69de29bb..9766475a4 100644 --- a/vlib/v/tests/skip_unused/generic_call_from_json.skip_unused.run.out +++ b/vlib/v/tests/skip_unused/generic_call_from_json.skip_unused.run.out @@ -0,0 +1 @@ +ok diff --git a/vlib/v/tests/skip_unused/generic_call_from_json.vv b/vlib/v/tests/skip_unused/generic_call_from_json.vv index 63424ad08..e29d27112 100644 --- a/vlib/v/tests/skip_unused/generic_call_from_json.vv +++ b/vlib/v/tests/skip_unused/generic_call_from_json.vv @@ -1,36 +1,23 @@ -import veb import x.json2 -pub struct Context { - veb.Context -} - -pub struct App { - veb.Middleware[Context] -} - -@['/'; POST] -fn (app &App) index(mut ctx Context) veb.Result { - j := json2.decode[json2.Any](ctx.req.data) or { return ctx.request_error('error') } - +fn f() ! { + j := json2.decode[json2.Any]('')! m := j.as_map() myarr := m['myarr'] or { panic(error) } m2 := myarr.arr() - for mc in m2 { parts := mc.arr() - // Compiler error occurs here --> first := parts[0].str() second := parts[1].str() third := parts[2].str() - println('1. ${first}, 2. ${second}, 3. ${third}') } - - return ctx.ok('ok') } fn main() { - _ := &App{} + if false { + f()! + } + println('ok') } -- 2.39.5