Skip to content

Commit c77bea4

Browse files
committed
Adjust to changes in lang.ast.types.IsGeneric
See xp-framework/ast@ff700b3
1 parent 9f6d421 commit c77bea4

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

ChangeLog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ XP generics for PHP - ChangeLog
33

44
## ?.?.? / ????-??-??
55

6+
## 0.2.1 / 2022-11-06
7+
8+
* Adjust to changes in `lang.ast.types.IsGeneric` - @thekid
9+
610
## 0.2.0 / 2022-11-06
711

812
* Added support for generic function types such as `function(T, T): int`.

src/main/php/lang/ast/syntax/php/Generics.class.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public function setup($language, $emitter) {
150150
new InstanceExpression(
151151
new InvokeExpression(
152152
new ScopeExpression('\\lang\\XPClass', new Literal('forName')),
153-
[new ScopeExpression($node->type->base, new Literal('class'))]
153+
[new ScopeExpression($node->type->base->literal(), new Literal('class'))]
154154
),
155155
new Literal('newGenericType')
156156
),
@@ -183,8 +183,8 @@ public function setup($language, $emitter) {
183183
self::annotate($method, self::method($method, $node->name->components));
184184
}
185185

186-
// Rewrite class name
187-
$node->name= new IsValue($node->name->base);
186+
// Rewrite class name to the generic's base type
187+
$node->name= $node->name->base;
188188
}
189189
return $node;
190190
});

0 commit comments

Comments
 (0)