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

Fix #18769: Allow HK type args in Java signatures. #18883

Merged
merged 1 commit into from
Nov 9, 2023

Conversation

sjrd
Copy link
Member

@sjrd sjrd commented Nov 9, 2023

Contrary to what an earlier comment said, we do emit HK type parameters in Java signatures. They are always unbounded and never the type of values.

However, they can appear as type arguments to other higher-kinded types. Previously, an assertion error would trigger in that situation. We relax the assertion to allow this situation and emit a correct Java signature.

I manually verified that the generated Java signatures are consistent with what Scala 2 emits for the same code snippet.

fixes #18769

Contrary to what an earlier comment said, we do emit HK type
parameters in Java signatures. They are always unbounded and never
the type of values.

However, they can appear as type arguments to other higher-kinded
types. Previously, an assertion error would trigger in that
situation. We relax the assertion to allow this situation and
emit a correct Java signature.

I manually verified that the generated Java signatures are
consistent with what Scala 2 emits for the same code snippet.
@sjrd sjrd enabled auto-merge November 9, 2023 09:44
@sjrd sjrd merged commit 4eae174 into scala:main Nov 9, 2023
15 checks passed
@sjrd sjrd deleted the fix-18769 branch November 9, 2023 10:40
@Kordyjan Kordyjan added this to the 3.4.0 milestone Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compiler crash using partial function that returns F[_] inside value class
3 participants