---------------------------------------------------------------------------------------------------------
symbolLinkingExpr :: TypeNode -> [[String]] -> SemanticUnit -> Expression -> [Symbol]
symbolLinkingExpr db imps su expr@(Attribute s m _) = case typeLinkingExpr db imps su s of
                                                        [] -> typeLinkingFailure' ("Attr no match " ++ (show s) ++ (show m))
                                                        --should handle Class and instance differently
                                                        [tp] -> if isPrimitive tp then typeLinkingFailure' $ "Attribute dereference a primitive " ++ (show tp) else
                                                                    let Just tn = getTypeEntry db (typeToName tp)
                                                                        syms = [node | node <- traverseInstanceEntryAccessible db cname db ((typeToName tp)++[m])]
                                                                        syms' = if accessibleType db cname (symbol tn) then syms else [node | node <- syms, not $ elem "protected" ((symbolModifiers . symbol) node)]--typeLinkingFailure' $ "no protected fields " ++ (show flds)--
                                                                    in case syms' of
                                                                        [] -> typeLinkingFailure' ("Attr no match on member " ++ (show expr) ++ (show ((typeToName tp)++[m])))
                                                                        --instance look up should not return multiple candidates
                                                                        nodes -> map symbol nodes
                                                        _ -> typeLinkingFailure' ("Attr multi " ++ (show s) ++ (show m))
    where
        cname = (typeToName . lookUpThis) su
symbolLinkingExpr :: TypeNode -> [[String]] -> SemanticUnit -> Expression -> [Symbol]
symbolLinkingExpr db imps su expr@(Attribute s m _) = case typeLinkingExpr db imps su s of
                                                        [] -> typeLinkingFailure' ("Attr no match " ++ (show s) ++ (show m))
                                                        --should handle Class and instance differently
                                                        [tp] -> if isPrimitive tp then typeLinkingFailure' $ "Attribute dereference a primitive " ++ (show tp) else
                                                                    let Just tn = getTypeEntry db (typeToName tp)
                                                                        syms = [node | node <- traverseInstanceEntryAccessible db cname db ((typeToName tp)++[m])]
                                                                        syms' = if accessibleType db cname (symbol tn) then syms else [node | node <- syms, not $ elem "protected" ((symbolModifiers . symbol) node)]--typeLinkingFailure' $ "no protected fields " ++ (show flds)--
                                                                    in case syms' of
                                                                        [] -> typeLinkingFailure' ("Attr no match on member " ++ (show expr) ++ (show ((typeToName tp)++[m])))
                                                                        --instance look up should not return multiple candidates
                                                                        nodes -> map symbol nodes
                                                        _ -> typeLinkingFailure' ("Attr multi " ++ (show s) ++ (show m))
    where
        cname = (typeToName . lookUpThis) su
symbolLinkingExpr db imps su expr@(Attribute s m _) = case typeLinkingExpr db imps su s of
                                                        [] -> typeLinkingFailure' ("Attr no match " ++ (show s) ++ (show m))
                                                        --should handle Class and instance differently
                                                        [tp] -> if isPrimitive tp then typeLinkingFailure' $ "Attribute dereference a primitive " ++ (show tp) else
                                                                    let Just tn = getTypeEntry db (typeToName tp)
                                                                        syms = [node | node <- traverseInstanceEntryAccessible db cname db ((typeToName tp)++[m])]
                                                                        syms' = if accessibleType db cname (symbol tn) then syms else [node | node <- syms, not $ elem "protected" ((symbolModifiers . symbol) node)]--typeLinkingFailure' $ "no protected fields " ++ (show flds)--
                                                                    in case syms' of
                                                                        [] -> typeLinkingFailure' ("Attr no match on member " ++ (show expr) ++ (show ((typeToName tp)++[m])))
                                                                        --instance look up should not return multiple candidates
                                                                        nodes -> map symbol nodes
                                                        _ -> typeLinkingFailure' ("Attr multi " ++ (show s) ++ (show m))
    where
        cname = (typeToName . lookUpThis) su