Files
carbon-lang/toolchain/check/testdata/choice
popcoder565andpopcoder565 f396762e22 Fix destroying function-local vars of choice types (#7941)
Since #7840, `SubobjectDestroy.Op` for a class destroys each field by
looking it up by name. A choice's discriminant field has a special name
that isn't in the class's scope, so any function-local `var` of choice
type failed with ``member name `discriminant` not found``. Skip the
discriminant the same way as the vptr, since neither is a named member
and both are trivially destructible.

Assisted-by: Claude Code with Claude Opus 5.5

---------

Co-authored-by: popcoder565 <339285150+popcoder565@users.noreply.github.com>
2026-10-13 14:19:49 +00:00
..