mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 22:02:23 +01:00
This starts propagating is_extern on import, and warns when merging an imported non-extern declaration with a local non-extern declaration. Note this doesn't address import conflicts yet (i.e., two libraries define an equivalent name) because they don't call merge logic. On merge, I'm only setting values when new_is_definition because I think it better matches the comment and resulting behavior. Note I now set them even for bad redefinitions; I think this matches the comment, and there's not a perfect choice here. I could change the flow back if preferred. Note this puts a spotlight on invalid nodes on imported decls, which I think I'm going to need to address now. This isn't addressed by ImportRef logic directly because the Function's decl_id is a FunctionDecl, rather than the ImportRef that led to it. While I could add the ImportRef link to each decl, I think adjusting the associated NodeId is a better approach.