Skip to content

Erase more aliases of Unit as result type to void.#26252

Open
sjrd wants to merge 1 commit into
scala:mainfrom
sjrd:more-erasure-of-unit
Open

Erase more aliases of Unit as result type to void.#26252
sjrd wants to merge 1 commit into
scala:mainfrom
sjrd:more-erasure-of-unit

Conversation

@sjrd
Copy link
Copy Markdown
Member

@sjrd sjrd commented Jun 7, 2026

The previous fix failed to take polymorphic type aliases into account.

In general, it must hold that A =:= B implies
erase(A) =:= erase(B) for all conditions of erase. So really the safest way is to test whether tp =:= UnitType.

Follow-up to #26192.

How much have you relied on LLM-based tools in this contribution?

Not at all

How was the solution tested?

New automated tests (including the issue's reproducer, if applicable)

The previous fix failed to take polymorphic type aliases into
account.

In general, it must hold that `A =:= B` implies
`erase(A) =:= erase(B)` for all conditions of `erase`. So really
the safest way is to test whether `tp =:= UnitType`.
@SolalPirelli
Copy link
Copy Markdown
Contributor

Seems like something isn't quite right in Scala.js tests with this 😅

@sjrd
Copy link
Copy Markdown
Member Author

sjrd commented Jun 8, 2026

Yes, and it's a symptom that it's not in agreement with what Scala 2 does, even for the JVM. It's just that Scala.js is one of the few hold outs in our build that actually links against Scala 2-produced code.

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.

2 participants