-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check the illegal type and some types of values in the data_struct.
- Loading branch information
1 parent
e1d222c
commit 44ae271
Showing
13 changed files
with
142 additions
and
4 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
...k-tests/tests/cases/mvir_tests/data_struct/data_struct_invalid_phantom_type_parameter.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,4 @@ | ||
processed 1 task | ||
|
||
task 0 'publish'. lines 1-11: | ||
status ABORTED with code 10016 in 0000000000000000000000000000000000000000000000000000000000000002::move_module |
11 changes: 11 additions & 0 deletions
11
...-tests/tests/cases/mvir_tests/data_struct/data_struct_invalid_phantom_type_parameter.mvir
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,11 @@ | ||
//# publish | ||
module 0x11.TestModule1 { | ||
// error code 10016: INVALID_DATA_STRUCT_WITH_TYPE_PARAMETER | ||
struct S1<phantom T> has drop,copy {v: u32} | ||
|
||
metadata { | ||
data_struct { | ||
0x11::TestModule1::S1 -> true; | ||
} | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
...framework-tests/tests/cases/mvir_tests/data_struct/data_struct_invalid_type_parameter.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,4 @@ | ||
processed 1 task | ||
|
||
task 0 'publish'. lines 1-11: | ||
status ABORTED with code 10016 in 0000000000000000000000000000000000000000000000000000000000000002::move_module |
11 changes: 11 additions & 0 deletions
11
...ramework-tests/tests/cases/mvir_tests/data_struct/data_struct_invalid_type_parameter.mvir
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,11 @@ | ||
//# publish | ||
module 0x11.TestModule1 { | ||
// error code 10016: INVALID_DATA_STRUCT_WITH_TYPE_PARAMETER | ||
struct S1<T> has drop,copy {v: u32} | ||
|
||
metadata { | ||
data_struct { | ||
0x11::TestModule1::S1 -> true; | ||
} | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...rk-tests/tests/cases/mvir_tests/data_struct_func/data_struct_func_function_not_exists.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
processed 1 task | ||
|
||
task 0 'publish'. lines 1-14: | ||
status ABORTED with code 10001 in 0000000000000000000000000000000000000000000000000000000000000002::move_module | ||
status ABORTED with code 10018 in 0000000000000000000000000000000000000000000000000000000000000002::move_module |
7 changes: 7 additions & 0 deletions
7
...sts/tests/cases/mvir_tests/data_struct_func/data_struct_func_invalid_empty_parameters.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,7 @@ | ||
processed 2 tasks | ||
|
||
task 0 'publish'. lines 1-15: | ||
status EXECUTED | ||
|
||
task 1 'publish'. lines 17-43: | ||
status ABORTED with code 10018 in 0000000000000000000000000000000000000000000000000000000000000002::move_module |
43 changes: 43 additions & 0 deletions
43
...ts/tests/cases/mvir_tests/data_struct_func/data_struct_func_invalid_empty_parameters.mvir
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,43 @@ | ||
//# publish | ||
module 0x11.TestModule0 { | ||
struct S0 has copy,drop { x: u64 } | ||
|
||
metadata { | ||
data_struct { | ||
0x11::TestModule0::S0 -> true; | ||
} | ||
} | ||
|
||
public new(): Self.S0 { | ||
label b0: | ||
return S0{ x: 123 }; | ||
} | ||
} | ||
|
||
//# publish | ||
module 0x11.TestModule1 { | ||
import 0x11.TestModule0; | ||
metadata { | ||
data_struct_func { | ||
// error code 10018: INVALID_DATA_STRUCT_FUNC_WITH_EMPTY_PARAM_LIST | ||
0x11::TestModule1::f1 -> []; | ||
} | ||
} | ||
|
||
public f1<T1: drop, T2: drop>(arg1: T1, arg2: T2) { | ||
label b0: | ||
_ = move(arg1); | ||
_ = move(arg2); | ||
return; | ||
} | ||
|
||
public f2() { | ||
let s0: TestModule0.S0; | ||
let s1: TestModule0.S0; | ||
label b0: | ||
s0 = TestModule0.new(); | ||
s1 = TestModule0.new(); | ||
Self.f1<TestModule0.S0, TestModule0.S0>(move(s0), move(s1)); | ||
return; | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
...sts/cases/mvir_tests/data_struct_func/data_struct_func_invalid_move_std_option_option.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,4 @@ | ||
processed 1 task | ||
|
||
task 0 'publish'. lines 1-39: | ||
status ABORTED with code 10009 in 0000000000000000000000000000000000000000000000000000000000000002::move_module |
39 changes: 39 additions & 0 deletions
39
...ts/cases/mvir_tests/data_struct_func/data_struct_func_invalid_move_std_option_option.mvir
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,39 @@ | ||
//# publish | ||
module 0x11.TestModule1 { | ||
import 0x1.option; | ||
import 0x1.vector; | ||
struct S0 has copy,drop { x: u64 } | ||
|
||
metadata { | ||
data_struct { | ||
0x11::TestModule1::S0 -> true; | ||
} | ||
data_struct_func { | ||
0x11::TestModule1::f1 -> [0, 1]; | ||
} | ||
} | ||
|
||
public new(): Self.S0 { | ||
label b0: | ||
return S0{ x: 123 }; | ||
} | ||
|
||
public f1<T1: drop, T2: drop>(arg1: T1, arg2: T2) { | ||
label b0: | ||
_ = move(arg1); | ||
_ = move(arg2); | ||
return; | ||
} | ||
|
||
public f2<T: copy+drop>(arg: T) { | ||
let s0: Self.S0; | ||
let s1: option.Option<T>; | ||
|
||
label b0: | ||
s0 = Self.new(); | ||
s1 = option.none<T>(); | ||
// error code 10009: INVALID_DATA_STRUCT_TYPE | ||
Self.f1<Self.S0, option.Option<T>>(move(s0), move(s1)); | ||
return; | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...s/mvir_tests/data_struct_func/data_struct_func_valid_move_std_option_option_as_struct.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
processed 1 task | ||
|
||
task 0 'publish'. lines 1-39: | ||
task 0 'publish'. lines 1-38: | ||
status EXECUTED |
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