Fix namespace elaboration for default function parameters
Summary:
Namespace elaboration during codegen currently treats all ids in default parameters as constants. Fix codegen to properly resolve these names (as classes, functions, records, or constants).
Also fix codegen for constants to consistently qualify names. Previously, default parameters would not always use qualified constants. Example:
```
namespace TestNamespace {
const TEST_CONST = 'c';
class TestClass {
public function test_method($g = TEST_CONST) {}
}
}
```
Produced:
```
.class TestNamespace\TestClass {
// Wrong: not qualified here.
.method [public] <"" N > test_method($g = DV1("""TEST_CONST""")) {
L0:
Null
RetC
DV1:
// Correct: qualified here.
CnsE "TestNamespace\\TEST_CONST"
SetL $g
PopC
JmpNS L0
}
}
```
Change will produce
```
.class TestNamespace\TestClass {
// Wrong: not qualified here.
.method [public] <"" N > test_method($g = DV1("""\\TestNamespace\\TEST_CONST""")) {
L0:
Null
RetC
DV1:
// Correct: qualified here.
CnsE "TestNamespace\\TEST_CONST"
SetL $g
PopC
JmpNS L0
}
}
```
Reviewed By: Wilfred
Differential Revision:
D18145728
fbshipit-source-id:
a8566ccafec9b5661aaee703f3ef2b39521e17d0