Skip to content

Commit

Permalink
Add edited tests to dig deeper into differences between V1 and V2 tes…
Browse files Browse the repository at this point in the history
…t outputs
  • Loading branch information
brmataptos committed Sep 17, 2024
1 parent 3f3b1d3 commit 7ddf345
Show file tree
Hide file tree
Showing 8 changed files with 108 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// -- Model dump before bytecode pipeline
module 0x42::M {
public fun get_x(): u64 {
false
}
public fun get_y(): u64 {
false
}
} // end 0x42::M
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
address 0x42 {
module M {
const X: u64 = Y;
const Y: u64 = X;
const Z: u64 = 0;

public fun get_x(): u64 {
X
}

public fun get_y(): u64 {
Y
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

Diagnostics:
warning: unused alias
┌─ tests/more-v1/expansion/use_nested_self_as_invalid2.move:8:26
8 │ use 0x2::X::{Self as B, foo, S};
│ ^ Unused 'use' of alias 'B'. Consider removing it

error: variants not allowed in this context
┌─ tests/more-v1/expansion/use_nested_self_as_invalid2.move:10:19
10 │ struct X { f: X::S, f2: S }
│ ^^^^
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
address 0x2 {
module X {
struct S {}
public fun foo() {}
}

module M {
use 0x2::X::{Self as B, foo, S};

struct X { f: X::S, f2: S }
fun bar() {
// X::foo();
foo()
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
warning[W09001]: unused alias
┌─ tests/move_check/expansion/use_nested_self_as_invalid2.move:8:26
8 │ use 0x2::X::{Self as B, foo, S};
│ ^ Unused 'use' of alias 'B'. Consider removing it

error[E03002]: unbound module
┌─ tests/move_check/expansion/use_nested_self_as_invalid2.move:10:19
10 │ struct X { f: X::S, f2: S }
│ ^ Unbound module or type alias 'X'

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
address 0x2 {
module X {
struct S {}
public fun foo() {}
}

module M {
use 0x2::X::{Self as B, foo, S};

struct X { f: X::S, f2: S }
fun bar() {
// X::foo();
foo()
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
error[E04013]: invalid statement or expression in constant
┌─ tests/move_check/typing/recursive_constant.move:3:20
3 │ const X: u64 = Y;
│ ^ Other constants are not supported in constants

error[E04013]: invalid statement or expression in constant
┌─ tests/move_check/typing/recursive_constant.move:4:20
4 │ const Y: u64 = X;
│ ^ Other constants are not supported in constants

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
address 0x42 {
module M {
const X: u64 = Y;
const Y: u64 = X;
const Z: u64 = 0;

public fun get_x(): u64 {
X
}

public fun get_y(): u64 {
Y
}
}
}

0 comments on commit 7ddf345

Please sign in to comment.