Bad AI generated code

I just caught Claude writing

procedure True (Condition : Boolean; What : String);

in a unit test. It compiles with no warnings.

That just looks like normal unit test code? Presumably the body just looks like raise ... with What if not condition;.

Whether this is a good structure for unit tests is open to debate, but I don’t see why you would expect it to emit a compiler warning.

The part that bothers me is using True as a procedure name, which shadows the Boolean enum value.

GNAT doesn’t warn for shadowing at all as far as I know because it’s such a common practice in Ada, it will emit an error if it’s ambiguous when you go to use it. I can’t think of any situations where it would be in this case although there probably is some obscure one with aspects.