We weren't shadowing names correctly when a class was parameterised on a single variable and one of the methods bound the same name. This almost never happens, but leads to very odd error messages when it does. Fixes #2026