You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some methods in CoreSettings take a Seq, e.g. CoreSettings.withAllowedMethods. However this does not work with the default Seq that is imported from the scala package. It requires the more restrictive scala.collection.immutable.Seq which is a subclass of the default Seq.
The reason for this is that CorsSettings.scala has import scala.collection.immutable.Seq so all uses of Seq refer to the more restrictive type. Looking at the code there appears to be no benefit from this more restrictive type, so the fix is to remove the import.
The text was updated successfully, but these errors were encountered:
You're right that we are using the immutable Seq collection in all our APIs. This is however a design choice, as we prefer enforcing strict immutability on such public APIs.
Usually the simplest way to get an immutable Seq instance is to construct a List directly or to convert your collection to one using .toList.
Note that it's also the direction Scala is taking, as collections in 2.13 (and Scala 3) will have the immutable Seq as the new default:
Some methods in
CoreSettings
take aSeq
, e.g.CoreSettings.withAllowedMethods
. However this does not work with the defaultSeq
that is imported from thescala
package. It requires the more restrictivescala.collection.immutable.Seq
which is a subclass of the defaultSeq
.The reason for this is that
CorsSettings.scala
hasimport scala.collection.immutable.Seq
so all uses ofSeq
refer to the more restrictive type. Looking at the code there appears to be no benefit from this more restrictive type, so the fix is to remove theimport
.The text was updated successfully, but these errors were encountered: