-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support suppressing issues on definitions
- Loading branch information
Showing
5 changed files
with
32 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
ERROR: DuplicateEnumValue - input.hack:5:14 - Duplicate enum value for Suit, previously defined by case Clubs | ||
ERROR: DuplicateEnumValue - input.hack:12:14 - Duplicate enum value for Color, previously defined by case Blue | ||
ERROR: DuplicateEnumValue - input.hack:14:14 - Duplicate enum value for Color, previously defined by case Blue |
26 changes: 26 additions & 0 deletions
26
tests/inference/Immutable/writeImmutableDefinedOnTrait/input.hack
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<<Hakana\Immutable>> | ||
trait T { | ||
public int $b; | ||
public function __construct(int $b) { | ||
$this->b = $b; // ok | ||
} | ||
} | ||
|
||
class A { | ||
use T; | ||
|
||
public function mutate() { | ||
$this->b = 5; // gets flagged | ||
} | ||
} | ||
|
||
<<__EntryPoint>> | ||
function main() { | ||
$a = new A(3); | ||
$a->b = 6; // ok | ||
bar($a); | ||
} | ||
|
||
function bar(A $a): void { | ||
$a->b = 7; // gets flagged | ||
} |
2 changes: 2 additions & 0 deletions
2
tests/inference/Immutable/writeImmutableDefinedOnTrait/output.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
ERROR: ImmutablePropertyWrite - input.hack:13:16 - Property A::$b is defined on an immutable class | ||
ERROR: ImmutablePropertyWrite - input.hack:25:9 - Property A::$b is defined on an immutable class |