Check class kind

Enforce that the specialization conforms the rules.

This solve a old, undocumented, and forgotten TODO in the new engine.