Co-authored-by: Matthew Lugg <mlugg@mlugg.co.uk>
The error messages here aren't amazing yet, but this is an improvement on status quo, because the current behavior allows false negative compile errors, so effectively miscompiles. Resolves: #15874