-
Notifications
You must be signed in to change notification settings - Fork 505
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
initialize now considered private in interface #6804
Comments
I have no clue what those versions are—they are not Sorbet version numbers. This is sort of an expected change, but also an unexpected change. This is the real bug: #5687, it's just that after a recent change, this bug gets tripped under the covers. But I'm also surprised to hear that this was ever allowed: when I run that program, I get an exception: # typed: true
require 'sorbet-runtime'
module MyInterface
extend T::Sig
extend T::Helpers
interface!
sig do
abstract.params(
foo: T.nilable(String)
).void
end
def initialize(foo); end
end
class A
extend T::Sig
include MyInterface
sig do
override.params(
foo: T.nilable(String)
).void
end
def initialize(foo); end
end
A.new('')
Fixing this behavior is tracked by this issue: #3388. So I think that while it's clear that a recent change caused this new error to appear, at runtime, that code was never allowed anyways, and as such we should simply roll forward by fixing the two mentioned bugs, instead of rolling back the PR that caused this. |
Apologies, the correct version numbers are (the listed ones were tapioca versions)
I haven't had any problems at runtime with this code, but I agree that fixing the root cause makes sense rather than a roll back. I note both those issues are marked as "good first issue" so I'll see if I can make any progress on them! |
Input
This appears to be a change in semantics from
0.10.5
and0.11.1
→ View on sorbet.run
Observed output
Expected behavior
This did not cause an error in
0.10.5
but does in0.11.1
. Not sure if this is an intentional change?The text was updated successfully, but these errors were encountered: