From 706c95f539bc2fbe0ed2a81c2aaf12ce4ded1124 Mon Sep 17 00:00:00 2001 From: SamW Date: Fri, 18 Aug 2023 21:43:40 -0700 Subject: [PATCH] Updated control flow type definitions --- core/kernel.rbs | 21 +++++++++--------- test/stdlib/Kernel_test.rb | 45 +++++++++++++++++++++++++++++++++++++- 2 files changed, 54 insertions(+), 12 deletions(-) diff --git a/core/kernel.rbs b/core/kernel.rbs index 3974671de..aebd6fbbe 100644 --- a/core/kernel.rbs +++ b/core/kernel.rbs @@ -383,7 +383,7 @@ module Kernel : BasicObject # 4. Therefore you should use spawn() instead of fork(). # def self?.fork: () -> Integer? - | () { () -> untyped } -> Integer? + | () { () -> void } -> Integer def initialize_copy: (self object) -> self @@ -691,7 +691,7 @@ module Kernel : BasicObject # Terminate execution immediately, effectively by calling `Kernel.exit(false)`. # If *msg* is given, it is written to STDERR prior to terminating. # - def self?.abort: (?String msg) -> bot + def self?.abort: (?string msg) -> bot # # With no arguments, raises the exception in `$!` or raises a RuntimeError if @@ -828,8 +827,8 @@ module Kernel : BasicObject # raise ArgumentError, "No parameters", caller # def self?.fail: () -> bot - | (String message, ?cause: Exception?) -> bot - | (_Exception exception, ?untyped message, ?::Array[String] backtrace, ?cause: Exception?) -> bot + | (string message, ?cause: Exception?) -> bot + | (_Exception exception, ?_ToS? message, ?nil | String | Array[String] backtrace, ?cause: Exception?) -> bot #