Skip to content

Commit c19155c

Browse files
committed
Proper test for StringType::setOffsetValueType()
1 parent 9439bba commit c19155c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Diff for: tests/PHPStan/Analyser/nsrt/bug-3981.php

+5
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ public function doFoo(string $s, string $nonEmptyString): void
2020
assertType('non-empty-string', $nonEmptyString[0]);
2121
assertType('non-empty-string', $nonEmptyString[1]);
2222
assertType('non-empty-string', $s[0]);
23+
24+
assertType('string', $s);
25+
26+
$s[0] = '1';
27+
assertType('non-empty-string', $s);
2328
}
2429

2530
}

0 commit comments

Comments
 (0)