Skip to content

Conversation

@som-snytt
Copy link
Contributor

@som-snytt som-snytt commented Dec 21, 2025

Fixes #21351

The example in the doc of bad parens is isWhole(), but no apply method is like that.

Fixes #22061

A class C(implicit c: Int = 42) has a synthetic leading parameter list, but the default arg does not. When constructing a default arg expression, it's necessary to check whether the leading parens are applied.

@som-snytt
Copy link
Contributor Author

som-snytt commented Dec 21, 2025

The only usage without parens:

[error] -- [E100] Syntax Error: /home/runner/work/scala3/scala3/community-build/community-projects/munit/tests/jvm/src/test/scala/munit/AsyncFixtureOrderSuite.scala:7:36 
[error] 7 |  val latch: Promise[Unit] = Promise[Unit]
[error]   |                             ^^^^^^^^^^^^^
[error]   |            method apply in object Promise must be called with () argument

Oh by coincidence, also Promise:

[error] -- [E100] Syntax Error: /home/runner/work/scala3/scala3/community-build/community-projects/libretto/core/src/main/scala/libretto/impl/FreeScalaFutureRunner.scala:435:35 
[error] 435 |                    val p = Promise[Frontier[One |+| One]]
[error]     |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[error]     |        method apply in object Promise must be called with () argument
[error]     |
[error]     | longer explanation available when compiling with `-explain`
[error] -- [E100] Syntax Error: /home/runner/work/scala3/scala3/community-build/community-projects/libretto/core/src/main/scala/libretto/impl/FreeScalaFutureRunner.scala:450:25 
[error] 450 |          val p = Promise[() => Frontier[One]]
[error]     |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[error]     |        method apply in object Promise must be called with () argument
[error]     |
[error]     | longer explanation available when compiling with `-explain`
[error] two errors found

It looks like the CB libretto is stale. But this commit has many promises with parens, so these two exceptions prove the rule.

@som-snytt
Copy link
Contributor Author

munit tweak has been upstreamed, but I'm not sure what's the right approach for updating the CB libretto.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant