Inspired by @NicolasRinaudo, I played around with Scala capture checking enough to convince myself we could make Cats Effect’s Resource safer.

No idea what I’m doing but I achieved my goal of stopping the naughty code from compiling.

https://github.com/cb372/capisce

GitHub - cb372/capisce: Playing around with capture checking in Scala nightly

Playing around with capture checking in Scala nightly - cb372/capisce

GitHub
@cb372 @NicolasRinaudo Neat. Could it stop returning `response.body`? That is also a footgun, but seems harder to distinguish from appropriate uses.
@ross @cb372 if you annotate it as tracked then yes, i should think. There’s nothing preventing you from annotating fields of a class with ^.
@NicolasRinaudo @ross not to be confused with the `tracked` keyword, which is a completely different obscure Scala 3 feature!
@cb372 @ross right, that’s the one that makes sure fields infer the most specific type possible, right?
@NicolasRinaudo @cb372 @ross Seems I'm back right on time to see very exciting things happening. 😊