-
Notifications
You must be signed in to change notification settings - Fork 516
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
Sorbet provides confusing output (or crashes) if a constant is named T #3133
Comments
Here's the backtrace for the crash:
|
This comment has been minimized.
This comment has been minimized.
I'm not myself calling |
This comment has been minimized.
This comment has been minimized.
Yes, but Sorbet shouldn't be crashing! A single informative message would also help here, instead of roughly 4000 confusing messages. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Using a debug build, I'm hitting an earlier Line 1335 in 0aae56e
|
Thank you for the report! I probably caused this when I rearchitected namer. @vaporyhumo as @mistydemeo states, this is clearly a bug in Sorbet and not intended behavior! Sorbet should never crash. |
This comment has been minimized.
This comment has been minimized.
I'm deleting my old comments since they add nothing of value to an open issue. |
I re-ran the following program on a debug build, and no longer notice an # typed: true
T = "blah" |
Input
This doesn't reproduce in the same way on
sorbet.run
.Any assignment to
T
causes this; for example,T = "blah"
is enough.Observed output
Several thousand errors which resemble this:
In
sorbet.run
, the error message is completely different and much easier to understand:Expected behavior
A few things would be expected:
T
in code being typechecked doesn't affect Sorbet's own definition ofT
, allowing the typechecking to simply work.Redefining constant T
) instead of several thousand confusing messages.This can be reproduced by running
srb tc -e 'T = "blah"'
.In at least one moderately-sized application (Homebrew), where Sorbet inadvertently ran on our dependencies, a dependency's spec helper containing the statement
T = Regexp::Syntax::Token
caused Sorbet to crash with aSIGSTOP
instead of reporting errors. Discussion in Slack with @trevor-stripe brought up that this looks like a call toENFORCE
that shouldn't be terminating the process in a release build of Sorbet.I haven't been able to isolate the repro step outside Homebrew's own codebase. To repro, you'll need to run the following steps:
git clone https://github.com/mistydemeo/brew.git
cd brew && git checkout reproduce_sorbet_crash
cd Library/Homebrew
bundle install
bundle exec srb tc
The text was updated successfully, but these errors were encountered: