Introduce StringishObject, Have HHVM magically generate StringishObject instead of... nightly-2021.06.15
commitb07ad292b0693b8721452d98c55911806b9f9959
authorDavid Snider <dizzy@fb.com>
Tue, 15 Jun 2021 01:36:55 +0000 (14 18:36 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Tue, 15 Jun 2021 01:38:26 +0000 (14 18:38 -0700)
tree8d7e35ee945aa9d7d4c5ac9d8e2ec1089a496e48
parent565ec44af90b4ff8b35569db5e838bb101d273c5
Introduce StringishObject, Have HHVM magically generate StringishObject instead of Stringish on objects

Summary:
As part of a way to give a roadmap for folks who are using deprecated replacements for old-style stringish_cast to replace that with reasonable code.

The idea being that they have a stringish object, they can test against this type and then safely invoke the method vs Stringish::__toString which might actually try to invoke a method on a string.

Reviewed By: vassilmladenov

Differential Revision: D28972918

fbshipit-source-id: e1fbe9e10bb346bba92c9d8eb76f1b2bdbe37d44
27 files changed:
hphp/hack/hhi/InvalidOperationException.hhi
hphp/hack/hhi/imagick/ImagickException.hhi
hphp/hack/hhi/interfaces.hhi
hphp/hack/src/decl/decl_folded_class.ml
hphp/hack/src/decl/decl_linearize.ml
hphp/hack/src/naming/naming_special_names.ml
hphp/hack/src/naming/naming_special_names.rs
hphp/hack/test/integration/data/dependencies/classes-interfaces.php
hphp/hack/test/integration/data/dependencies/expected/__does_not_use_class_methods.php.exp
hphp/hack/test/typecheck/string_cast/string_cast2.php
hphp/hack/test/typecheck/stringish.php
hphp/hack/test/typecheck/unmagic_stringish/unmagic_stringish2.php
hphp/hhbbc/parse.cpp
hphp/runtime/vm/class.cpp
hphp/runtime/vm/jit/irgen-types.cpp
hphp/system/php/lang/string.php
hphp/test/slow/class-ptr/class-stringish.php
hphp/test/slow/class-ptr/class-stringish.php.expect [deleted file]
hphp/test/slow/class-ptr/class-stringish.php.expectf [new file with mode: 0644]
hphp/test/slow/hhbbc/magic_builtin_interfaces.php
hphp/test/slow/hhbbc/magic_builtin_interfaces.php.expect
hphp/test/slow/inlining/fpi-func-mismatch.php
hphp/test/slow/reflection/reflection_function_abstract.php.expect
hphp/test/slow/stringish.php.expectf
hphp/test/slow/stringishObject.php [new file with mode: 0644]
hphp/test/slow/stringishObject.php.expectf [new file with mode: 0644]
hphp/test/zend/good/ext/standard/tests/class_object/get_declared_interfaces_basic_001.php.expectf