# Bad AI generated code

**URL:** <https://forum.ada-lang.io/t/bad-ai-generated-code/4980>\
**Category:** General\
**Created:** [November 23, 2026, 9:05am UTC](https://forum.ada-lang.io/t/bad-ai-generated-code/4980 "2026-11-23T09:05:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![JeremyGrosser](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/jeremygrosser/32/3_2.png) [@JeremyGrosser](https://forum.ada-lang.io/u/JeremyGrosser)\
**Post date:** [November 23, 2026, 9:05am UTC](https://forum.ada-lang.io/t/bad-ai-generated-code/4980/1 "2026-11-23T09:05:04Z")

</div>

I just caught Claude writing

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

```

in a unit test. It compiles with no warnings.

---

<div class="post-metadata">

**Author:** ![liampwll](https://forum.ada-lang.io/letter_avatar_proxy/v4/letter/l/b19c9b/32.png) [@liampwll](https://forum.ada-lang.io/u/liampwll)\
**Post date:** [November 23, 2026, 9:14am UTC](https://forum.ada-lang.io/t/bad-ai-generated-code/4980/2 "2026-11-23T09:14:04Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![JeremyGrosser](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/jeremygrosser/32/3_2.png) [@JeremyGrosser](https://forum.ada-lang.io/u/JeremyGrosser)\
**Post date:** [November 23, 2026, 9:15am UTC](https://forum.ada-lang.io/t/bad-ai-generated-code/4980/3 "2026-11-23T09:15:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![liampwll](https://forum.ada-lang.io/letter_avatar_proxy/v4/letter/l/b19c9b/32.png) [@liampwll](https://forum.ada-lang.io/u/liampwll)\
**Post date:** [November 23, 2026, 9:17am UTC](https://forum.ada-lang.io/t/bad-ai-generated-code/4980/4 "2026-11-23T09:17:36Z")

</div>

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.
