Runtime assertions for Ruby literal.fun
ruby
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix subtype checking

+4 -4
+1 -1
lib/literal/types/array_type.rb
··· 22 22 def >=(other) 23 23 case other 24 24 when Literal::Types::ArrayType 25 - @type >= other.type 25 + Literal.subtype?(other.type, @type) 26 26 else 27 27 false 28 28 end
+1 -1
lib/literal/types/frozen_type.rb
··· 28 28 def >=(other) 29 29 case other 30 30 when Literal::Types::FrozenType 31 - @type >= other.type 31 + Literal.subtype?(other.type, @type) 32 32 when Literal::Types::ConstraintType 33 33 type_match = false 34 34 frozen_match = Literal.subtype?(other.property_constraints[:frozen?], true)
+2 -2
lib/literal/types/json_data_type.rb
··· 55 55 56 56 case other 57 57 when Literal::Types::ArrayType 58 - self >= other.type 58 + Literal.subtype?(other.type, self) 59 59 when Literal::Types::HashType 60 - (self >= other.key_type) && (self >= other.value_type) 60 + (Literal.subtype?(other.key_type, self) && Literal.subtype?(other.value_type, self)) 61 61 when Literal::Types::ConstraintType 62 62 other.object_constraints.any? { |type| self >= type } 63 63 else