summaryrefslogtreecommitdiff
path: root/dhall/src/traits
diff options
context:
space:
mode:
authorNadrieril2019-04-22 23:31:42 +0200
committerNadrieril2019-04-22 23:31:42 +0200
commit60df4ed07a752d256888e6b4449a48bfa43cf79f (patch)
tree16fcd64f6d255f4391477bb9af57b745e8efb82e /dhall/src/traits
parent53f886c0f5044e4bfe7de756b8c47d992f91b03e (diff)
Temporarily simplify functions depending on TypeInternal
Diffstat (limited to 'dhall/src/traits')
-rw-r--r--dhall/src/traits/dynamic_type.rs21
1 files changed, 12 insertions, 9 deletions
diff --git a/dhall/src/traits/dynamic_type.rs b/dhall/src/traits/dynamic_type.rs
index 479bed6..3b34363 100644
--- a/dhall/src/traits/dynamic_type.rs
+++ b/dhall/src/traits/dynamic_type.rs
@@ -18,15 +18,18 @@ impl<T: StaticType> DynamicType for T {
impl<'a> DynamicType for Type<'a> {
fn get_type(&self) -> Result<Cow<'_, Type<'static>>, TypeError> {
- match &self.0 {
- TypeInternal::Expr(e) => e.get_type(),
- TypeInternal::Const(c) => Ok(Cow::Owned(type_of_const(*c))),
- TypeInternal::SuperType => Err(TypeError::new(
- &TypecheckContext::new(),
- dhall_core::rc(ExprF::Const(Const::Sort)),
- TypeMessage::Untyped,
- )),
- }
+ Ok(Cow::Owned(
+ self.clone().into_normalized()?.get_type()?.into_owned(),
+ ))
+ // match &self.0 {
+ // TypeInternal::Expr(e) => e.get_type(),
+ // TypeInternal::Const(c) => Ok(Cow::Owned(type_of_const(*c))),
+ // TypeInternal::SuperType => Err(TypeError::new(
+ // &TypecheckContext::new(),
+ // dhall_core::rc(ExprF::Const(Const::Sort)),
+ // TypeMessage::Untyped,
+ // )),
+ // }
}
}