Sha256: 2ec78d862859e5590dfbf6be652b7bf0ec18a7a20e5c1fd88e6442ff696ab878

Contents?: true

Size: 763 Bytes

Versions: 13

Compression:

Stored size: 763 Bytes

Contents

module Steep
  module AST
    module Types
      class Instance
        attr_reader :location

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

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

        def hash
          self.class.hash
        end

        alias eql? ==

        def subst(s)
          s.instance_type or raise "Unexpected substitution: #{inspect}"
        end

        def free_variables()
          @fvs = Set.new([self])
        end

        include Helper::NoChild

        def to_s
          "instance"
        end

        def level
          [0]
        end

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

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
steep-1.1.1 lib/steep/ast/types/instance.rb
steep-1.1.0 lib/steep/ast/types/instance.rb
steep-1.1.0.pre.1 lib/steep/ast/types/instance.rb
steep-1.0.2 lib/steep/ast/types/instance.rb
steep-1.0.1 lib/steep/ast/types/instance.rb
steep-1.0.0 lib/steep/ast/types/instance.rb
steep-0.52.2 lib/steep/ast/types/instance.rb
steep-0.52.1 lib/steep/ast/types/instance.rb
steep-0.52.0 lib/steep/ast/types/instance.rb
steep-0.51.0 lib/steep/ast/types/instance.rb
steep-0.50.0 lib/steep/ast/types/instance.rb
steep-0.49.1 lib/steep/ast/types/instance.rb
steep-0.49.0 lib/steep/ast/types/instance.rb