def _check_dest(self, srcexpr, destexpr):
        """Attempt to validate a connection"""
        srcvars = srcexpr.get_referenced_varpaths(copy=False)
        destvar = destexpr.get_referenced_varpaths().pop()
        destcompname, destcomp, destvarname = _split_varpath(self, destvar)
        desttrait = None
        srccomp = None

        if not isinstance(destcomp, PseudoComponent) and \
           not destvar.startswith('parent.') and not len(srcvars) > 1:
            for srcvar in srcvars:
                if not srcvar.startswith('parent.'):
                    srccompname, srccomp, srcvarname = _split_varpath(self, srcvar)
                    if not isinstance(srccomp, PseudoComponent):
                        src_io = 'in' if srccomp is self else 'out'
                        srccomp.get_dyn_trait(srcvarname, src_io)
                        if desttrait is None:
                            dest_io = 'out' if destcomp is self else 'in'
                            desttrait = destcomp.get_dyn_trait(destvarname, dest_io)

                if not isinstance(srccomp, PseudoComponent) and \
                   desttrait is not None:
                    # punt if dest is not just a simple var name.
                    # validity will still be checked at execution time
                    if destvar == destexpr.text:
                        ttype = desttrait.trait_type
                        if not ttype:
                            ttype = desttrait
                        srcval = srcexpr.evaluate()
                        if ttype.validate:
                            ttype.validate(destcomp, destvarname, srcval)
                        else:
                            # no validate function on destination trait. Most likely
                            # it's a property trait.  No way to validate without
                            # unknown side effects. Have to wait until later
                            # when data actually gets passed via the connection.
                            pass
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.main/src/openmdao/main/assembly.py/Assembly._check_dest/original