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

#build_typeObject



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

def build_type
  nil
end

#nameObject

overrides Base



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

def name
  "<NOT-TYPED>"
end

#valid?(obj) ⇒ Boolean

overrides Base

Returns:

Raises:



19
20
21
# File 'lib/types/private/types/not_typed.rb', line 19

def valid?(obj)
  raise ERROR_MESSAGE
end