diff options
author | Nadrieril | 2019-08-20 14:12:27 +0200 |
---|---|---|
committer | Nadrieril | 2019-08-20 14:13:07 +0200 |
commit | 38a82c53ef45e802cf5816a8afcbf36a69c91174 (patch) | |
tree | 1ef679ca246435db2c3d3d6c3cf6bc0cc20674e0 /dhall/src/core | |
parent | 9470664a5e481c63fd96939e7b8986b8fe881dbe (diff) |
Clarify conversion of Const/Builtin to Value
Diffstat (limited to 'dhall/src/core')
-rw-r--r-- | dhall/src/core/value.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/dhall/src/core/value.rs b/dhall/src/core/value.rs index 0af7c8c..5367c86 100644 --- a/dhall/src/core/value.rs +++ b/dhall/src/core/value.rs @@ -9,7 +9,7 @@ use crate::core::valuef::ValueF; use crate::core::var::{AlphaVar, Shift, Subst}; use crate::error::{TypeError, TypeMessage}; use crate::phase::normalize::{apply_any, normalize_whnf, OutputSubExpr}; -use crate::phase::typecheck::type_of_const; +use crate::phase::typecheck::const_to_value; use crate::phase::{NormalizedSubExpr, Typed}; #[derive(Debug, Clone, Copy)] @@ -110,10 +110,7 @@ impl Value { Value::from_valuef_and_type(v, Value::from_const(Const::Type)) } pub(crate) fn from_const(c: Const) -> Self { - match type_of_const(c) { - Ok(t) => Value::from_valuef_and_type(ValueF::Const(c), t), - Err(_) => Value::from_valuef_untyped(ValueF::Const(c)), - } + const_to_value(c) } pub fn const_type() -> Self { Value::from_const(Const::Type) |