Closed johnhungerford closed 8 hours ago
We've recently added recommended compiler flags to address this issue. The example fails to compile with the config https://scastie.scala-lang.org/HtIizca1RBumqPVIaPLgQg
Oh thank god. Just added those settings and caught about 15 issues in my project I was not aware of!
Clearly I haven't looked at the readme in a while. Thanks @fwbrasil !!
The compiler allows you to incorrectly annotate pending effect intersections, and the resulting effects break quietly during runtime
Minified example
Find on scastie
Expected behavior
1) Compiler error complaining that
doThing.map(s => Kyo.logInfo(s))
is not aUnit < Async
but aUnit < (Async & Abort[Int])
2) If compiler error is off the table, runtime error complaining that there is an unhandled effect somewhere. In the present case, I would expect it simply to run because the overlooked effect typeAbort[Int]
is never actually used (doThing1
does not actually fail).Actual behavior
The application does not run
doThing2
-- it simply returnsUnit
This might be a Scala issue, ultimately, but it's become a substantial issue as I've tried to use Kyo to develop an application. I keep running into weird issues that I spend a long time debugging, only to find eventually that I've left an
Abort
out somewhere.