Make adapter always operate on non-nullable typesnightly-2020.12.19
commit706c61c0d5f019705430cdc8dc8fc830175e2492
authorMax Katsev <mkatsev@fb.com>
Fri, 18 Dec 2020 21:48:41 +0000 (18 13:48 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Fri, 18 Dec 2020 21:50:52 +0000 (18 13:50 -0800)
tree5d497d7a69609a9a9f6e4863519881a0117fc53b
parentebddd6919fa450c53ca1fb72dd9c9ff604c62153
Make adapter always operate on non-nullable types

Summary: While working on the codegen changes for this, I realized that it's very hard to reason about correctness if we allow the adapter to change null to non-null or vice versa (eg it might output null for a non-optional field). To make life easier, let's require adapters to only handle non-nulls and always keep nulls as is.

Reviewed By: ot, andrii-korotkov

Differential Revision: D25605073

fbshipit-source-id: f489f90d0f0d859c15c7bcaa89eab24f28a00070
hphp/runtime/ext/thrift/adapter.cpp
hphp/test/slow/thrift/hack_adapter.php
hphp/test/slow/thrift/hack_adapter.php.expect