-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Zekun Wang
committed
Jun 6, 2024
1 parent
35d8327
commit a01899e
Showing
17 changed files
with
464 additions
and
305 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
299 changes: 0 additions & 299 deletions
299
third_party/move/move-compiler-v2/tests/unused-assignment/unused_assignment.exp
This file was deleted.
Oops, something went wrong.
57 changes: 57 additions & 0 deletions
57
third_party/move/move-compiler-v2/tests/unused-assignment/unused_call_assign_shadow.exp
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,57 @@ | ||
|
||
Diagnostics: | ||
warning: Unused parameter `a`. Consider removing or prefixing with an underscore: `_a` | ||
┌─ tests/unused-assignment/unused_call_assign_shadow.move:2:13 | ||
│ | ||
2 │ fun foo(a: u8, _b: u8) { | ||
│ ^ | ||
|
||
warning: Unused local variable `y`. Consider removing or prefixing with an underscore: `_y` | ||
┌─ tests/unused-assignment/unused_call_assign_shadow.move:5:13 | ||
│ | ||
5 │ let y = 0; | ||
│ ^ | ||
|
||
warning: Unused local variable `w`. Consider removing or prefixing with an underscore: `_w` | ||
┌─ tests/unused-assignment/unused_call_assign_shadow.move:8:13 | ||
│ | ||
8 │ let w = bar(false); | ||
│ ^ | ||
|
||
warning: Unused local variable `x`. Consider removing or prefixing with an underscore: `_x` | ||
┌─ tests/unused-assignment/unused_call_assign_shadow.move:22:13 | ||
│ | ||
22 │ let x = 0; | ||
│ ^ | ||
|
||
warning: Unused local variable `x`. Consider removing or prefixing with an underscore: `_x` | ||
┌─ tests/unused-assignment/unused_call_assign_shadow.move:24:13 | ||
│ | ||
24 │ let x = 1; | ||
│ ^ | ||
|
||
|
||
Diagnostics: | ||
warning: Unused assignment to `x`. Consider removing or prefixing with an underscore: `_x` | ||
┌─ tests/unused-assignment/unused_call_assign_shadow.move:4:9 | ||
│ | ||
4 │ x = x + 1; | ||
│ ^^^^^^^^^ | ||
|
||
warning: Unused assignment to `w`. Consider removing or prefixing with an underscore: `_w` | ||
┌─ tests/unused-assignment/unused_call_assign_shadow.move:8:17 | ||
│ | ||
8 │ let w = bar(false); | ||
│ ^^^^^^^^^^ | ||
|
||
warning: Unused assignment to `y`. Consider removing or prefixing with an underscore: `_y` | ||
┌─ tests/unused-assignment/unused_call_assign_shadow.move:14:13 | ||
│ | ||
14 │ y = y + 1; | ||
│ ^^^^^^^^^ | ||
|
||
warning: Unused assignment to `y`. Consider removing or prefixing with an underscore: `_y` | ||
┌─ tests/unused-assignment/unused_call_assign_shadow.move:16:13 | ||
│ | ||
16 │ y = y + 2; | ||
│ ^^^^^^^^^ |
26 changes: 26 additions & 0 deletions
26
third_party/move/move-compiler-v2/tests/unused-assignment/unused_call_assign_shadow.move
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 @@ | ||
module 0x42::test { | ||
fun foo(a: u8, _b: u8) { | ||
let x = 0; | ||
x = x + 1; | ||
let y = 0; | ||
let _z = 42; | ||
// unused call assignment | ||
let w = bar(false); | ||
} | ||
|
||
fun bar(x: bool): u8 { | ||
let y = 0; | ||
if (x) { | ||
y = y + 1; | ||
} else { | ||
y = y + 2; | ||
}; | ||
42 | ||
} | ||
|
||
fun baz() { | ||
let x = 0; | ||
// shadowing | ||
let x = 1; | ||
} | ||
} |
Oops, something went wrong.