extend/kernel: fix odisabled call.

This must set `disable` to `true` to have correct behaviour.
Also, don't allow setting it to `false` to avoid confusion as
that's what `odeprecated` is for.
This commit is contained in:
Mike McQuaid 2025-08-01 08:47:38 +01:00
parent 52de18f60f
commit f405f7316c
No known key found for this signature in database

View File

@ -223,16 +223,15 @@ module Kernel
end end
sig { sig {
params(method: String, replacement: T.nilable(T.any(String, Symbol)), disable: T::Boolean, params(method: String, replacement: T.nilable(T.any(String, Symbol)),
disable_on: T.nilable(Time), disable_for_developers: T::Boolean, caller: T::Array[String]).void disable_on: T.nilable(Time), disable_for_developers: T::Boolean, caller: T::Array[String]).void
} }
def odisabled(method, replacement = nil, def odisabled(method, replacement = nil,
disable: false,
disable_on: nil, disable_on: nil,
disable_for_developers: true, disable_for_developers: true,
caller: send(:caller)) caller: send(:caller))
# This odeprecated should stick around indefinitely. # This odeprecated should stick around indefinitely.
odeprecated(method, replacement, disable:, disable_on:, disable_for_developers:, caller:) odeprecated(method, replacement, disable: true, disable_on:, disable_for_developers:, caller:)
end end
sig { params(formula: T.any(String, Formula)).returns(String) } sig { params(formula: T.any(String, Formula)).returns(String) }