From 988aed0353d7c88ffd56964f004c4a022eafe504 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Wed, 1 Feb 2023 22:38:41 +0200 Subject: [PATCH] ci: fix broken tests after 322eb81 --- doc/docs.md | 2 +- vlib/gg/testdata/tweak_circles.vv | 4 ++-- vlib/term/ui/README.md | 2 +- vlib/v/tests/generic_fn_assign_generics_struct_test.v | 2 +- vlib/v/tests/generics_return_generics_struct_test.v | 2 +- vlib/v/tests/generics_struct_free_test.v | 4 ++-- vlib/v/tests/generics_with_generics_struct_init_test.v | 2 +- vlib/v/tests/generics_with_nested_generic_struct_init_test.v | 4 ++-- vlib/v/tests/generics_with_variadic_generic_args_test.v | 4 ++-- .../v/tests/structs_with_voidptr_fields_can_be_printed_test.v | 4 ++-- 10 files changed, 15 insertions(+), 15 deletions(-) diff --git a/doc/docs.md b/doc/docs.md index 2a270d4af..d8f30ac54 100644 --- a/doc/docs.md +++ b/doc/docs.md @@ -5564,7 +5564,7 @@ cause a panic. ```v struct Node { a &Node - b &Node = 0 // Auto-initialized to nil, use with caution! + b &Node = unsafe { nil } // Auto-initialized to nil, use with caution! } // Reference fields must be initialized unless an initial value is declared. diff --git a/vlib/gg/testdata/tweak_circles.vv b/vlib/gg/testdata/tweak_circles.vv index 59b2ef1ad..6050eb8e8 100644 --- a/vlib/gg/testdata/tweak_circles.vv +++ b/vlib/gg/testdata/tweak_circles.vv @@ -5,7 +5,7 @@ import gx struct App { mut: - gg &gg.Context = 0 + gg &gg.Context = unsafe { nil } radius f64 = 10.0 } @@ -43,7 +43,7 @@ fn on_event(e &gg.Event, mut app App) { fn frame(mut app App) { app.gg.begin() app.gg.draw_circle_empty(150, 150, f32(app.radius), gx.blue) - app.gg.draw_text(20, 20, 'radius: $app.radius') + app.gg.draw_text(20, 20, 'radius: ${app.radius}') // app.gg.draw_text(20, 50, 'circle_segment_size: $circle_segment_size') app.gg.end() } diff --git a/vlib/term/ui/README.md b/vlib/term/ui/README.md index d5c7f3f0c..945907048 100644 --- a/vlib/term/ui/README.md +++ b/vlib/term/ui/README.md @@ -9,7 +9,7 @@ import term.ui as tui struct App { mut: - tui &tui.Context = 0 + tui &tui.Context = unsafe { nil } } fn event(e &tui.Event, x voidptr) { diff --git a/vlib/v/tests/generic_fn_assign_generics_struct_test.v b/vlib/v/tests/generic_fn_assign_generics_struct_test.v index 590dea432..96d76e886 100644 --- a/vlib/v/tests/generic_fn_assign_generics_struct_test.v +++ b/vlib/v/tests/generic_fn_assign_generics_struct_test.v @@ -30,7 +30,7 @@ fn test_generics_assign_generics_struct() { struct Node[T] { pub mut: val T - next &Node[T] = 0 + next &Node[T] = unsafe { nil } } fn new[T]() &Node[T] { diff --git a/vlib/v/tests/generics_return_generics_struct_test.v b/vlib/v/tests/generics_return_generics_struct_test.v index 75aa4ea38..4bfe01b89 100644 --- a/vlib/v/tests/generics_return_generics_struct_test.v +++ b/vlib/v/tests/generics_return_generics_struct_test.v @@ -128,7 +128,7 @@ fn test_generics_return_generic_struct_from_fn() { struct ListNode[T] { pub mut: val T - next &ListNode[T] = 0 + next &ListNode[T] = unsafe { nil } } fn (mut node ListNode[T]) test() &ListNode[T] { diff --git a/vlib/v/tests/generics_struct_free_test.v b/vlib/v/tests/generics_struct_free_test.v index 8395a3614..8d1a4845f 100644 --- a/vlib/v/tests/generics_struct_free_test.v +++ b/vlib/v/tests/generics_struct_free_test.v @@ -1,12 +1,12 @@ struct List[T] { pub mut: - head &ListNode[T] = 0 + head &ListNode[T] = unsafe { nil } } struct ListNode[T] { pub mut: value T - next &ListNode[T] = 0 + next &ListNode[T] = unsafe { nil } } fn list_new[T]() List[T] { diff --git a/vlib/v/tests/generics_with_generics_struct_init_test.v b/vlib/v/tests/generics_with_generics_struct_init_test.v index 564d851f5..7c89c395d 100644 --- a/vlib/v/tests/generics_with_generics_struct_init_test.v +++ b/vlib/v/tests/generics_with_generics_struct_init_test.v @@ -8,7 +8,7 @@ mut: struct ListNode[T] { mut: val T - next &ListNode[T] = 0 + next &ListNode[T] = unsafe { nil } } fn create[T](arr []T) &List[T] { diff --git a/vlib/v/tests/generics_with_nested_generic_struct_init_test.v b/vlib/v/tests/generics_with_nested_generic_struct_init_test.v index c4150ddf8..73ab88a19 100644 --- a/vlib/v/tests/generics_with_nested_generic_struct_init_test.v +++ b/vlib/v/tests/generics_with_nested_generic_struct_init_test.v @@ -10,13 +10,13 @@ fn test_nested_generic_struct_init() { struct List[T] { pub mut: - head &ListNode[T] = 0 + head &ListNode[T] = unsafe { nil } } struct ListNode[T] { pub mut: value T - next &ListNode[T] = 0 + next &ListNode[T] = unsafe { nil } } pub fn list_new[T]() &List[T] { diff --git a/vlib/v/tests/generics_with_variadic_generic_args_test.v b/vlib/v/tests/generics_with_variadic_generic_args_test.v index 7ad4ff9bd..de8cf1897 100644 --- a/vlib/v/tests/generics_with_variadic_generic_args_test.v +++ b/vlib/v/tests/generics_with_variadic_generic_args_test.v @@ -1,12 +1,12 @@ struct Node[T] { mut: data T - next &Node[T] = 0 + next &Node[T] = unsafe { nil } } struct SinglyLinkedList[T] { mut: - first_node &Node[T] = 0 + first_node &Node[T] = unsafe { nil } } fn init_singlylinkedlist[T](nodes ...Node[T]) SinglyLinkedList[T] { diff --git a/vlib/v/tests/structs_with_voidptr_fields_can_be_printed_test.v b/vlib/v/tests/structs_with_voidptr_fields_can_be_printed_test.v index 1e2f32333..010332ce4 100644 --- a/vlib/v/tests/structs_with_voidptr_fields_can_be_printed_test.v +++ b/vlib/v/tests/structs_with_voidptr_fields_can_be_printed_test.v @@ -1,8 +1,8 @@ struct Abc { mut: vptr voidptr - vptrptr &voidptr = 0 - bptr &u8 = 0 + vptrptr &voidptr = unsafe { nil } + bptr &u8 = unsafe { nil } cptr &char = c'abcdef' } -- 2.30.2