From 60df4ed07a752d256888e6b4449a48bfa43cf79f Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Mon, 22 Apr 2019 23:31:42 +0200 Subject: Temporarily simplify functions depending on TypeInternal --- dhall/src/traits/dynamic_type.rs | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'dhall/src/traits') 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 DynamicType for T { impl<'a> DynamicType for Type<'a> { fn get_type(&self) -> Result>, 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, + // )), + // } } } -- cgit v1.2.3