Sha256: 81a367dc6c7c4053aec923f797a23d2b7b440ce0931662c0e16f22396e41569a

Contents?: true

Size: 770 Bytes

Versions: 237

Compression:

Stored size: 770 Bytes

Contents

# frozen_string_literal: true
# typed: true

# A marking class for when methods return void.
# Should never appear in types directly.
class T::Private::Types::Void < T::Types::Base
  ERROR_MESSAGE = "Validation is being done on an `Void`. Please report this bug at https://github.com/sorbet/sorbet/issues"

  # The actual return value of `.void` methods.
  #
  # Uses `module VOID` because this gives it a readable name when someone
  # examines it in Pry or with `#inspect` like:
  #
  #     T::Private::Types::Void::VOID
  #
  module VOID
    freeze
  end

  # overrides Base
  def name
    "<VOID>"
  end

  # overrides Base
  def valid?(obj)
    raise ERROR_MESSAGE
  end

  # overrides Base
  private def subtype_of_single?(other)
    raise ERROR_MESSAGE
  end
end

Version data entries

237 entries across 237 versions & 2 rubygems

Version Path
sorbet-runtime-0.5.10754 lib/types/private/types/void.rb
sorbet-runtime-0.5.10751 lib/types/private/types/void.rb
sorbet-runtime-0.5.10746 lib/types/private/types/void.rb
sorbet-runtime-0.5.10741 lib/types/private/types/void.rb
sorbet-runtime-0.5.10736 lib/types/private/types/void.rb
sorbet-runtime-0.5.10735 lib/types/private/types/void.rb
sorbet-runtime-0.5.10731 lib/types/private/types/void.rb
sorbet-runtime-0.5.10722 lib/types/private/types/void.rb
sorbet-runtime-0.5.10712 lib/types/private/types/void.rb
sorbet-runtime-0.5.10710 lib/types/private/types/void.rb
sorbet-runtime-0.5.10707 lib/types/private/types/void.rb
sorbet-runtime-0.5.10705 lib/types/private/types/void.rb
sorbet-runtime-0.5.10696 lib/types/private/types/void.rb
sorbet-runtime-0.5.10693 lib/types/private/types/void.rb
sorbet-runtime-0.5.10690 lib/types/private/types/void.rb
sorbet-runtime-0.5.10689 lib/types/private/types/void.rb
sorbet-runtime-0.5.10687 lib/types/private/types/void.rb
sorbet-runtime-0.5.10685 lib/types/private/types/void.rb
devcycle-ruby-server-sdk-2.0.0 vendor/bundle/ruby/3.0.0/gems/sorbet-runtime-0.5.10648/lib/types/private/types/void.rb
sorbet-runtime-0.5.10679 lib/types/private/types/void.rb