From 7458b699d0689e0f6a55a2b14de69a5b3ffda4b5 Mon Sep 17 00:00:00 2001 From: yuyi Date: Wed, 13 Jan 2021 15:32:17 +0800 Subject: [PATCH] fmt: change `[1,2,3]!!` to `[1,2,3]!` (#8081) --- cmd/tools/vbin2v.v | 2 +- vlib/v/fmt/fmt.v | 2 +- vlib/v/fmt/tests/fixed_size_array_type_keep.vv | 2 +- vlib/v/fmt/tests/typeof_keep.vv | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/tools/vbin2v.v b/cmd/tools/vbin2v.v index a3885733c..5ad0eb35e 100644 --- a/cmd/tools/vbin2v.v +++ b/cmd/tools/vbin2v.v @@ -68,7 +68,7 @@ fn (context Context) file2v(bname string, fbytes []byte, bn_max int) string { sb.write('$b, ') } } - sb.write(']!!\n') + sb.write(']!\n') return sb.str() } diff --git a/vlib/v/fmt/fmt.v b/vlib/v/fmt/fmt.v index eb3c5a1b8..c63e06109 100644 --- a/vlib/v/fmt/fmt.v +++ b/vlib/v/fmt/fmt.v @@ -2049,7 +2049,7 @@ pub fn (mut f Fmt) array_init(it ast.ArrayInit) { // `[100]byte` if it.is_fixed { if it.has_val { - f.write('!!') + f.write('!') return } f.write(f.table.type_to_str(it.elem_type)) diff --git a/vlib/v/fmt/tests/fixed_size_array_type_keep.vv b/vlib/v/fmt/tests/fixed_size_array_type_keep.vv index 435b6be9e..44537b003 100644 --- a/vlib/v/fmt/tests/fixed_size_array_type_keep.vv +++ b/vlib/v/fmt/tests/fixed_size_array_type_keep.vv @@ -1,5 +1,5 @@ fn foo() [1]f32 { - return [f32(0.0)]!! + return [f32(0.0)]! } fn main() { diff --git a/vlib/v/fmt/tests/typeof_keep.vv b/vlib/v/fmt/tests/typeof_keep.vv index e42ded93b..93d6cdccf 100644 --- a/vlib/v/fmt/tests/typeof_keep.vv +++ b/vlib/v/fmt/tests/typeof_keep.vv @@ -1,3 +1,3 @@ fn test_typeof() { - println(typeof(x)) + println(typeof(x).name) } -- 2.39.5