Fail not inlined inline method calls early #22925
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 #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