-
Notifications
You must be signed in to change notification settings - Fork 1.5k
When poisoning a name, keep the triggering instruction instead of the triggering location #5380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
Conversation
… triggering location This will allow us to provide better diagnostics. `Destroy` is a special case (in `LookupMemberNameInScope()`) because we only add it if lookup is fails finding the name. Part of carbon-language#4622.
Two things here:
|
Thanks!
|
Thanks! The diagnostic structure has changed since two months ago. We now accept an |
Makes sense. Another potential reason is for importing poisoned names from api to impl. carbon-lang/toolchain/check/testdata/function/declaration/no_prelude/name_poisoning.carbon Line 174 in 5226f3d
I considered doing that by adding a poisoned name in impl, with a poisoning location pointing to the api poisoning location. The Alternatively, we can add a new WDYT? |
Sorry, I wasn't seeing part of your plan here. This additional detail helps, but mostly I think I can offer clearer advice. I still think you should work this through to the point that the diagnostic changes you want are implemented, either in this PR or a stacked PR. For example here, you mention switching the poisoning location to an Where would the poisoning Also, to note the regressions in this PR, the golden test output should really stay the same in general. I think that fixing those bugs will also require altering your approach a little. For example, I do see some changes to order of instruction creation which look flawed (e.g., swapping ordering in handle_name.cpp of the instructions there); that's a temporal bug, instructions can only use previous instructions as inputs. There are probably a couple different ways to handle that, e.g. using a callback to construct the poisoning instruction rather than requiring the
|
This discussion: https://discord.com/channels/655572317891461132/655578254970716160/1349053005609046108
Requires using
AddPlaceholderInst()
andReplaceInstBeforeConstantUse()
instead ofAddInst()
in some cases to allow using theInstId
when looking up the name.Destroy
is a special case (inLookupMemberNameInScope()
) because we only add it if lookup is fails finding the name.Part of #4622.