rbs
rbs copied to clipboard
Updated GC signatures
This pr updates GC's signatures, unit tests, and adds in the Writer test type (which implements _Writer).
Two methods, GC.latest_gc_info and GC.stat technically can accept any hash, and just add their respective keys/values (e.g. [K,V] (Hash[K, V]) -> Hash[K | Symbol, V | Integer]). However, this is currently not testable, and the added complication of supporting it isn't worth the very niche—but technically correct—signature.
In addition to removing the occasional leading ::, this has the following changes:
-
GC::compact_infotype alias was added for the return value ofGC.compactand other methods -
GC::{INTERNAL_CONSTANTS,OPTS}: Moved inside the class -
GC.start: Removed duplicate argument names. -
GC.stat: Gave actual names to arguments, Hash variant is now nilable. -
GC.stress:boolnotTrueClass | FalseClass -
GC.stress=: SplitIntegerandboolcases apart to fix return value. -
GC.verify_compaction_references: Added optionaltoward,double_heapandexpand_heapkeyword arguments -
GC.latest_gc_info:nilis now accepted, removedKfrom theHash[K | Symbol, unty]edfunction. -
GC.garbage_collect: Removed duplicate argument names. -
GC::Profilerwas moved inside the class, andauto_compact-related functions were added.
Oh lovely, ruby segfault: https://github.com/ruby/rbs/actions/runs/6256735966/job/16988021332?pr=1530