For users that like to bump into the type checker until we get it right (or more sincerely, those of us that learn from good error messages), the append procedure gives the most errors and the least actionable information (in my view).
I don’t know how much of this we should chalk up to skill issue versus investigating better errors. My mistake was to simply forget I was passing the array by value, not pointer, and then wondering why append didn’t like it.
If the error message just said “hey dummy gib pointer” I’d both have been on my way and learned not to make this mistake by now.
Error: No procedures or ambiguous call for procedure group 'append' that match with the given arguments
append(container, element)
^~~~~^
Given argument types: ([dynamic]u8, u8)
Did you mean to use one of the following:
runtime.append_elem :: proc(array: ^$T/[dynamic]$E, #no_broadcast arg: E, loc := #caller_location) -> (n: int, err: Allocator_Error) at /var/home/dev/Odin/base/runtime/core_builtin.odin(519:1)
runtime.append_elems :: proc(array: ^$T/[dynamic]$E, #no_broadcast args: ..E, loc := #caller_location) -> (n: int, err: Allocator_Error) at /var/home/dev/Odin/base/runtime/core_builtin.odin(568:1)
runtime.append_elem_string :: proc(array: ^$T/[dynamic]$E/u8, arg: $A/string, loc := #caller_location) -> (n: int, err: Allocator_Error) at /var/home/dev/Odin/base/runtime/core_builtin.odin(595:1)
runtime.append_soa_elem :: proc(array: ^$T/#soa[dynamic]$E, #no_broadcast arg: E, loc := #caller_location) -> (n: int, err: Allocator_Error) at /var/home/dev/Odin/base/runtime/core_builtin_soa.odin(290:1)
runtime.append_soa_elems :: proc(array: ^$T/#soa[dynamic]$E, #no_broadcast args: ..E, loc := #caller_location) -> (n: int, err: Allocator_Error) at /var/home/dev/Odin/base/runtime/core_builtin_soa.odin(347:1)