Skip to content

Commit

Permalink
add test for #9496
Browse files Browse the repository at this point in the history
  • Loading branch information
ptomulik committed Mar 12, 2023
1 parent 44ffd5f commit b12ed07
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/TypeAnnotationTest.php
Expand Up @@ -653,6 +653,32 @@ public function doStuff(): array {
'$output===' => 'list<1|2>',
],
],
'callableWithReturnTypeWithinParens' => [
'code' => '<?php
/** @psalm-type TCallback (callable():int) */
class Foo {
/** @psalm-var TCallback */
public static $callback;
}
$output = Foo::$callback;
',
'assertions' => [
'$output===' => 'callable():int',
],
],
'callableWithReturnTypeWithoutParens' => [
'code' => '<?php
/** @psalm-type TCallback callable():int */
class Foo {
/** @psalm-var TCallback */
public static $callback;
}
$output = Foo::$callback;
',
'assertions' => [
'$output===' => 'callable():int',
],
],
'handlesTypeWhichEndsWithRoundBracket' => [
'code' => '<?php
/**
Expand Down

0 comments on commit b12ed07

Please sign in to comment.