Skip to content
Browse files

Copy repo-auth-types for public static properties into derived classes

HHBBC can infer types for public static properties, but we weren't
copying the repo-auth-type into derived classes when constructing properties, so
we couldn't take advantage of it. So, if class A defines a public static
property called "x" and class B extends A, then A::$x would take advantage of
the repo-auth-type, but B::$x wouldn't (even though its the same static

Reviewed By: markw65

Differential Revision: D8731038

fbshipit-source-id: 07ee16f1c3cbacaafa8682db3eb28d22806c607c
  • Loading branch information
ricklavoie authored and hhvm-bot committed Jul 4, 2018
1 parent 6456aa1 commit c762214fbbde0c560edb336a0f1c3cbcbdab6cd0
Showing with 1 addition and 0 deletions.
  1. +1 −0 hphp/runtime/vm/class.cpp
@@ -2214,6 +2214,7 @@ void Class::setProperties() {
sProp.typeConstraint = parentProp.typeConstraint;
sProp.docComment = parentProp.docComment;
sProp.cls = parentProp.cls;
sProp.repoAuthType = parentProp.repoAuthType;
sProp.idx = -parentProp.idx - 1;
if (traitOffset < -sProp.idx) {
traitOffset = -sProp.idx;

0 comments on commit c762214

Please sign in to comment.