Skip to content

TYP047

TYP047 — optional type not narrowed

SubsystemType checking
Severityerror

A value of type T? is used as a T without first narrowing it. Narrow with if let Some(x) = opt { … }, match, or chain with ?.; the T? only becomes T on the branch where it’s known present. See spec/types.md §“optional types and flow narrowing”.

From your terminal:

Terminal window
q64 explain TYP047