With version 2.13.7 of the compiler, I have a compilation error in the code of the record project. The class is RecordRules in package net.liftweb.record. Here is the version that compiles in 2.12:
val displayName: FactoryMaker[(Record[_], Locale, String) => String] =
new FactoryMaker[(Record[_], Locale, String) => String]((m: Record[_], l: Locale, name: String) => name) {}
This generate the following compiler error with scala 2.13:
[error] …/liftweb/persistence/record/src/main/scala/net/liftweb/record/RecordRules.scala:50:9: type arguments [_$2] do not conform to trait Record's type parameter bounds [MyType <: net.liftweb.record.Record[MyType]]
[error] new FactoryMaker[(Record[_], Locale, String) => String]((m: Record[_], l: Locale, name: String) => name) {}
[error] ^
I tried to use an existantial type:
import scala.language.existentials
type RecordImpl = Record[T] forSome {type T <: Record[T]}
val displayName: FactoryMaker[(RecordImpl, Locale, String) => String] =
new FactoryMaker[(RecordImpl, Locale, String) => String]((m: RecordImpl, l: Locale, name: String) => name) {}
But this crashes the compiler with a StackOverflow.
I tried to add @unchecked annotations:
val displayName: FactoryMaker[(Record[_] @unchecked, Locale, String) => String] =
new FactoryMaker[(Record[_] @unchecked, Locale, String) => String]((m: Record[_] @unchecked, l: Locale, name: String) => name) {}
But the compiler still complains about unbound wildcard type:
[error] …/liftweb/persistence/record/src/main/scala/net/liftweb/record/RecordRules.scala:50:83: unbound wildcard type
[error] new FactoryMaker[(Record[_] @unchecked, Locale, String) => String]((m: Record[_] @unchecked, l: Locale, name: String) => name) {}
[error] ^
I am not proficient enough in Scala to find how to give enough clues to satisfy the compiler. If you have any suggestion, I would be glad to here about it.