Weird case of the where's

julia> function f(::f) where f
       f
       end
f (generic function with 0 methods)

julia> function g(::f) where f
       f
       end
g (generic function with 1 method)

Why does the first definition fail to work while the second does? I mean why does the first one have no methods?

This is a bug, you should report it (if it wasn’t yet).

I’d have expected this to error - the f inside of the function is ambigous. Please open an issue on github.

1 Like