-
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.
Identify MustUse values passed to await, Asio\join (#16)
* Update README * Add test for unused with Asio\join, await * Detect more unused return values * Mark unused
- Loading branch information
1 parent
1ed5e03
commit 89af83a
Showing
4 changed files
with
72 additions
and
17 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
12 changes: 12 additions & 0 deletions
12
tests/unused/UnusedExpression/unusedFunctionCallAsync/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,12 @@ | ||
<<Hakana\MustUse>> | ||
async function must_use_async(): Awaitable<int> { | ||
return 0; | ||
} | ||
|
||
function foo(): void { | ||
Asio\join(must_use_async()); | ||
} | ||
|
||
function foo_async(): void { | ||
await must_use_async(); | ||
} |
2 changes: 2 additions & 0 deletions
2
tests/unused/UnusedExpression/unusedFunctionCallAsync/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: UnusedFunctionCall - input.hack:7:5 - This function is annotated with MustUse but the returned value is not used | ||
ERROR: UnusedFunctionCall - input.hack:11:5 - This function is annotated with MustUse but the returned value is not used |