diff --git a/crates/cairo-lang-semantic/src/expr/test_data/impl b/crates/cairo-lang-semantic/src/expr/test_data/impl index 2d56056a1ec..badc8707a7c 100644 --- a/crates/cairo-lang-semantic/src/expr/test_data/impl +++ b/crates/cairo-lang-semantic/src/expr/test_data/impl @@ -43,27 +43,7 @@ error: Type not found. fn foo(x: T, y: u8, z: u16) -> T {} ^ -error: Parameter type of impl function `MyImpl::foo` is incompatible with `MyTrait::foo`. Expected: `core::integer::u8`, actual: ``. - --> lib.cairo:7:15 - fn foo(x: T, y: u8, z: u16) -> T {} - ^ - -error: Parameter type of impl function `MyImpl::foo` is incompatible with `MyTrait::foo`. Expected: ``, actual: `core::integer::u8`. - --> lib.cairo:7:21 - fn foo(x: T, y: u8, z: u16) -> T {} - ^^ - error: Parameter type of impl function `MyImpl::foo` is incompatible with `MyTrait::foo`. Expected: `core::integer::u8`, actual: `core::integer::u16`. --> lib.cairo:7:28 fn foo(x: T, y: u8, z: u16) -> T {} ^*^ - -error: Return type of impl function `MyImpl::foo` is incompatible with `MyTrait::foo`. Expected: `core::integer::u8`, actual: ``. - --> lib.cairo:7:36 - fn foo(x: T, y: u8, z: u16) -> T {} - ^ - -error: Return type of impl function `MyImpl::bar` is incompatible with `MyTrait::bar`. Expected: ``, actual: `core::integer::u8`. - --> lib.cairo:8:17 - fn bar() -> u8 { - ^^ diff --git a/crates/cairo-lang-semantic/src/items/imp.rs b/crates/cairo-lang-semantic/src/items/imp.rs index d2978a0804d..1fe599502f7 100644 --- a/crates/cairo-lang-semantic/src/items/imp.rs +++ b/crates/cairo-lang-semantic/src/items/imp.rs @@ -3111,7 +3111,7 @@ fn validate_impl_function_signature( let expected_ty = inference.rewrite(trait_param.ty).no_err(); let actual_ty = inference.rewrite(param.ty).no_err(); - if expected_ty != actual_ty { + if expected_ty != actual_ty && !expected_ty.is_missing(db) && !actual_ty.is_missing(db) { diagnostics.report( &extract_matches!( signature_syntax.parameters(syntax_db).elements(syntax_db)[idx] @@ -3167,7 +3167,7 @@ fn validate_impl_function_signature( let expected_ty = inference.rewrite(concrete_trait_signature.return_type).no_err(); let actual_ty = inference.rewrite(signature.return_type).no_err(); - if expected_ty != actual_ty { + if expected_ty != actual_ty && !expected_ty.is_missing(db) && !actual_ty.is_missing(db) { let location_ptr = match signature_syntax.ret_ty(syntax_db) { OptionReturnTypeClause::ReturnTypeClause(ret_ty) => { ret_ty.ty(syntax_db).as_syntax_node()