Skip to content

Commit

Permalink
Fix inconsistency with xp-framework/rfc#214
Browse files Browse the repository at this point in the history
  • Loading branch information
thekid committed Aug 12, 2014
1 parent e1507fe commit cb27513
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/main/php/lang/GenericTypes.class.php
Expand Up @@ -210,7 +210,8 @@ public function newType0($base, $arguments) {
array_unshift($state, 4);
$src.= '{';
foreach ($placeholders as $placeholder => $type) {
$src.= 'static $'.$placeholder.'= "'.$type.'";';
$src.= 'static $'.$placeholder.'= null;';
$src.= 'if (!$'.$placeholder.') $'.$placeholder.'= Type::forName("'.$type.'");';
}
if (isset($annotations[0]['generic']['return'])) {
$meta[1][$m][DETAIL_RETURNS]= strtr($annotations[0]['generic']['return'], $placeholders);
Expand Down
Expand Up @@ -16,7 +16,6 @@ class Unserializer extends \lang\Object {
*/
#[@generic(return= 'T')]
public function newInstance($arg= null) {
$type= Type::forName($T);
return null === $arg ? $type->default : $type->newInstance($arg);
return null === $arg ? $T->default : $T->newInstance($arg);
}
}

0 comments on commit cb27513

Please sign in to comment.