Skip to content

Commit 480eda9

Browse files
committed
Fix "Class ... is not a generic definition"
1 parent 337205b commit 480eda9

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

ChangeLog.md

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

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

6+
## 0.5.1 / 2023-07-27
7+
8+
* Fixed error *Class ... is not a generic definition* when parent class
9+
was not previously loaded
10+
(@thekid)
11+
612
## 0.5.0 / 2023-02-12
713

814
* Migrated to new test framework, see xp-framework/rfc#344 - @thekid

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,9 @@ public function setup($language, $emitter) {
262262
return [
263263
new InvokeExpression(
264264
new InstanceExpression(
265-
new NewExpression(
266-
new IsValue('\\lang\\XPClass'),
267-
[new ScopeExpression($node->parent->base->literal(), new Literal('class'))]
265+
new InvokeExpression(
266+
new ScopeExpression('\\lang\\XPClass', new Literal('forName')),
267+
[new Literal("'".$node->parent->base->literal()."'")]
268268
),
269269
new Literal('newGenericType')
270270
),

0 commit comments

Comments
 (0)