Fix crash on go-to-def on union method

Fixes #1439.

You may want to go commit-by-commit.