Fix compiler error in result<void> in optional component