From ba26169d47d42a8f50d30f29f699edb61a4b3759 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Tue, 16 Apr 2019 18:03:12 +0200 Subject: Remove higher-kinded type noise in Type --- dhall/src/traits/dynamic_type.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'dhall/src/traits') diff --git a/dhall/src/traits/dynamic_type.rs b/dhall/src/traits/dynamic_type.rs index 28ed76d..d2a5414 100644 --- a/dhall/src/traits/dynamic_type.rs +++ b/dhall/src/traits/dynamic_type.rs @@ -1,6 +1,6 @@ use crate::expr::*; use crate::traits::StaticType; -use crate::typecheck::{TypeError, TypeMessage}; +use crate::typecheck::{type_of_const, TypeError, TypeMessage}; use dhall_core::context::Context; use dhall_core::{Const, ExprF}; use std::borrow::Cow; @@ -17,10 +17,10 @@ impl DynamicType for T { impl<'a> DynamicType for Type<'a> { fn get_type(&self) -> Result>, TypeError> { - use TypeInternal::*; match &self.0 { - Expr(e) => e.get_type(), - SuperType => Err(TypeError::new( + TypeInternal::Expr(e) => e.get_type(), + TypeInternal::Const(c) => Ok(Cow::Owned(type_of_const(*c))), + TypeInternal::SuperType => Err(TypeError::new( &Context::new(), dhall_core::rc(ExprF::Const(Const::Sort)), TypeMessage::Untyped, -- cgit v1.2.3