summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/hir_conv/bind.cpp2
-rw-r--r--src/resolve/absolute.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/hir_conv/bind.cpp b/src/hir_conv/bind.cpp
index d9527ccd..18e97a72 100644
--- a/src/hir_conv/bind.cpp
+++ b/src/hir_conv/bind.cpp
@@ -210,7 +210,7 @@ namespace {
// Unit-like struct match or a constant
TU_MATCH_DEF( ::HIR::ValueItem, (it->second->ent), (e2),
(
- ERROR(sp, E0000, "Value pattern pointing to unexpected type")
+ ERROR(sp, E0000, "Value pattern " << pat << " pointing to unexpected item type - " << it->second->ent.tag_str())
),
(Constant,
// Store reference to this item for later use
diff --git a/src/resolve/absolute.cpp b/src/resolve/absolute.cpp
index 01b18c00..a47350b4 100644
--- a/src/resolve/absolute.cpp
+++ b/src/resolve/absolute.cpp
@@ -1682,9 +1682,9 @@ void Resolve_Absolute_Pattern(Context& context, bool allow_refutable, ::AST::Pa
if( allow_refutable ) {
auto name = mv$( e.name );
// Attempt to resolve the name in the current namespace, and if it fails, it's a binding
- auto p = context.lookup_opt( name, Context::LookupMode::Constant );
+ auto p = context.lookup_opt( name, Context::LookupMode::Pattern );
if( p.is_valid() ) {
- Resolve_Absolute_Path(context, pat.span(), Context::LookupMode::Constant, p);
+ Resolve_Absolute_Path(context, pat.span(), Context::LookupMode::Pattern, p);
pat = ::AST::Pattern(::AST::Pattern::TagValue(), ::AST::Pattern::Value::make_Named(mv$(p)));
DEBUG("MaybeBind resolved to " << pat);
}