He-Pin opened a new issue, #3252:
URL: https://github.com/apache/pekko/issues/3252
### Motivation
Pekko's typed Receptionist uses `TypedMultiMap` with Scala 3 match types
(`Platform.scala`). This combination fails to compile on Scala 3.4 and 3.5 due
to SIP-56 match type reduction restrictions. Pekko currently pins
`scala3Version = "3.3.8"`, masking the issue. Upgrading to Scala 3.4+ or 3.5.x
would break the build.
### Current Behavior
**Three files form the breaking chain:**
1. `actor/src/main/scala/org/apache/pekko/util/TypedMultiMap.scala:51`:
```scala
def inserted(key: T)(value: K[key.type]): TypedMultiMap[T, K]
```
2. `actor-typed/src/main/scala-3/.../Platform.scala:26-32`:
```scala
type Service[K <: Aux[?]] = K match {
case Aux[t] => ActorRef[t]
}
```
3. `actor-typed/src/main/scala/.../LocalReceptionist.scala:78-79`:
```scala
val newServices = services.inserted(key)(serviceInstance)
```
### Compilation Error on Scala 3.4-3.5
```
Type Mismatch Error:
Found: ActorRef[key.Protocol]
Required: Platform.Service[(key : Key)]
Note: a match type could not be fully reduced:
trying to reduce Platform.Service[(key : Key)]
failed since selector (key : Key) does not uniquely determine parameter t
```
### Version Matrix
| Scala Version | Standalone TypedMultiMap | Full Usage (with match types) |
|---|---|---|
| 3.3.8 (current) | PASS | PASS |
| 3.4.x | PASS | **FAIL** |
| 3.5.x | PASS | **FAIL** |
| 3.6.0+ | PASS | PASS |
### Expected Behavior
The Receptionist types should compile on all supported Scala 3 versions.
Either restructure the match types to avoid the SIP-56 restriction, or provide
a `scala-3/` override for the affected code.
### Impact
Blocks upgrading `scala3Version` from 3.3.8 to 3.4.x or 3.5.x. Scala 3.6+
happens to work again.
### Environment
- Pekko Actor Typed (Scala 3 build)
- `TypedMultiMap.scala:51`, `Platform.scala:26-32`,
`LocalReceptionist.scala:78-79`
- Same pattern in
`cluster-typed/src/main/scala-3/.../ClusterReceptionistProtocol.scala:28-30`
### References
None
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]