Do not rely on newtype enum dereference

See #7552.