Add back a type in linker that I thought unnecessary

This commit is contained in:
Sofia 2025-08-07 21:40:57 +03:00
parent ce2473a715
commit 0e23ab4636
3 changed files with 23 additions and 3 deletions

10
examples/a1.reid Normal file
View File

@ -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;
}

12
examples/a2.reid Normal file
View File

@ -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) {}
}

View File

@ -686,9 +686,7 @@ fn resolve_types_recursively(
return Err(ErrorKind::CyclicalType(type_key.0.clone())); 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()); seen.insert(resolved_ty.clone());
let resolved = modules let resolved = modules