Class: T::Private::Types::NotTyped

Inherits:
Types::Base show all
Defined in:
lib/types/private/types/not_typed.rb

Overview

A placeholder for when an untyped thing must provide a type. Raises an exception if it is ever used for validation.

Constant Summary collapse

ERROR_MESSAGE =
"Validation is being done on a `NotTyped`. Please report this bug at https://github.com/sorbet/sorbet/issues"
INSTANCE =
::T::Private::Types::NotTyped.new.freeze

Instance Method Summary collapse

Methods inherited from Types::Base

#==, #describe_obj, #error_message_for_obj, #error_message_for_obj_recursive, #hash, method_added, #recursively_valid?, #subtype_of?, #to_s, #validate!

Instance Method Details

#nameObject

overrides Base



10
11
12
# File 'lib/types/private/types/not_typed.rb', line 10

def name
  "<NOT-TYPED>"
end

#valid?(obj) ⇒ Boolean

overrides Base

Returns:

Raises:



15
16
17
# File 'lib/types/private/types/not_typed.rb', line 15

def valid?(obj)
  raise ERROR_MESSAGE
end