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
I think this is a "false positive" because the test result says there is a problem. A health screening test that comes back negative is a good thing, unless it is a false negative. ("Dodgers optimistic for Freeman's playoff status as ankle X-rays negative".)
Workaround is to use an explicit type arg (which is otherwise inferred to be Nothing):
minimal9_2[A](None)
Edit: or
??? : A
IIUC it's not supposed to be necessary due to erasure:
Activity
sir-wabbit commentedon Sep 24, 2024
Found a way to minimize it further (I think this is the same bug):
Note that removing type parameter makes the issue go away.
sir-wabbit commentedon Sep 24, 2024
Even further minimized:
som-snytt commentedon Sep 24, 2024
I think this is a "false positive" because the test result says there is a problem. A health screening test that comes back negative is a good thing, unless it is a false negative. ("Dodgers optimistic for Freeman's playoff status as ankle X-rays negative".)
Workaround is to use an explicit type arg (which is otherwise inferred to be Nothing):
Edit: or
IIUC it's not supposed to be necessary due to erasure:
https://github.com/scala/scala3/blob/main/compiler/src/dotty/tools/dotc/transform/TailRec.scala#L98-L100
I don't know why the comment is the opposite of reality.
[-]@tailrec false negative[/-][+]@tailrec false positive[/+]som-snytt commentedon Oct 10, 2025
The
Nothingis imposed atpatmatand results in a cast, like other breakages such as bones:Synthetic cast must not break tailrec (#26343)
Synthetic cast must not break tailrec (scala#26343)