resolve: don't resolve paths that point to non-static methods

Fixes #6698