facebook / facebook/hhvm

ReflectionFunctionAbstract->getParamInfo appending class name in default expressions to current namespace

Open
#8,041 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
18.7k
Forks
3.1k
Avg merge
1h 47m
Merged PRs (30d)
2

Description

### HHVM Version
3.22.1

### Standalone code, or other way to reproduce the problem
```hack
getParameters());
}
```

### Expected result
```
array(1) {
[0]=>
object(ReflectionParameter)#3 (3) {
["info"]=>
array(11) {
["index"]=>
int(0)
["name"]=>
string(3) "foo"
["type"]=>
string(3) "Foo"
["type_hint"]=>
string(3) "Foo"
["type_hint_builtin"]=>
bool(false)
["function"]=>
string(7) "Test\dumpFoo"
["type_hint_nullable"]=>
bool(false)
["default"]=>
object(Test\Foo)#2 (0) {
}
["defaultText"]=>
string(9) "new \Foo()"
["attributes"]=>
array(0) {
}
["is_optional"]=>
bool(true)
}
["name"]=>
string(3) "foo"
["paramTypeInfo"]=>
array(3) {
["name"]=>
string(3) "Foo"
["nullable"]=>
bool(false)
["builtin"]=>
bool(false)
}
}
}
```

### Actual result
```
Fatal error: Uncaught Error: Class undefined: Test\Foo in :1
Stack trace:
#0 (): include()
#1 (): ReflectionFunctionAbstract->getParamInfo()
#2 /in/HCRR3(-1): ReflectionFunctionAbstract->getParameters()
#3 {main}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.