OK I guess I'll have to reproduce that logic in [Scala.js' mechanism for delambdafy](https://github.com/scala-js/scala-js/blob/8f777c93d42d99f5746c059668f0c4a1264a3e60/compiler/src/main/scala/scala/scalajs/compiler/GenJSCode.scala#L2807) as well.

Btw, now it strikes me that I had to something like this for supporting `js.FunctionN` as SAMs too ([fourth step here](https://github.com/scala-js/scala-js/blob/8f777c93d42d99f5746c059668f0c4a1264a3e60/compiler/src/main/scala/scala/scalajs/compiler/GenJSCode.scala#L2711)). And there I simply match param types and result type entering posterasure against `ErasedValueType`. If you want to avoid those cross-phase calls, maybe you can do the same here?