You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey @sandstrom, this is an interesting one! Let's rename the methods to instance_for, which is more in-line with the conventions used in the library. Since we're renaming, it doesn't make sense to include Singleton anymore, since we'd have to mark the original instance method as private and I'm not sure if Sorbet would take kindly to that (in any case, it's weird). AFAIK the Singleton module only does a couple of other nice things like mark new as private. It shouldn't be difficult to replicate the behavior.
I've tried out running sorbet on our code base.
I've run into the following problem stemming from Twitter CLDR.
Same error for
TwitterCldr::Segmentation::StateMachine.instance
,TwitterCldr::Segmentation::Suppressions.instance
,TwitterCldr::Shared::DayPeriods.instance
andTwitterCldr::Timezones::Timezone.instance
. This search will also bring up the relevant files: https://github.com/twitter/twitter-cldr-rb/search?q=instance+singletonI guess one solution could be to rename the instance method, so it doesn't collide with
instance
method defined viaSingleton
module:Another solution would be to not use the
Singleton
module, but that's likely more work.If you'd accept a PR I can try to make a change where
instance
is renamed tolocale_instance
(or maybecached_instance
).The text was updated successfully, but these errors were encountered: