summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Notes/Quirks.md4
-rw-r--r--src/hir_typeck/expr_cs.cpp2
2 files changed, 6 insertions, 0 deletions
diff --git a/Notes/Quirks.md b/Notes/Quirks.md
index 2b0705a9..d3b7839d 100644
--- a/Notes/Quirks.md
+++ b/Notes/Quirks.md
@@ -52,5 +52,9 @@ The "base" value of a struct literal isn't always moved
Binops are coercion points
==========================
+- This only really shows up with some edge cases where the RHS is inferred
+Casts can act as coercions
+==========================
+- E.g. `None as Option<Span>` is perfectly valid, and is the same as `None::<Span>`
diff --git a/src/hir_typeck/expr_cs.cpp b/src/hir_typeck/expr_cs.cpp
index 97b5ae72..0db9c744 100644
--- a/src/hir_typeck/expr_cs.cpp
+++ b/src/hir_typeck/expr_cs.cpp
@@ -2022,6 +2022,7 @@ namespace {
this->m_completed = true;
),
(Path,
+ #if 0
TU_MATCHA( (e.binding), (be),
(Unbound,
BUG(sp, "Encountered unbound type in _Cast Path - " << tgt_ty);
@@ -2043,6 +2044,7 @@ namespace {
ERROR(sp, E0000, "Non-scalar cast to " << this->context.m_ivars.fmt_type(tgt_ty));
)
)
+ #endif
this->context.equate_types_coerce(sp, tgt_ty, node.m_value);
this->m_completed = true;
return ;