Add _nref method specifically for type inference (fixes #9135)

I'm not sure whether this is a good idea or not, especially in light of https://github.com/JuliaLang/julia/issues/8818#issuecomment-60523682. So I'll wait for comments.