Sha256: af24bfb422e2d5d5a1613e3a5e9c3e22b9580463d5df4aeb8790e92a67473057

Contents?: true

Size: 861 Bytes

Versions: 31

Compression:

Stored size: 861 Bytes

Contents

module Steep
  module AST
    module Types
      class Class
        attr_reader :location

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

        def self.instance
          @instance ||= new()
        end

        def to_s
          "class"
        end

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

        def hash
          self.class.hash
        end

        alias eql? ==

        def subst(s)
          if s.module_type
            s.module_type
          else
            self
          end
        end

        @@fvs = Set[instance]

        def free_variables
          @@fvs
        end

        include Helper::NoChild

        def level
          [0]
        end

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

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
steep-1.5.0.pre.2 lib/steep/ast/types/class.rb
steep-1.5.0.pre.1 lib/steep/ast/types/class.rb
steep-1.4.0 lib/steep/ast/types/class.rb
steep-1.4.0.dev.5 lib/steep/ast/types/class.rb
steep-1.4.0.dev.4 lib/steep/ast/types/class.rb
steep-1.4.0.dev.3 lib/steep/ast/types/class.rb
steep-1.3.2 lib/steep/ast/types/class.rb
steep-1.3.1 lib/steep/ast/types/class.rb
steep-1.4.0.dev.2 lib/steep/ast/types/class.rb
steep-1.4.0.dev.1 lib/steep/ast/types/class.rb
steep-1.3.0 lib/steep/ast/types/class.rb