From 592e3e649c6aee8422799c80418f7bf9904bc472 Mon Sep 17 00:00:00 2001 From: Abhinav Srivastava Date: Tue, 13 Feb 2024 21:07:56 -0500 Subject: [PATCH] Fix errors in Mapping::find_match --- sway-core/src/decl_engine/mapping.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sway-core/src/decl_engine/mapping.rs b/sway-core/src/decl_engine/mapping.rs index ca6e6baed81..ac29c2a89c7 100644 --- a/sway-core/src/decl_engine/mapping.rs +++ b/sway-core/src/decl_engine/mapping.rs @@ -153,9 +153,10 @@ impl DeclMapping { } // At most one replacement should be found for decl_ref. - /* TODO uncomment this and close issue #5540 + use sway_error::{error::CompileError}; + if dest_decl_refs.len() > 1 { - handler.emit_err(CompileError::InternalOwned( + _handler.emit_err(CompileError::InternalOwned( format!( "Multiple replacements for decl {} implemented in {}", engines.help_out(decl_ref), @@ -163,7 +164,7 @@ impl DeclMapping { ), dest_decl_refs.iter().last().unwrap().span(engines), )); - }*/ + } Ok(dest_decl_refs.iter().next().cloned()) } }