-
Couldn't load subscription status.
- Fork 1.1k
Do not compute protoFormal if param.tpt is empty
#18288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This was accidentally moved before of the `if (!param.tpt.isEmpty)` guard in scala@0f7c3ab#diff-8c9ece1772bd78160fc1c31e988664586c9df566a1d22ff99ef99dd6d5627a90R1534 Fixes scala#18276
| if desugared.isEmpty then | ||
| val inferredParams: List[untpd.ValDef] = | ||
| for ((param, i) <- params.zipWithIndex) yield | ||
| val (formalBounds, isErased) = protoFormal(i) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line moved into the else branch. The rest should not have changed.
| else errorType(AnonymousFunctionMissingParamType(param, tree, inferredType = formal, expectedType = pt), param.srcPos) | ||
| ) | ||
| cpy.ValDef(param)(tpt = paramTpt) | ||
| if isErased then param0.withAddedFlags(Flags.Erased) else param0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this was moved into the else branch asl well.
This was accidentally moved before of the
if (!param.tpt.isEmpty)guard in 0f7c3ab#diff-8c9ece1772bd78160fc1c31e988664586c9df566a1d22ff99ef99dd6d5627a90R1534.protoFormalhas a side effect (error reporting) that caused this issue.Fixes #18276