Summary
immutable_or_opaque() in alias.c and cap_immutable_or_opaque() in cap.c are dead code that should be removed.
Details
immutable_or_opaque() was introduced in PR #1124 ("Restrict mutable tuple recovery", 2016) and was called from recover_type() in alias.c. Its sole non-recursive caller was removed in PR #2585 ("Relax the rules for tuple recovery", 2018). Since then, the function is only called recursively by itself — it has no entry point and is unreachable.
cap_immutable_or_opaque() in cap.c is only called from within immutable_or_opaque(), making it transitively dead as well.
Both functions are declared in their respective headers (alias.h line 21, cap.h line 97) but have zero live callers anywhere in the codebase.
Additional note
As noted in the viewpoint_lower investigation, immutable_or_opaque() uses viewpoint_lower for arrow types (line 699 of alias.c), which is the pre-#4458 approach. This would be an analogous issue to the one fixed in #4458 if the code were live, but since it's dead, the fix is simply removal.
Scope
Remove the following:
immutable_or_opaque() definition in alias.c (lines 675–730)
immutable_or_opaque() declaration in alias.h (line 21)
cap_immutable_or_opaque() definition in cap.c
cap_immutable_or_opaque() declaration in cap.h (line 97)
Summary
immutable_or_opaque()inalias.candcap_immutable_or_opaque()incap.care dead code that should be removed.Details
immutable_or_opaque()was introduced in PR #1124 ("Restrict mutable tuple recovery", 2016) and was called fromrecover_type()inalias.c. Its sole non-recursive caller was removed in PR #2585 ("Relax the rules for tuple recovery", 2018). Since then, the function is only called recursively by itself — it has no entry point and is unreachable.cap_immutable_or_opaque()incap.cis only called from withinimmutable_or_opaque(), making it transitively dead as well.Both functions are declared in their respective headers (
alias.hline 21,cap.hline 97) but have zero live callers anywhere in the codebase.Additional note
As noted in the viewpoint_lower investigation,
immutable_or_opaque()usesviewpoint_lowerfor arrow types (line 699 ofalias.c), which is the pre-#4458 approach. This would be an analogous issue to the one fixed in #4458 if the code were live, but since it's dead, the fix is simply removal.Scope
Remove the following:
immutable_or_opaque()definition inalias.c(lines 675–730)immutable_or_opaque()declaration inalias.h(line 21)cap_immutable_or_opaque()definition incap.ccap_immutable_or_opaque()declaration incap.h(line 97)