-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix backwards compatibility with sorbet-runtime #1277
Conversation
Also, we will need a test with an older version of Sorbet to make sure we don't break old behaviour. |
d1ed355
to
84aa084
Compare
Are there other examples of a test like this, so I use a similar setup? |
It was recently removed: 76515f5#diff-bee8bd10954cc2dcd94f010d4bc1b3092af1883d0494cfda0c1b653718550b11 But, basically a gem CLI test that sets up Tapioca against both an older and a newer version of the sorbet-runtime gem (on both sides of the breaking upstream PR) to test the codepath that would be broken if we got this wrong (either) way is tested properly. |
84aa084
to
e21a55c
Compare
In order to test this we had to make Interestingly, if we remove both versions of The only test that breaks if both patches are removed is this one, which fails when the file is Now:
|
By default `exe/tapioca` will ignore many errors, including typechecking ones. This is because we want to generate as much RBI as possible, even if there are errors in the codebase. We do want to surface more errors in the CLI tests, however, so this PR is making CLI tests throw by default, while providing an option to ignore it explicitly in cases where the updates to the test setup would not be worth the hassle. See #1277 (comment)
By default `exe/tapioca` will ignore many errors, including typechecking ones. This is because we want to generate as much RBI as possible, even if there are errors in the codebase. We do want to surface more errors in the CLI tests, however, so this PR is making CLI tests throw by default, while providing an option to ignore it explicitly in cases where the updates to the test setup would not be worth the hassle. See #1277 (comment)
By default `exe/tapioca` will ignore many errors, including typechecking ones. This is because we want to generate as much RBI as possible, even if there are errors in the codebase. We do want to surface more errors in the CLI tests, however, so this PR is making CLI tests throw by default, while providing an option to ignore it explicitly in cases where the updates to the test setup would not be worth the hassle. See #1277 (comment)
By default `exe/tapioca` will ignore many errors, including typechecking ones. This is because we want to generate as much RBI as possible, even if there are errors in the codebase. We do want to surface more errors in the CLI tests, however, so this PR is making CLI tests throw by default, while providing an option to ignore it explicitly in cases where the updates to the test setup would not be worth the hassle. See #1277 (comment)
03be53d
to
0972f56
Compare
0972f56
to
3e67ab0
Compare
Sorbet runtime should never need to look up the name of a `TypeVariableModule` instance, since that type should always be coerced to a `Tapioca::TypeVariable` instance by the point the `name` method is called. The fact that we were doing this was redundant and was preventing us from detecting instances where a `TypeVariableModule` instance was not being properly coerced to a `Tapioca::TypeVariable` instance.
Co-authored-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
This reintroduces the monkeypatch to T::Utils#coerce that was removed on #1270. See https://github.com/Shopify/tapioca/pull/1270/files#r1026916745 for more information.
3e67ab0
to
ea2039a
Compare
Ok, I've verified that the change in the I'd also verified that both tests fail if their corresponding module doesn't do the patching correctly, so this PR should be ready to go. |
This reintroduces the monkeypatch to
T::Utils#coerce
that was removed on #1270. See https://github.com/Shopify/tapioca/pull/1270/files#r1026916745 for more information.