carbon-lang icon indicating copy to clipboard operation
carbon-lang copied to clipboard

When poisoning a name, keep the triggering instruction instead of the triggering location

Open bricknerb opened this issue 7 months ago • 5 comments

This discussion: https://discord.com/channels/655572317891461132/655578254970716160/1349053005609046108

Requires using AddPlaceholderInst() and ReplaceInstBeforeConstantUse() instead of AddInst() in some cases to allow using the InstId when looking up the name.

Destroy is a special case (in LookupMemberNameInScope()) because we only add it if lookup is fails finding the name.

Part of #4622.

bricknerb avatar Apr 29 '25 12:04 bricknerb