MethodError even when method is in methods(func, types...)

I have a custom array type, NDArray in my own package which is templated on it element type and dimension like a normal Julia Array. The following code works totally fine if I define everything stand alone in the REPL, but fails when I place it inside of the package.

I’ve tried to define the function (as well as Base.:(*) and LinearAlgebra.mul!):

function mymultiply(rhs1::NDArray{A, 2}, rhs2::NDArray{B, 2}) where {A,B}
    ...
end

but always get a method error:

julia> mymultiply(a, b)
ERROR: MethodError: no method matching mymultiply(::NDArray{Float32, 2}, ::NDArray{Float32, 2})
Stacktrace:
 [1] top-level scope
   @ REPL[48]:1

This is super confusing to me because these are the inputs and the method is visible tomethods.

julia> typeof(a)
NDArray{Float32, 2}

julia> typeof(b)
NDArray{Float32, 2}

julia> methods(mymultiply)
# 1 method for generic function "mymultiply" from Main:
 [1] mymultiply(rhs1::NDArray{A, 2}, rhs2::NDArray{B, 2}) where {A, B}
     @ REPL[45]:1

It turns out that when I constructed my class the dimension was set as an Int32 literal (from a C-API), but when I defined the method it of course uses an Int64 literal. This explains the MethodError and why it appears like it should match (Int32 and Int64 print the same in the error)