Understanding generic functions and docstrings

What you are seeing is documented here:
https://docs.julialang.org/en/v1.7/manual/documentation/#Functions-and-Methods-2

Your first block just adds documentation to the specific (non existing) method somefunction(::Any):

help?> somefunction()
  Function that does something.

Your second block fails, because you are just trying to call method somefunction(::A) with a parameter t which isn’t defined. If you define t it will fail, because there is no method somefunction(::A).

1 Like