-
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
1 parent
cead217
commit 42421fe
Showing
33 changed files
with
6,417 additions
and
651 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
36 changes: 36 additions & 0 deletions
36
third_party/move/move-compiler-v2/tests/checking/inlining/function_name_shadowing.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,36 @@ | ||
|
||
Diagnostics: | ||
warning: Unused parameter `f`. Consider removing or prefixing with an underscore: `_f` | ||
┌─ tests/checking/inlining/function_name_shadowing.move:8:28 | ||
│ | ||
8 │ public inline fun quux(f:|u64, u64|u64, a: u64, b: u64): u64 { | ||
│ ^ | ||
|
||
// -- Model dump before bytecode pipeline | ||
module 0x42::Test { | ||
public fun f(a: u64,b: u64): u64 { | ||
Mul<u64>(a, b) | ||
} | ||
public inline fun quux(f: |(u64, u64)|u64,a: u64,b: u64): u64 { | ||
Test::f(a, b) | ||
} | ||
public fun test_shadowing(): u64 { | ||
Test::f(10, 2) | ||
} | ||
} // end 0x42::Test | ||
|
||
// -- Sourcified model before bytecode pipeline | ||
module 0x42::Test { | ||
public fun f(a: u64, b: u64): u64 { | ||
a * b | ||
} | ||
public inline fun quux(f: |(u64, u64)|u64, a: u64, b: u64): u64 { | ||
f(a, b) | ||
} | ||
public fun test_shadowing(): u64 { | ||
f(10, 2) | ||
} | ||
} | ||
|
||
|
||
============ bytecode verification succeeded ======== |
17 changes: 17 additions & 0 deletions
17
third_party/move/move-compiler-v2/tests/checking/inlining/function_name_shadowing.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,17 @@ | ||
//# publish | ||
module 0x42::Test { | ||
|
||
public fun f(a: u64, b: u64): u64 { | ||
a * b | ||
} | ||
|
||
public inline fun quux(f:|u64, u64|u64, a: u64, b: u64): u64 { | ||
f(a, b) | ||
} | ||
|
||
public fun test_shadowing(): u64 { | ||
quux(|a, b| a - b, 10, 2) | ||
} | ||
} | ||
|
||
//# run 0x42::Test::test_shadowing |
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
Oops, something went wrong.