Commit fadbc88
Fix bug in folly::Optional::toStdOptional
Summary:
See https://fb.workplace.com/groups/145730152809376/permalink/1685600578822318/ for context. If you call toStdOptional on folly::Optional<bool>, the following cast will not work as expected:
```
folly::Optional<bool> optional = false;
// This will convert optional to bool and then construct std::optional<value>!
auto value = static_cast<std::optional<Value>>(optional);
```
So we just need to not rely on the cast and implement it in the more verbose way.
Differential Revision: D79928399
fbshipit-source-id: ea41ff6bf9c7724704b7d7056c0fd812e1faf0b61 parent 5de4b71 commit fadbc88
2 files changed
+34
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
223 | | - | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
224 | 229 | | |
225 | 230 | | |
226 | 231 | | |
227 | | - | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
228 | 236 | | |
229 | 237 | | |
230 | 238 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
844 | 844 | | |
845 | 845 | | |
846 | 846 | | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
847 | 871 | | |
848 | 872 | | |
849 | 873 | | |
| |||
0 commit comments