I think the author is referencing another thread where MethodError
’s “closest candidates” list does not show field names:
julia> struct TEST_STRUCT; A; B end
julia> TEST_STRUCT(1)
ERROR: MethodError: no method matching TEST_STRUCT(::Int64)
The type `TEST_STRUCT` exists, but no method is defined for this combination of argument types when trying to construct it.
Closest candidates are:
TEST_STRUCT(::Any, ::Any)
@ Main REPL[131]:1
Stacktrace:
[1] top-level scope
@ REPL[132]:1
julia> methods(TEST_STRUCT) # me checking that default constructors have field names
# 1 method for type constructor:
[1] TEST_STRUCT(A, B)
@ REPL[131]:1
That might be a helpful addition.