Skip to content

Commit

Permalink
Revert "Update runtime Typechecker"
Browse files Browse the repository at this point in the history
This reverts commit e3ebc61.
  • Loading branch information
chiranSachintha committed Jan 9, 2025
1 parent ce793f9 commit 54a9f5d
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1672,14 +1672,14 @@ private static boolean checkObjectEquivalency(Object sourceVal, Type sourceType,
return checkObjectSubTypeForMethods(unresolvedTypes, targetFuncs, sourceFuncs, targetTypeModule,
sourceTypeModule, sourceObjectType, targetType);
}

private static List<MethodType> getAllFunctionsList(BObjectType objectType) {
List<MethodType> functionList = new ArrayList<>(Arrays.asList(objectType.getMethods()));
if (objectType.getTag() == TypeTags.SERVICE_TAG ||
(objectType.flags & SymbolFlags.CLIENT) == SymbolFlags.CLIENT) {
Collections.addAll(functionList, ((BNetworkObjectType) objectType).getResourceMethods());
}

return functionList;
}

Expand Down Expand Up @@ -1793,16 +1793,16 @@ private static Optional<MethodType> getMatchingInvokableType(List<MethodType> rh
if (matchingFunction.isEmpty()) {
return matchingFunction;
}
// For resource function match, we need to check whether lhs function resource path type belongs to
// For resource function match, we need to check whether lhs function resource path type belongs to
// rhs function resource path type
MethodType matchingFunc = matchingFunction.get();
boolean lhsFuncIsResource = SymbolFlags.isFlagOn(lhsFunc.getFlags(), SymbolFlags.RESOURCE);
boolean matchingFuncIsResource = SymbolFlags.isFlagOn(matchingFunc.getFlags(), SymbolFlags.RESOURCE);

if (!lhsFuncIsResource && !matchingFuncIsResource) {
return matchingFunction;
}

if (!lhsFuncIsResource || !matchingFuncIsResource) {
return Optional.empty();
}
Expand Down Expand Up @@ -1900,7 +1900,7 @@ private static boolean checkIsServiceType(Type sourceType, Type targetType, List

return false;
}

public static boolean isInherentlyImmutableType(Type sourceType) {
sourceType = getImpliedType(sourceType);
if (isSimpleBasicType(sourceType)) {
Expand Down Expand Up @@ -3291,4 +3291,4 @@ private static BError createTypeCastError(Object value, Type targetType, List<St

private TypeChecker() {
}
}
}

0 comments on commit 54a9f5d

Please sign in to comment.