Method: Dhall::TypeChecker.assert_type
- Defined in:
- lib/dhall/typecheck.rb
.assert_type(expr, assertion, message, context:) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/dhall/typecheck.rb', line 13 def self.assert_type(expr, assertion, , context:) aexpr = self.for(expr).annotate(context) type = aexpr.type.normalize raise TypeError, "#{}: #{type}" unless assertion === type aexpr end |