scala3 icon indicating copy to clipboard operation
scala3 copied to clipboard

Fail not inlined inline method calls early

Open jchyb opened this issue 8 months ago • 0 comments

All of them would be achieved with implicit resolution, during which the global state (ctx.base) would have stopInlining set to true, but the corresponding error might not have been shown as part of that implicit resolution - now we reset that value after failing the implicit, if it was not already set before typing the implicit.

In a previous PR https://github.com/scala/scala3/pull/13783, an issue #13044 where a similar situation occurred was fixed by adding a check for a not inlined inline method call in erasure, and reporting the error there. For #i22423, this check was not early enough, leading to a crash in the same phase for symbols using specialErasure. Adding an additional check there would not be enough, as this particular minimisation also fails post-inlining Ychecks. Even outside of that, I also believe it's better to fail this early anyway, and also allow implicit resolution to try to pick another option if we each the mainline limit in another option.

Fixes #22423

jchyb avatar Apr 07 '25 13:04 jchyb