Search in sources :

Example 1 with NOT_FOUND_ENTRY

use of org.wso2.ballerinalang.compiler.semantics.model.Scope.NOT_FOUND_ENTRY in project ballerina by ballerina-lang.

the class SymbolResolver method resolveOperator.

private BSymbol resolveOperator(ScopeEntry entry, List<BType> types) {
    BSymbol foundSymbol = symTable.notFoundSymbol;
    while (entry != NOT_FOUND_ENTRY) {
        BInvokableType opType = (BInvokableType) entry.symbol.type;
        if (types.size() == opType.paramTypes.size()) {
            boolean match = true;
            for (int i = 0; i < types.size(); i++) {
                if (types.get(i).tag != opType.paramTypes.get(i).tag) {
                    match = false;
                }
            }
            if (match) {
                foundSymbol = entry.symbol;
                break;
            }
        }
        entry = entry.next;
    }
    return foundSymbol;
}
Also used : BSymbol(org.wso2.ballerinalang.compiler.semantics.model.symbols.BSymbol) BInvokableType(org.wso2.ballerinalang.compiler.semantics.model.types.BInvokableType)

Aggregations

BSymbol (org.wso2.ballerinalang.compiler.semantics.model.symbols.BSymbol)1 BInvokableType (org.wso2.ballerinalang.compiler.semantics.model.types.BInvokableType)1