-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Labels
fixed in Scala 3This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/)This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/)java interop
Milestone
Description
With Code when using netty 4:
val bootstrap = new ServerBootstrap()
bootstrap
.option(ChannelOption.SO_REUSEADDR, !Helpers.isWindows)
.option(ChannelOption.TCP_NODELAY, true)
.bind(sockaddr)
.channel()
which gives:
[error] found : io.netty.channel.ChannelOption[Boolean]
[error] required: io.netty.channel.ChannelOption[Any]
[error] Note: Boolean <: Any, but Java-defined class ChannelOption is invariant in type T.
[error] You may wish to investigate a wildcard type such as `_ <: Any`. (SLS 3.2.10)
[error] bootstrap.option(ChannelOption.TCP_NODELAY, true)
Which compiles if:
bootstrap
.option(ChannelOption.SO_REUSEADDR, java.lang.Boolean.valueOf(!Helpers.isWindows))
.option(ChannelOption.TCP_NODELAY, java.lang.Boolean.TRUE)
or
bootstrap
.option(ChannelOption.SO_REUSEADDR, Boolean.box(!Helpers.isWindows))
.option(ChannelOption.TCP_NODELAY, Boolean.box(true))
reproducer: https://github.com/He-Pin/scala2booleanBug master branch
Hash2049
Metadata
Metadata
Assignees
Labels
fixed in Scala 3This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/)This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/)java interop