Skip to content
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

Do not compute protoFormal if param.tpt is empty #18288

Merged
merged 1 commit into from
Jul 26, 2023

Conversation

nicolasstucki
Copy link
Contributor

@nicolasstucki nicolasstucki commented Jul 25, 2023

This was accidentally moved before of the if (!param.tpt.isEmpty) guard in 0f7c3ab#diff-8c9ece1772bd78160fc1c31e988664586c9df566a1d22ff99ef99dd6d5627a90R1534. protoFormal has a side effect (error reporting) that caused this issue.

Fixes #18276

@nicolasstucki nicolasstucki added the backport:nominated If we agree to backport this PR, replace this tag with "backport:accepted", otherwise delete it. label Jul 25, 2023
@nicolasstucki nicolasstucki requested a review from jchyb July 25, 2023 14:58
@@ -1606,32 +1606,31 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
if desugared.isEmpty then
val inferredParams: List[untpd.ValDef] =
for ((param, i) <- params.zipWithIndex) yield
val (formalBounds, isErased) = protoFormal(i)
Copy link
Contributor Author

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.

)
cpy.ValDef(param)(tpt = paramTpt)
if isErased then param0.withAddedFlags(Flags.Erased) else param0
Copy link
Contributor Author

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.

@nicolasstucki nicolasstucki merged commit 97677cc into scala:main Jul 26, 2023
17 checks passed
@nicolasstucki nicolasstucki deleted the fix-18276 branch July 26, 2023 07:41
@Kordyjan Kordyjan added this to the 3.4.0 milestone Aug 1, 2023
@Kordyjan Kordyjan added backport:accepted This PR needs to be backported, once it's been backported replace this tag by "backport:done" and removed backport:nominated If we agree to backport this PR, replace this tag with "backport:accepted", otherwise delete it. labels Aug 16, 2023
@Kordyjan Kordyjan mentioned this pull request Aug 22, 2023
15 tasks
@Kordyjan Kordyjan modified the milestones: 3.4.0, 3.3.1 Sep 5, 2023
@Kordyjan Kordyjan added backport:done This PR was successfully backported. and removed backport:accepted This PR needs to be backported, once it's been backported replace this tag by "backport:done" labels Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:done This PR was successfully backported.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regression in inkytonik/kiama
3 participants