Skip to content
This repository was archived by the owner on Oct 19, 2020. It is now read-only.

Commit beac1c6

Browse files
committed
Fix emitting errors for instanceof
1 parent fc42ee1 commit beac1c6

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

ChangeLog.md

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

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

6+
## 1.0.1 / 2020-04-04
7+
8+
* Fixed emitting errors for `instanceof` - @thekid
9+
610
## 1.0.0 / 2019-11-30
711

812
* Implemented xp-framework/rfc#334: Drop PHP 5.6. The minimum required

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public function setup($language, $emitter) {
102102
if (isset($is[$type])) {
103103
$cond= new InvokeExpression(new Literal('is_'.$type), [$t]);
104104
} else {
105-
$cond= new InstanceOfExpression($t, new Literal($type));
105+
$cond= new InstanceOfExpression($t, $type);
106106
}
107107
} else {
108108
$cond= new BinaryExpression($t, '===', $expr);

0 commit comments

Comments
 (0)