diff --git a/core/builtin.rbs b/core/builtin.rbs index ad1253bc0..41a9d2a88 100644 --- a/core/builtin.rbs +++ b/core/builtin.rbs @@ -214,6 +214,7 @@ interface _Range[T] def exclude_end?: () -> bool end +%a{steep:deprecate} interface _Exception def exception: () -> Exception | (String arg0) -> Exception diff --git a/core/exception.rbs b/core/exception.rbs index 45c9df4d1..eeb0415b3 100644 --- a/core/exception.rbs +++ b/core/exception.rbs @@ -106,6 +106,10 @@ # * fatal # class Exception + interface _Exception[T] + def exception: (?T message) -> Exception + end + # + # # Returns the string resulting from formatting `objects` into `format_string`. # # For details on `format_string`, see [Format # Specifications](rdoc-ref:format_specifications.rdoc). # - def self?.format: (String format, *untyped args) -> String + def self?.sprintf: (string format, hash[Symbol, untyped] keywords) -> String + | (string format, **untyped keywords) -> String + | (string format, *untyped positional) -> String - # + # # Returns the string resulting from formatting `objects` into `format_string`. # # For details on `format_string`, see [Format # Specifications](rdoc-ref:format_specifications.rdoc). # - alias sprintf format + alias format sprintf - alias self.sprintf self.format + alias self.format self.sprintf # # Equivalent to Proc.new. # - def self?.proc: () { () -> untyped } -> Proc + def self?.proc: () { (?) -> untyped } -> Proc #