dart - limit T in a generic class to types that implement some interface -


in dart consider following

class question<t>{   string body;   t answer; }  //an interface class ianswer{   string value()=>this.tostring();   } 

i need t limited types example implement interface ianswer, possible without having check if t ianswer , throw , exception in question constructor?

class question<t extends ianswer>{   string body;   t answer; } 

Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -