summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/hir_typeck/expr_check.cpp5
-rw-r--r--src/hir_typeck/expr_cs.cpp5
2 files changed, 8 insertions, 2 deletions
diff --git a/src/hir_typeck/expr_check.cpp b/src/hir_typeck/expr_check.cpp
index d0b2a21b..4af51aa6 100644
--- a/src/hir_typeck/expr_check.cpp
+++ b/src/hir_typeck/expr_check.cpp
@@ -914,7 +914,10 @@ namespace {
}
TU_MATCH( ::HIR::TraitValueItem, (it->second), (ie),
(Constant,
- TODO(sp, "Monomorpise associated constant type - " << ie.m_type);
+ auto cb = monomorphise_type_get_cb(sp, &*e.type, &e.trait.m_params, nullptr);
+ ::HIR::TypeRef tmp;
+ const auto& ty = ( monomorphise_type_needed(ie.m_type) ? tmp = monomorphise_type_with(sp, ie.m_type, cb) : ie.m_type );
+ check_types_equal(sp, node.m_res_type, ty);
),
(Static,
TODO(sp, "Monomorpise associated static type - " << ie.m_type);
diff --git a/src/hir_typeck/expr_cs.cpp b/src/hir_typeck/expr_cs.cpp
index c6d15a21..0a9b913f 100644
--- a/src/hir_typeck/expr_cs.cpp
+++ b/src/hir_typeck/expr_cs.cpp
@@ -1508,7 +1508,10 @@ namespace {
}
TU_MATCH( ::HIR::TraitValueItem, (it->second), (ie),
(Constant,
- TODO(sp, "Monomorpise associated constant type - " << ie.m_type);
+ auto cb = monomorphise_type_get_cb(sp, &*e.type, &e.trait.m_params, nullptr);
+ ::HIR::TypeRef tmp;
+ const auto& ty = ( monomorphise_type_needed(ie.m_type) ? tmp = monomorphise_type_with(sp, ie.m_type, cb) : ie.m_type );
+ this->context.equate_types(sp, node.m_res_type, ty);
),
(Static,
TODO(sp, "Monomorpise associated static type - " << ie.m_type);