No longer emit nullable for typeconst param initialized to null
commit51a367f44d54808e425f07d16d28596876b15a95
authorThomas Jiang <thomasjiang@fb.com>
Tue, 26 Sep 2017 23:39:25 +0000 (26 16:39 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Tue, 26 Sep 2017 23:44:36 +0000 (26 16:44 -0700)
tree94331eb747825409baedf6950aea9b9f3ee43a65
parent7cbf62bd90d18ab4460b5fab52c5cba6a3c04a99
No longer emit nullable for typeconst param initialized to null

Summary:
Previously, hhbc and hhvm differed in the bytecode emitted for typeconst params that were set by default to null. For instance:

  <?hh // strict

  class TestClass {

    const type NullableString = ?string;

    public function f(TestClass::NullableString $a = null): void {
    }
  }

Previously, hhbc would label the param as `nullable hh_type extended_hint type_constant` but hhvm would only label it as `hh_type extended_hint type_constant`. Thus, we introduce a slight regression into hhbc in order to address this.

Reviewed By: michaeltingley

Differential Revision: D5913123

fbshipit-source-id: 59efe650211ffa7d44c9891a0ba4760426cf49ab
hphp/hack/src/hhbc/emit_type_hint.ml