···44# NOTE: This is not a quickdraw test becuase it needs to be run in a single thread.
5566require "literal"
77+require "set"
88+79include Literal::Types
810911def count_allocations
···1315end
14161517def count_warm_allocations(&)
1818+ count_allocations(&)
1619 count_allocations(&)
1720 count_allocations(&)
1821end
+7-2
lib/literal/types/constraint_type.rb
···2525 i += 1
2626 end
27272828+ result = true
2929+2830 @property_constraints.each do |a, t|
2929- return false unless t === value.public_send(a)
3131+ # We intentionally don’t return early here becuase it triggers an allocation.
3232+ if result && !(t === value.public_send(a))
3333+ result = false
3434+ end
3035 rescue NoMethodError => e
3136 raise unless e.name == a && e.receiver == value
3237 return false
3338 end
34393535- true
4040+ result
3641 end
37423843 def >=(other)