Skip to content

Commit

Permalink
Adds tests that cover #418.
Browse files Browse the repository at this point in the history
  • Loading branch information
esdrubal committed Feb 1, 2023
1 parent 0caaf2e commit 61fe4dd
Show file tree
Hide file tree
Showing 14 changed files with 122 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[[package]]
name = 'core'
source = 'path+from-root-7683E8E5A9EFF30D'

[[package]]
name = 'multiple_enums_with_the_same_name'
source = 'member'
dependencies = ['core']
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[project]
authors = ["Fuel Labs <contact@fuel.sh>"]
license = "Apache-2.0"
name = "multiple_enums_with_the_same_name"
entry = "main.sw"
implicit-std = false

[dependencies]
core = { path = "../../../../../../sway-lib-core" }
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[
{
"attributes": null,
"inputs": [],
"name": "main",
"outputs": [
{
"components": null,
"name": "",
"type": "u32",
"typeArguments": null
}
],
"type": "function"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
script;

dep module0;
dep module1;

fn main() {
let mut x = module0::MyEnum::A;
let y = module1::MyEnum::A;
x = y;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
library module0;

pub enum MyEnum {
A: ()
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
library module1;

pub enum MyEnum {
A: ()
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
category = "fail"

# check: $()x = y;
# nextln: $()Mismatched types.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[[package]]
name = 'core'
source = 'path+from-root-1918441B04275B9A'

[[package]]
name = 'multiple_structs_with_the_same_name'
source = 'member'
dependencies = ['core']
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[project]
authors = ["Fuel Labs <contact@fuel.sh>"]
license = "Apache-2.0"
name = "multiple_structs_with_the_same_name"
entry = "main.sw"
implicit-std = false

[dependencies]
core = { path = "../../../../../../sway-lib-core" }
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[
{
"attributes": null,
"inputs": [],
"name": "main",
"outputs": [
{
"components": null,
"name": "",
"type": "u32",
"typeArguments": null
}
],
"type": "function"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
script;

dep module0;
dep module1;

fn main() {
let mut x = module0::Thing::new();
let y = module1::Thing::new();
x = y;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
library module0;

pub struct Thing {}

impl Thing {
pub fn new() -> Self {
Thing {}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
library module1;

pub struct Thing {}

impl Thing {
pub fn new() -> Self {
Thing {}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
category = "fail"

# check: $()x = y;
# nextln: $()Mismatched types.

0 comments on commit 61fe4dd

Please sign in to comment.