Allow impls and traits having static and instance methods with the same name

This fixes all errors described in issue #4265. `make check` runs successfully on my machine.

r? @brson