Useless type

Fix a wrong `useless-type` warning for attributes.
Extends the `useless-type` warning to local variables.
Warning: `inherited_type` is always non null here.