'#todo'

def _gen_dialect_impl(self, dialect):

    adapted = dialect.type_descriptor(self)
    if (adapted is not self):
        return adapted
    typedesc = self.load_dialect_impl(dialect).dialect_impl(dialect)
    tt = self.copy()
    if (not isinstance(tt, self.__class__)):
        raise AssertionError(('Type    object    %s    does    not    properly    implement    the    copy()    method,    it    must    return    an    object    of    type    %s' % (self, self.__class__)))
    tt.impl = typedesc
    return tt
