Skip to content

Use result of lambda type of implicit in CheckUnused #23497

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

Merged
merged 1 commit into from
Jul 14, 2025

Conversation

som-snytt
Copy link
Contributor

@som-snytt som-snytt commented Jul 10, 2025

Fixes #23494

When inspecting unused implicit parameters, the check skips parameters which are "marker traits". It tests for any members of the type (or its upper bound) which are not "universal members". This commit uses the resultType to avoid an error

invalid new prefix

while computing members where the type is a LambdaType.

A future improvement would be not to request allMembers, since the check only needs to find one that is not universal.

The necessitating change was 2e4bc0a.

@som-snytt som-snytt marked this pull request as ready for review July 11, 2025 22:04
@Gedochao Gedochao requested a review from tgodzik July 14, 2025 09:21
@Gedochao Gedochao requested a review from WojciechMazur July 14, 2025 09:21
@WojciechMazur WojciechMazur merged commit a5e15ab into scala:main Jul 14, 2025
29 checks passed
@WojciechMazur WojciechMazur added the backport:nominated If we agree to backport this PR, replace this tag with "backport:accepted", otherwise delete it. label Jul 14, 2025
@som-snytt som-snytt deleted the issue/23494-unused-crash branch July 14, 2025 21:54
WojciechMazur pushed a commit that referenced this pull request Jul 16, 2025
Fixes #23494 

When inspecting unused implicit parameters, the check skips parameters
which are "marker traits". It tests for any members of the type (or its
upper bound) which are not "universal members". This commit uses the
`resultType` to avoid an error
```
invalid new prefix
```
while computing members where the type is a `LambdaType`.

A future improvement would be not to request `allMembers`, since the
check only needs to find one that is not universal.

The necessitating change was
2e4bc0a.
[Cherry-picked a5e15ab]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:nominated If we agree to backport this PR, replace this tag with "backport:accepted", otherwise delete it.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regression in taig/enumeration-ext - crash in checkUnusedPostInlining
3 participants