-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scala 3 #120
Conversation
@@ -46,7 +47,7 @@ class GeneratorClassLoader extends ClassLoader(classOf[GeneratorClassLoader].get | |||
|
|||
def getClassLoader: GeneratorClassLoader = this | |||
|
|||
def loadClass[T](name: String, clazz: Class[T]) = loadClass(name).asInstanceOf[Class[_ <: T]] | |||
def loadClass[T](name: String, clazz: Class[T]): Class[_ <: T] = loadClass(name).asInstanceOf[Class[_ <: T]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Since this is Scala 3, we should use Class[? <: T]
instead.
https://docs.scala-lang.org/scala3/reference/changed-features/wildcards.html
@@ -34,7 +34,7 @@ trait JobDataHelper { | |||
|
|||
implicit def jobDataMap: Mapping[Option[JobDataMap]] = | |||
optional( | |||
list(mapping("key" -> text, "value" -> text)(DataMap.apply)(DataMap.unapply)) | |||
list(mapping("key" -> text, "value" -> text)(DataMap.apply)(r => Some((r.key, r.value)))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super-nit: Whether you accept this suggestion is completely up to you, but I strongly dislike single-letter variable names unless they're referring to an index. Could you make this more descriptive?
case "cron" => cron.get | ||
case "simple" => simple.get | ||
}) | ||
}): ScheduleBuilder[?]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I'm surprised this was necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah.... I think what happened is ScheduleBuilder[T]
isn't covariant in T, so it couldn't figure out how to merge the two ScheduleBuilder
instances, and I guess couldn't figure out that ScheduleBuilder[?]
would work here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting.
), | ||
) | ||
} | ||
|
||
object MaxSecondsBetweenSuccessesFormatter extends Formatter[Int] { | ||
override val format = Some(("format.triggerMaxErrorTime", Nil)) | ||
override val format: Option[(String, Seq[Nothing])] = Some(("format.triggerMaxErrorTime", Nil)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Should we stick to original signature of format
? I.e. Option[(String, Seq[Any])]
:
https://www.playframework.com/documentation/2.9.3/api/scala/play/api/data/format/Formatter.html#format:Option[(String,Seq[Any])]
Depends on #119