Sha256: 0a75f85c546012766a5de3dcd0a6b31ce42ee62f03f40958a84363a6e1406b14

Contents?: true

Size: 380 Bytes

Versions: 238

Compression:

Stored size: 380 Bytes

Contents

# frozen_string_literal: true
# typed: true

module T::Types
  class TypedArray < TypedEnumerable
    # @override Base
    def name
      "T::Array[#{@type.name}]"
    end

    # @override Base
    def valid?(obj)
      obj.is_a?(Array) && super
    end

    def new(*args) # rubocop:disable PrisonGuard/BanBuiltinMethodOverride
      Array.new(*T.unsafe(args))
    end
  end
end

Version data entries

238 entries across 238 versions & 1 rubygems

Version Path
sorbet-runtime-0.4.4539 lib/types/types/typed_array.rb
sorbet-runtime-0.4.4538 lib/types/types/typed_array.rb
sorbet-runtime-0.4.4537 lib/types/types/typed_array.rb
sorbet-runtime-0.4.4536 lib/types/types/typed_array.rb
sorbet-runtime-0.4.4535 lib/types/types/typed_array.rb
sorbet-runtime-0.4.4534 lib/types/types/typed_array.rb
sorbet-runtime-0.4.4533 lib/types/types/typed_array.rb
sorbet-runtime-0.4.4532 lib/types/types/typed_array.rb
sorbet-runtime-0.4.4531 lib/types/types/typed_array.rb
sorbet-runtime-0.4.4530 lib/types/types/typed_array.rb
sorbet-runtime-0.4.4529 lib/types/types/typed_array.rb
sorbet-runtime-0.4.4528 lib/types/types/typed_array.rb
sorbet-runtime-0.4.4527 lib/types/types/typed_array.rb
sorbet-runtime-0.4.4526 lib/types/types/typed_array.rb
sorbet-runtime-0.4.4525 lib/types/types/typed_array.rb
sorbet-runtime-0.4.4524 lib/types/types/typed_array.rb
sorbet-runtime-0.4.4523 lib/types/types/typed_array.rb
sorbet-runtime-0.4.4521 lib/types/types/typed_array.rb
sorbet-runtime-0.4.4522 lib/types/types/typed_array.rb
sorbet-runtime-0.4.4519 lib/types/types/typed_array.rb