3 Commits

Author SHA1 Message Date
Martin Atkins
8701ed9907 tfdiags: Override cooperates with contextual diagnostics
This package has two different mechanisms that can cause an existing
diagnostic to be replaced with a modified version:
- "Override" effectively wraps an arbitrary other diagnostic with a new
  severity and optional new "extra info".
- Contextual diagnostics allow a diagnostic to be created in one place
  with some incomplete information, and then "elaborated" in another place
  where more information is available.

Those two mechanisms did not previously interact well together: passing
a contextual diagnostic to Override would prevent its elaboration process
from taking effect.

Now the overriddenDiagnostic type -- implementation detail of "Override" --
implements the same unexported interface that the contextual diagnostics
do, and delegates the elaboration request to the diagnostic that it's
wrapping so that the elaboration can take effect while still preserving
the effect of the overrides.

This combination is okay because in practice "override" only affects
Severity and ExtraInfo, while contextual diagnostics today only affect
the source location information and the "address" components of the
diagnostic, so the two can work independently of one another.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-05-06 14:54:24 -07:00
namgyalangmo
cb2e9119aa Update copyright notice (#1232)
Signed-off-by: namgyalangmo <75657887+namgyalangmo@users.noreply.github.com>
2024-02-08 09:48:59 +00:00
Liam Cervante
f74a8d16cf [testing framework] implement expect_failures functionality (#33443) 2023-07-10 11:30:44 +01:00