How to roll up into Any and then unroll into the generic type in scala -


as roll instances of flag[t], end rolling flag[_] or flag[any] so

val seq: seq[flag[_]] = new flag[int](5) :+ new flag[myflag](someinstance) :+ new flag[string]("stringvalue") 

so inside flag, added

def generictype(implicit m: manifest[t]): class[_] = m.runtimeclass 

we have inside flag class

def value: t = { //the value }} 

so loop on flag[_], need pass value , classof[t] template function

def sometemplatefunction[f](clazz: class[f], value: f) 

how can achieve this? , should using [_], [any] or [nothing]?

i got compiles had use java function there (about test out not sure work @ all):

public class bindguicebytype {     public static void bind(binder binder, string flagname, object value, class clazz) {         key key = key.get(clazz, new flagimpl(flagname));         binder.bind(key).toinstance(value);     } }