Peter Arato
Peter Arato
### Problem See the following code: ```ruby list = T.let([], T::Array[T.any(String, Integer)]) T.let( list.find { |e| e.is_a?(Integer) }, T.nilable(Integer), ) ``` Sorbet link: https://sorbet.run/#%23%20typed%3A%20strict%0Aextend%20T%3A%3ASig%0A%0Alist%20%3D%20T.let%28%5B%5D%2C%20T%3A%3AArray%5BT.any%28String%2C%20Integer%29%5D%29%0AT.let%28%0A%20%20list.find%20%7B%20%7Ce%7C%20e.is_a%3F%28Integer%29%20%7D%2C%0A%20%20T.nilable%28Integer%29%2C%0A%29%0A Here `Enumerable#find` is conditioned to only...
Autoloader use with multiple threads cause premature use of the class. ## Example When executing mutliple `Rails` tests with the debugger: `jt --use jvm-ce ruby --jdebug -S ./bin/rails test test/folder`...
Source: https://github.com/oracle/truffleruby/issues/3039 Introduce IO#timeout= and IO#timeout which can cause IO::TimeoutError to be raised if a blocking operation exceeds the specified timeout. [[Feature #18630](https://bugs.ruby-lang.org/issues/18630)] ```ruby STDIN.timeout = 1 STDIN.read # =>...
Consider the same file loaded twice, with and without a symlinked path: ```bash mkdir real_dir ln -s real_dir symlink_dir cat 'puts("Loaded")' > real_dir/script.rb ``` ```ruby require_relative("./real_dir/script") require_relative("./symlink_dir/script") ``` CRuby loads...
We've noticed a slow function call from the `bcrypt` gem: ```ruby BCrypt::Password.create("test") ``` Running a quick script with `truffleruby 23.1.0-dev-c477b049, like ruby 3.1.3, GraalVM CE Native [aarch64-darwin]`: ``` require("bcrypt") 100.times...
During profiling a rails app (running a single test with `jt --use jvm-ce ruby -S ./bin/rails test test/...`) we've noticed some methods being multiple without having any distinction. An example...
#### Input Type check fails in certain cases when a block is passed when a block arg is expected. [→ View on sorbet.run](https://sorbet.run/#%23%20typed%3A%20true%0Aextend%20T%3A%3ASig%0A%0Adef%20foo%28%26block%29%3B%20end%0Afoo%20%7B%7D%20%23%20This%20is%20ok.%0A%0Aproc1%20%3D%20Proc.new%20%7B%20%7C%26block%7C%20%7D%0Aproc1.call%20%7B%7D%20%23%20This%20is%20ok.%0A%0Aproc2%20%3D%20proc%20%7B%20%7C%26block%7C%20%7D%0Aproc2.call%20%7B%7D%20%23%20Not%20enough%20arguments%20provided%20for%20method%20Proc1%23call.%20Expected%3A%201%2C%20got%3A%200.%0A%0Alambda%20%3D%20-%3E%20%28%26block%29%20%7B%7D%0Alambda.call%20%7B%7D%20%23%20Not%20enough%20arguments%20provided%20for%20method%20Proc1%23call.%20Expected%3A%201%2C%20got%3A%200.%0A) ```ruby def foo(&block); end foo {} #...