Do something reasonable with self types (e.g., `self: T`) in generic classes. This is continuation of work in #2193.