Skip to content

Commit 3a51fe6

Browse files
committed
Fix ambiguity resolution for parameter annotations
1 parent a8d5935 commit 3a51fe6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/main/php/lang/ast/emit/php/XpMeta.class.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
trait XpMeta {
1818

1919
/** Stores lowercased, unnamespaced name in annotations for BC reasons! */
20-
protected function annotations($result, $annotations) {
20+
protected function annotations($result, $annotations, $resolve= null) {
2121
if (null === $annotations) return [];
2222

2323
$lookup= [];
@@ -32,7 +32,7 @@ protected function annotations($result, $annotations) {
3232
} else if (1 === sizeof($arguments) && isset($arguments[0])) {
3333
$this->emitOne($result, $arguments[0]);
3434
$result->out->write(',');
35-
$lookup[$name]= 1; // Resolve ambiguity
35+
$lookup[$name][$resolve]= 1; // Resolve ambiguity
3636
} else {
3737
$result->out->write('[');
3838
foreach ($arguments as $name => $argument) {
@@ -53,13 +53,13 @@ private function attributes($result, $annotations, $target) {
5353
$result->out->write('], DETAIL_TARGET_ANNO => [');
5454
foreach ($target as $name => $annotations) {
5555
$result->out->write("'$".$name."' => [");
56-
foreach ($this->annotations($result, $annotations) as $key => $value) {
56+
foreach ($this->annotations($result, $annotations, $name) as $key => $value) {
5757
$lookup[$key]= $value;
5858
}
5959
$result->out->write('],');
6060
}
6161
foreach ($lookup as $key => $value) {
62-
$result->out->write("'".$key."' => '".$value."',");
62+
$result->out->write("'{$key}' => ".var_export($value, true).',');
6363
}
6464
$result->out->write(']');
6565
}

0 commit comments

Comments
 (0)