Skip to content
Permalink
Browse files

Clean up unnecessary annotation

Ref #2111
  • Loading branch information...
muglug committed Sep 9, 2019
1 parent b49444b commit a1ea5c38c2ecdeeea9ed3ea5db25272c46e867e2
@@ -627,8 +627,8 @@ public static function analyze(
$method_pure_compatible = !empty($assign_var->var->inferredType->external_mutation_free)
|| isset($assign_var->var->pure);
if (($context->mutation_free
|| ($context->external_mutation_free && !$method_pure_compatible))
if (($context->mutation_free || $context->external_mutation_free)
&& !$method_pure_compatible
&& !$context->collect_mutations
&& !$context->collect_initializations
) {
@@ -125,9 +125,6 @@ public function __construct(string $bar) {
$this->bar = $bar;
}
/**
* @psalm-external-mutation-free
*/
public function withBar(string $bar): self {
$new = new Foo("hello");
/** @psalm-suppress InaccessibleProperty */
@@ -149,9 +146,6 @@ public function __construct(string $bar) {
$this->bar = $bar;
}
/**
* @psalm-external-mutation-free
*/
public function withBar(string $bar): self {
$new = clone $this;
/** @psalm-suppress InaccessibleProperty */
@@ -280,9 +274,6 @@ public function __construct(string $bar) {
$this->bar = $bar;
}
/**
* @psalm-external-mutation-free
*/
public function withBar(Bar $b): Bar {
$new = clone $b;
$b->a = $this->bar;

0 comments on commit a1ea5c3

Please sign in to comment.
You can’t perform that action at this time.