Given the generic register method below, I would like to define the := operator as a symbolic alias.
def register[Prop <: Property[_]](prop: Prop): Prop @inline final def :=[Prop <: Property[_]] = register[Prop] _
Initially, I wanted to write something like this:
val := = register _
But that gives me the signature of the Nothing => Nothing function. My next attempt was to parameterize it with the Prop type, but this apparently only works if I def , which can take type parameters and pass them forward.
Ideally, I would like to omit the @inline annotation, but I'm not sure what kind of object code the Scala compiler makes from it.
My most important goal is to not use the := method to duplicate all parts of the register method signature except the name, and then just let the former delegate to the latter.
Tim friske
source share