Skip to content

Commit

Permalink
Merge branch 'master' into mut-immutable-composite-types
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaBatty authored Aug 15, 2024
2 parents 2b8515c + 798c0e2 commit 132b79c
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sway-core/src/semantic_analysis/node_dependencies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,7 @@ fn decl_name(engines: &Engines, decl: &Declaration) -> Option<DependentSymbol> {
}
})
.collect::<Vec<String>>()
.join(""),
.join(","),
)
} else if decl.trait_name.prefixes.is_empty() {
impl_sym(
Expand All @@ -986,7 +986,7 @@ fn decl_name(engines: &Engines, decl: &Declaration) -> Option<DependentSymbol> {
}
})
.collect::<Vec<_>>()
.join(""),
.join(","),
)
} else {
None
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
out
target
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[[package]]
name = "core"
source = "path+from-root-0C133FB33C94FAC1"

[[package]]
name = "impl_self_dependency_order_conflict"
source = "member"
dependencies = ["std"]

[[package]]
name = "std"
source = "path+from-root-0C133FB33C94FAC1"
dependencies = ["core"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[project]
entry = "main.sw"
authors = ["Fuel Labs <contact@fuel.sh>"]
license = "Apache-2.0"
name = "impl_self_dependency_order_conflict"

[dependencies]
std = { path = "../../../reduced_std_libs/sway-lib-std-assert" }
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
library;

pub fn foo() -> u32 {
1
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
library;

mod foo;
use foo::*;

struct S {}

impl S { //dependency of this impl is overwritten by the next impl
fn a() -> u32 { foo() }
fn b() {}
}

impl S { //this will overwrite the dependency for the previous impl
fn ab() {}
}

fn foo() -> u32 {
2
}

fn main() {}

#[test]
fn test() {
assert_eq(2, S::a());
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
category = "unit_tests_pass"

0 comments on commit 132b79c

Please sign in to comment.