Q: Why numba infers type wrongly? A simple function for computing distance matrix between two sets of vectors, as
import numpy as np
from numba import jit

@jit(signature_or_function='(f8[:,:], f8[:,:])',  nopython=True, cache=True, locals={'d': numba.float64[:]})
def foo(prototypes, features):
    protonum   = prototypes.shape[0]
    featurenum = features.shape[0]
    dismatrix = np.zeros(shape=(featurenum, protonum), dtype=np.double)
    for i in range(featurenum):
        feature = features[i,:]
        tmp = (prototypes - feature)**2
        d = np.sqrt(tmp.sum(axis=1))   # (nproto, 1)
        dismatrix[i,:] = d
        idx = d.argmin()
    return dismatrix

The input parameter 'prototypes' is ndarray with shape (protonum, dim), and 'features' is ndarray with shape (featurenum, dim). This function runs well if 'nopython' is set to False, but raises error if 'nopython' is set to True. The error messages are
numba.errors.TypingError: Failed at nopython (nopython frontend)
No conversion from float64 to array(float64, 1d, A) for 'd'

It seems numba infers the type of 'd' wrongly as 'float64' instead of float64 array, even though explicitly specified by 'locals={'d': numba.float64[:]}'. Is there any place I did wrong?
Numba version = 0.23.1,  Python 3.5.
