Sha256: 17de4ec88414ca1844f17e65733e1cc88be54106376f59e34f8cc707be80b626

Contents?: true

Size: 937 Bytes

Versions: 49

Compression:

Stored size: 937 Bytes

Contents

module Steep
  module AST
    module Types
      class Boolean
        attr_reader :location

        def initialize(location: nil)
          @location = location
        end

        def ==(other)
          other.is_a?(Boolean)
        end

        def hash
          self.class.hash
        end

        alias eql? ==

        def subst(s)
          self
        end

        def to_s
          "bool"
        end

        include Helper::NoFreeVariables

        include Helper::NoChild

        def level
          [0]
        end

        def with_location(new_location)
          self.class.new(location: new_location)
        end

        def back_type
          Union.build(types:
                      [
                        Builtin::TrueClass.instance_type,
                        Builtin::FalseClass.instance_type
                      ],
                      location: location)
        end
      end
    end
  end
end

Version data entries

49 entries across 49 versions & 1 rubygems

Version Path
steep-1.8.0.dev.2 lib/steep/ast/types/boolean.rb
steep-1.8.0.dev.1 lib/steep/ast/types/boolean.rb
steep-1.7.1 lib/steep/ast/types/boolean.rb
steep-1.7.0 lib/steep/ast/types/boolean.rb
steep-1.7.0.dev.3 lib/steep/ast/types/boolean.rb
steep-1.7.0.dev.2 lib/steep/ast/types/boolean.rb
steep-1.7.0.dev.1 lib/steep/ast/types/boolean.rb
steep-1.6.0 lib/steep/ast/types/boolean.rb
steep-1.6.0.pre.4 lib/steep/ast/types/boolean.rb
steep-1.6.0.pre.3 lib/steep/ast/types/boolean.rb
steep-1.6.0.pre.2 lib/steep/ast/types/boolean.rb
steep-1.6.0.pre.1 lib/steep/ast/types/boolean.rb
steep-1.5.3 lib/steep/ast/types/boolean.rb
steep-1.5.2 lib/steep/ast/types/boolean.rb
steep-1.5.1 lib/steep/ast/types/boolean.rb
steep-1.5.0 lib/steep/ast/types/boolean.rb
steep-1.5.0.pre.6 lib/steep/ast/types/boolean.rb
steep-1.5.0.pre.5 lib/steep/ast/types/boolean.rb
steep-1.5.0.pre.4 lib/steep/ast/types/boolean.rb
steep-1.5.0.pre.3 lib/steep/ast/types/boolean.rb