class T::Types::TypeVariable
provides some syntax for the static type checker
Since we do type erasure at runtime, this just validates the variance and
def initialize(variance)
def initialize(variance) case variance when Hash then raise ArgumentError.new("Pass bounds using a block. Got: #{variance}") when *VALID_VARIANCES then nil else raise TypeError.new("invalid variance #{variance}") end @variance = variance end
def name
def name Untyped.new.name end
def subtype_of_single?(type)
def subtype_of_single?(type) true end
def valid?(obj)
def valid?(obj) true end