Skip to content

Fix #25342: Transfer methodsAllowingJSAwait to forcefully inlined methods. - #25344

Merged
sjrd merged 1 commit into
scala:mainfrom
dotty-staging:sjs-fix-async-block-with-unit-type
Feb 25, 2026
Merged

Fix #25342: Transfer methodsAllowingJSAwait to forcefully inlined methods.#25344
sjrd merged 1 commit into
scala:mainfrom
dotty-staging:sjs-fix-async-block-with-unit-type

Conversation

@sjrd

@sjrd sjrd commented Feb 25, 2026

Copy link
Copy Markdown
Member

This PR was done entirely by a human (obviously).

@sjrd

sjrd commented Feb 25, 2026

Copy link
Copy Markdown
Member Author

Review by @natsukagami, since you reviewed the original PR that added this code? It's a tiny fix.

@natsukagami natsukagami left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes sense to me but I might not have the full context 😅 I do have a question on the test though, just so that we confirm that it resolves the issue correctly

def unitAsyncBlock_Issue25342(): AsyncResult = await {
val buf = new ArrayBuffer[String]()

val px = js.Promise.resolve[Int](5)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if you should use a Promise[Unit] in this test to align with #25342?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem was not the type of the js.await. It was the fact that js.async was of type Unit.

@sjrd
sjrd merged commit 87572b5 into scala:main Feb 25, 2026
62 checks passed
@sjrd
sjrd deleted the sjs-fix-async-block-with-unit-type branch February 25, 2026 15:55
@WojciechMazur WojciechMazur added this to the 3.8.4 milestone Mar 31, 2026
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.

js.await(promise) does not compile in Scala 3.8.x when the type of promise is js.Promise[Unit]

4 participants