private static boolean checkRankProfileInheritanceCollisions(ParseContext context, Symbol rankProfileDefinitionSymbol, Symbol inheritanceCandidate, SchemaNode inheritanceNode, List<Diagnostic> diagnostics) {
        Map<String, Symbol> functionDefinitionsBeforeInheritance = new HashMap<>();
        for (Symbol symbol : context.schemaIndex().listSymbolsInScope(rankProfileDefinitionSymbol, SymbolType.FUNCTION)) {
            // Skip shadowing inside the current rank-profile
            if (symbol.getScope().equals(rankProfileDefinitionSymbol)) continue;

            functionDefinitionsBeforeInheritance.put(symbol.getShortIdentifier(), symbol.getScope());
        }

        List<Symbol> newInheritedFunctions = context.schemaIndex().listSymbolsInScope(inheritanceCandidate, SymbolType.FUNCTION);

        boolean success = true;
        for (Symbol parentFunction : newInheritedFunctions) {
            if (functionDefinitionsBeforeInheritance.containsKey(parentFunction.getShortIdentifier())) {
                diagnostics.add(new SchemaDiagnostic.Builder()
                    .setRange(inheritanceNode.getRange())
                    .setMessage(
                        "Cannot inherit from " + inheritanceNode.getText() + " because " + inheritanceNode.getText() + 
                        " defines function " + parentFunction.getShortIdentifier() + " which is already defined in " + 
                        functionDefinitionsBeforeInheritance.get(parentFunction.getShortIdentifier()).getShortIdentifier()
                    )
                    .setSeverity(DiagnosticSeverity.Error)
                    .build()
                );
                success = false;
            }
        }
        return success;
    }
Assuming first parsing step is done, use the list of unresolved inheritance
declarations to register the inheritance at index.
@return List of diagnostic found during inheritance handling
integration/schema-language-server/language-server/src/main/java/ai/vespa/schemals/schemadocument/resolvers/InheritanceResolver.java