From 0be9e8909f4b69480de1476c9782f2a813a67632 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Wed, 17 Jan 2024 21:58:58 +0800 Subject: [PATCH] Typecheck Expressions - Allow more bound impls to be considered --- src/hir_typeck/helpers.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/hir_typeck/helpers.cpp b/src/hir_typeck/helpers.cpp index 6589d513..de812c89 100644 --- a/src/hir_typeck/helpers.cpp +++ b/src/hir_typeck/helpers.cpp @@ -2642,7 +2642,10 @@ bool TraitResolution::find_trait_impls_bound(const Span& sp, const ::HIR::Simple assoc_info = e->path.m_data.opt_UfcsKnown(); } - if(type.data().is_Infer()) { + // If the type is a fully unknown type, then don't bother looking? + // - Ah, but what if the prams provide sufficient information? + // - TODO: Determine if the params could provide enough info to be worth checking for bounds. + if(type.data().is_Infer() && !type.data().as_Infer().is_lit()) { return false; }