Well, I'm not so familiar with this pattern:
type MyEdge[X] = LEdge[X] { type L1 = SecurityMutatorFactory[X]}
but I tend to consider types defined with the type
keyword as aliases (notions) rather than an implementation guarantee ( EDIT more precisely, I believe that type
provides guarantees in terms of prototyping / specifying, but that AST / code is not generated until there is no urgent need to replace the pseudonym with the signs / classes on which it is based). Therefore, even if the compiler states in its error message:
LEdge[MyStuff] >: MyEdge[MyStuff]
I'm not sure if at the bytecode level it implements MyEdge
respectively, with interfaces / methods / etc. Thus, he may not recognize the wanted relationship between LEdge and MyEdge, after all:
found : scala.reflect.Manifest[LEdge[MyStuff]] required: Manifest[MyEdge[MyStuff]]
(and is the absence of the scala.reflect.
package a hint? (1) )
About your code, how do you use a
? In any case, if your intention is as follows:
trait MyEdge[X] extends LEdge[X] { type L1 = SecurityMutatorFactory[X] }
instead it compiles (scala 2.10) ... ( EDIT I just noticed now that dmitry already said this) ... what it does at runtime, I don't know
As a note to the note, Manifest
deprecated after scala 2.9; therefore, you can use TypeTag[T]
as described in scaladoc.
EDIT:
(1) I suspect the following is happening:
- at the stage of parsing, the compiler literally registers what you specified, that is, the method implicitly
should return Manifest[MyEdge[MyStuff]]
.
- at the stage of code generation, aliases are βconsistentβ with their nearest classes or features; if implicitly
the result type Manifest[MyEdge[MyStuff]]
becomes a scala.reflect.Manifest[LEdge[MyStuff]]]
- due to some restrictions on the type inference involved in Manifest
and the type of βsmoothingβ in the type parameters, however, somehow the specified requirement Manifest[MyEdge[MyStuff]]
remains under its original form
- (this is a pure hypothesis because I did not read the scala compiler source code for this answer), on the one hand, the compiler would have the correct AST / code, but the prototype / specification of the method, which is still under its source code / literal form , on the other hand; which does not fit, so it emits an error.
Hope this helps ...