checkSameNameUp su@(SU _ kd st parent) accst = case kd of
                                                    Method _ -> res || checkSameNameUp parent []
                                                    Interface -> res || checkSameNameUp parent []
                                                    Class -> res || checkSameNameUp parent []
                                                    _ -> checkSameNameUp parent nextst
    where
        nextst = accst ++ st
        res = functionCheck || checkSameNameInSymbolTable nextst
        
        functionCheck = length cons /= (length . nub) cons || length funcs /= (length . nub) funcs
        cons = [(ln, pt) | f@(FUNC mds _ ln pt lt) <- st, elem "cons" mds]
        funcs = [(ln, pt) | f@(FUNC mds _ ln pt lt) <- st, not $ elem "cons" mds]
checkSameNameUp su@(SU _ kd st parent) accst = case kd of
                                                    Method _ -> res || checkSameNameUp parent []
                                                    Interface -> res || checkSameNameUp parent []
                                                    Class -> res || checkSameNameUp parent []
                                                    _ -> checkSameNameUp parent nextst
    where
        nextst = accst ++ st
        res = functionCheck || checkSameNameInSymbolTable nextst
        
        functionCheck = length cons /= (length . nub) cons || length funcs /= (length . nub) funcs
        cons = [(ln, pt) | f@(FUNC mds _ ln pt lt) <- st, elem "cons" mds]
        funcs = [(ln, pt) | f@(FUNC mds _ ln pt lt) <- st, not $ elem "cons" mds]
checkSameNameUp su@(SU _ kd st parent) accst = case kd of
                                                    Method _ -> res || checkSameNameUp parent []
                                                    Interface -> res || checkSameNameUp parent []
                                                    Class -> res || checkSameNameUp parent []
                                                    _ -> checkSameNameUp parent nextst
    where
        nextst = accst ++ st
        res = functionCheck || checkSameNameInSymbolTable nextst
        
        functionCheck = length cons /= (length . nub) cons || length funcs /= (length . nub) funcs
        cons = [(ln, pt) | f@(FUNC mds _ ln pt lt) <- st, elem "cons" mds]
        funcs = [(ln, pt) | f@(FUNC mds _ ln pt lt) <- st, not $ elem "cons" mds]