diff --git a/examples/a1.reid b/examples/a1.reid new file mode 100644 index 0000000..ef8203f --- /dev/null +++ b/examples/a1.reid @@ -0,0 +1,10 @@ +import a2::Foo; +import a2::A; +import a2::AResult; + +fn main() -> i32 { + let foo = Foo {}; + let a = A::new(); + foo.foo(&a.a); + return 0; +} diff --git a/examples/a2.reid b/examples/a2.reid new file mode 100644 index 0000000..9dad62c --- /dev/null +++ b/examples/a2.reid @@ -0,0 +1,12 @@ +struct A {} +struct AResult { a: A } +impl A { + pub fn new() -> AResult { + AResult { a: A {} } + } +} + +struct Foo {} +impl Foo { + pub fn foo(&self, a: &A) {} +} \ No newline at end of file diff --git a/reid/src/mir/linker.rs b/reid/src/mir/linker.rs index ce4b7d8..4cb6068 100644 --- a/reid/src/mir/linker.rs +++ b/reid/src/mir/linker.rs @@ -686,9 +686,7 @@ fn resolve_types_recursively( return Err(ErrorKind::CyclicalType(type_key.0.clone())); } - if type_key.1 != resolved_ty.1 { - types.insert(type_key.clone(), resolved_ty.1); - } + types.insert(type_key.clone(), resolved_ty.1); seen.insert(resolved_ty.clone()); let resolved = modules