Skip to content
This repository has been archived by the owner on Sep 1, 2023. It is now read-only.

type_structure vs ReflectionTypeAlias::getTypeStructures() #6

Closed
MrCalen opened this issue Feb 8, 2017 · 2 comments
Closed

type_structure vs ReflectionTypeAlias::getTypeStructures() #6

MrCalen opened this issue Feb 8, 2017 · 2 comments

Comments

@MrCalen
Copy link

MrCalen commented Feb 8, 2017

Hi,

I noticed a difference between the return from type_structure and ReflectionTypeAlias::getTypeStructures(). Am I using it correctly ?

Thanks,

type_structure

array(2) {
  ["kind"]=>
  int(14)
  ["fields"]=>
  array(3) {
    ["a"]=>
    array(1) {
      ["kind"]=>
      int(4)
    }
  }
}

getTypeStructures

array(2) {
  ["kind"]=>
  int(14)
  ["fields"]=>
  array(3) {
    ["a"]=>
    array(1) {
      ["value"]=>
      array(1) {
        ["kind"]=>
        int(4)
      }
    }
  }
}
@MrCalen
Copy link
Author

MrCalen commented Feb 8, 2017

It worked with getResolvedTypeStructure. But the return type is not compatible as it is an array instead of TypeStructure (Probably because it is still experimental)

@fredemmott
Copy link
Contributor

I don't think the stuff from reflection is fully tested; type_structure() is the common approach.

This is really an issue in HHVM itself, not TypeAssert - however, type_structure() is not supported by the HHVM team, so I wouldn't expect a change here.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants