Class: T::Struct

Inherits:
InexactStruct show all
Defined in:
lib/sorbet/eraser/t/struct.rb

Overview

This is a shim for the T::Struct class because since you’re actually inheriting from the class there’s not really a way to remove it from the source.

Class Method Summary collapse

Methods included from Props

included, #initialize

Class Method Details

.inherited(child) ⇒ Object



16
17
18
19
20
21
22
23
# File 'lib/sorbet/eraser/t/struct.rb', line 16

def self.inherited(child)
  super(child)

  child.define_singleton_method(:inherited) do |grandchild|
    super(grandchild)
    raise "#{grandchild.name} is a subclass of T::Struct and cannot be subclassed"
  end
end