Login
From:
blog.jez.io
(Uncensored)
subscribe
A trick for generic constructors in Sorbet – Jake Zimmerman
https://blog.jez.io/generic-constructor-trick/
links
backlinks
Tagged with:
ruby
sorbet
Roast topics
Find topics
Find it!
There's a bit of a clever trick with T.all and T.attached_class that allows Sorbet to infer better types for constructors of generic classes.