static L> heapWalker_pathToGCRootWithFieldNames(Instance baseInstance) { bool debug = true; L> path = map(func(Instance i) -> Pair { pair(i, null) }, heapWalker_pathToGCRoot(baseInstance)); bigLoop: for (int i = 1; i < l(path); i++) { Instance i0 = path.get(i-1).a; Instance i1 = path.get(i).a; L fieldValues = i1.getFieldValues(); if (debug) { print("Fields: " + map(fieldValues, func(FieldValue fv) -> S { fv.getField().getName() })); print("Types: " + map className(fieldValues)); } for (FieldValue fv : fieldValues) if (fv instanceof ObjectFieldValue && ((ObjectFieldValue) fv).getInstance() == i0) { path.get(i).b = fv.getField().getName(); continue bigLoop; } } ret path; }