pub(crate) fn extract_opt(ty: &Type) -> Option<&Type>