class T::Types::ClassOf

Validates that an object belongs to the specified class.

def [](*types)

the other methods to appear (`T.class_of(A).type_member` doesn't make sense)
We avoid simply writing `include T::Generic` because we don't want any of

Mirrors the definition of T::Generic#[] (generics are erased).
So that `T.class_of(...)[...]` syntax is valid.
def [](*types)
  self
end

def describe_obj(obj)

overrides Base
def describe_obj(obj)
  obj.inspect
end

def initialize(type)

def initialize(type)
  @type = type
end

def name

overrides Base
def name
  "T.class_of(#{@type})"
end

def subtype_of_single?(other)

overrides Base
def subtype_of_single?(other)
  case other
  when ClassOf
    @type <= other.type
  when Simple
    @type.is_a?(other.raw_type)
  when TypedClass
    true
  else
    false
  end
end

def valid?(obj)

overrides Base
def valid?(obj)
  obj.is_a?(Module) && obj <= @type
end