Class: Dhall::TypeChecker::AnonymousType
- Inherits:
-
Object
- Object
- Dhall::TypeChecker::AnonymousType
- Defined in:
- lib/dhall/typecheck.rb
Direct Known Subclasses
Instance Method Summary collapse
- #annotate(context) ⇒ Object
-
#initialize(type) ⇒ AnonymousType
constructor
A new instance of AnonymousType.
Constructor Details
#initialize(type) ⇒ AnonymousType
Returns a new instance of AnonymousType.
505 506 507 |
# File 'lib/dhall/typecheck.rb', line 505 def initialize(type) @type = type end |
Instance Method Details
#annotate(context) ⇒ Object
509 510 511 512 513 |
# File 'lib/dhall/typecheck.rb', line 509 def annotate(context) kinds = check(context) type = kinds.max_by { |k| KINDS.index(k) } || KINDS.first Dhall::TypeAnnotation.new(value: @type, type: type) end |