Alexandre Terrasa
Alexandre Terrasa
This is an inconsistency between `sorbet` and `sorbet-runtime`. Be the following snippet: ```ruby # typed: true require 'sorbet-runtime' class A extend T::Sig sig { params(x: T.self_type).void } def foo(x) puts...
### Motivation Change the `ClassNew` rewriter to auto-cast the result of `Class.new(Parent)` into a `T.class_of(Parent)`. Right now, the associated type to `Class.new(Parent)` is always `Class`: ```rb x = Class.new(Parent) T.reveal_type(x)...
#### Input See classes `Error1`, `Error2`, and `Error3`. [→ View on sorbet.run](https://sorbet.run/#%23%20typed%3A%20strong%0A%0Aclass%20A%3B%20end%0Aclass%20B%20%3C%20A%3B%20end%0A%0Aclass%20Unrelated%3B%20end%0A%0Aclass%20Foo%0A%20%20extend%20T%3A%3ASig%0A%20%20extend%20T%3A%3AHelpers%0A%0A%20%20abstract!%0A%0A%20%20sig%20%7B%20abstract.returns(A)%7D%0A%20%20def%20a%3B%20end%0Aend%0A%0A%23%20Covariance%20rule%20for%20attr%20readers%20return%20types%20is%20not%20checked%3A%0A%0Aclass%20Error1%20%3C%20Foo%0A%20%20extend%20T%3A%3ASig%0A%0A%20%20sig%20%7B%20override.returns(Unrelated)%7D%20%23%20WRONG%3A%20Should%20error%2C%20as%20Unrelated%20is%20not%20a%20subtype%20of%20A%0A%20%20attr_reader%20%3Aa%0A%0A%20%20sig%20%7B%20params(a%3A%20Unrelated).void%20%7D%0A%20%20def%20initialize(a)%0A%20%20%20%20%40a%20%3D%20T.let(a%2C%20Unrelated)%0A%20%20end%0Aend%0A%0Aclass%20Error2%20%3C%20Foo%0A%20%20extend%20T%3A%3ASig%0A%0A%20%20sig%20%7B%20override.returns(T.nilable(Object))%7D%20%23%20WRONG%3A%20Should%20error%2C%20as%20nilable%20Object%20is%20not%20covariant%20with%20A%0A%20%20attr_reader%20%3Aa%0A%0A%20%20sig%20%7B%20void%20%7D%0A%20%20def%20initialize%0A%20%20%20%20%40a%20%3D%20T.let(nil%2C%20T.nilable(Object))%0A%20%20end%0Aend%0A%0Aclass%20Error3%20%3C%20Foo%0A%20%20extend%20T%3A%3ASig%0A%0A%20%20sig%20%7B%20override.returns(T.nilable(B))%7D%20%23%20WRONG%3A%20Should%20error%2C%20as%20nilable%20B%20is%20not%20covariant%20with%20A%0A%20%20attr_reader%20%3Aa%0A%0A%20%20sig%20%7B%20void%20%7D%0A%20%20def%20initialize%0A%20%20%20%20%40a%20%3D%20T.let(nil%2C%20T.nilable(B))%0A%20%20end%0Aend%0A%0A%23%20The%20following%20tests%20should%20still%20work%20once%20fixed%3A%0A%0Aclass%20Ok1%20%3C%20Foo%0A%20%20extend%20T%3A%3ASig%0A%0A%20%20sig%20%7B%20override.returns(B)%7D%20%23%20Ok%2C%20covariance%0A%20%20attr_reader%20%3Aa%0A%0A%20%20sig%20%7B%20params(b%3A%20B).void%20%7D%0A%20%20def%20initialize(b)%0A%20%20%20%20%40a%20%3D%20T.let(b%2C%20B)%0A%20%20end%0Aend%0A%0Aclass%20Ok2%20%3C%20Foo%0A%20%20extend%20T%3A%3ASig%0A%0A%20%20sig%20%7B%20override.returns(B)%7D%20%23%20Ok%0A%20%20def%20a%0A%20%20%20%20B.new%0A%20%20end%0Aend%0A%0A%23%20This%20already%20work%20well%20with%20concrete%20methods%3A%0A%0Aclass%20Ok3%20%3C%20Foo%0A%20%20extend%20T%3A%3ASig%0A%0A%20%20sig%20%7B%20override.returns(T.nilable(B))%7D%20%23%20Ok%3A%20errors%20as%20it%20should%0A%20%20def%20a%0A%20%20%20%20B.new%0A%20%20end%0Aend%0A%0Aclass%20Ok4%20%3C%20Foo%0A%20%20extend%20T%3A%3ASig%0A%0A%20%20sig%20%7B%20override.returns(Object)%7D%20%23%20Ok%3A%20errors%20as%20it%20should%0A%20%20def%20a%0A%20%20%20%20B.new%0A%20%20end%0Aend%0A%0Aclass%20Ok5%20%3C%20Foo%0A%20%20extend%20T%3A%3ASig%0A%0A%20%20sig%20%7B%20override.returns(Unrelated)%7D%20%23%20Ok%3A%20errors%20as%20it%20should%0A%20%20def%20a%0A%20%20%20%20Unrelated.new%0A%20%20end%0Aend) ```ruby # typed: strong class A; end class B < A; end class Unrelated; end class Foo extend...
### Motivation I wanted to extract a superclass from the current `Gem::Pipeline` but it proved a bit messier than what was required. This PR applies some cleaning to make it...
### Motivation Currently Tapioca is unable to generate DSL RBIs for applications that are not Rails applications. This PR provides a way for the user to pass a custom loader...
Some projects use vendored gems, for example under the `bundler/` directory. Such gems don't appear in the Gemfile and thus Tapioca doesn't generate any RBI for them. Since we generally...
As shown [here](https://guides.rubyonrails.org/testing.html#testing-helpers) ActionView test cases bring a lot of power to the test cases created by the user. Tapioca should generate as much as possible in the DSL's RBIs....
Currently, `spoom` will swallow any error from Sorbet even if it's not a type checking error. For example, running this: ``` spoom tc --sorbet-options="--not-found" ``` Will fail silently. To solve...
Closes #127. Before this patch, we were listing, reading and checking _all_ the files (direct and in subdirs) we could find from the bump `directory`. This may be highly inefficient,...
This PR is a follow up of #2720 and introduces a LaTeX/Maths mode for `lib/markdown2`. The goal is to handle #791 when it will be merged with the documentation tools....