hmm, yeah, ideally we would get rid of the invalid-type-form error here; it's just redundant noise to the user to have two diagnostics for the same problem. I think @MichaReiser has mentioned in the past that he wanted a global solution to make sure we didn't emit any red-knot diagnostics from type inference on nodes that were already known to be invalid syntax. Would be another thing that would be good to file a followup issue for IMO.
Originally posted by @AlexWaygood in astral-sh/ruff#17463 (comment)