make it okay to miss a method pointer - just return null

This commit is contained in:
Radosław Waśko 2024-10-29 12:23:15 +01:00
parent 3e78eb7daa
commit 8d060ca3d0
2 changed files with 28 additions and 25 deletions

View File

@ -138,8 +138,9 @@ public abstract class BuildScopeFromModuleAlgorithm<
MetadataInteropHelpers.getMetadataOrNull(
typePointerOpt.get(), MethodDefinitions$.MODULE$, BindingsMap.Resolution.class);
if (metadata == null) {
throw new IllegalStateException(
"Failed to resolve type pointer for method: " + method.methodReference().showCode());
logger.debug(
"Failed to resolve type pointer for method: {}", method.methodReference().showCode());
return null;
}
return switch (metadata.target()) {

View File

@ -317,30 +317,32 @@ class IrToTruffle(
.flatMap(sig => getContext(sig.signature))
val cons = getTypeAssociatedWithMethod(method)
val fullMethodDefName =
cons.getName ++ Constants.SCOPE_SEPARATOR ++ method.methodName.name
val expressionProcessor = new ExpressionProcessor(
fullMethodDefName,
() => scopeInfo().graph,
() => scopeInfo().graph.rootScope,
dataflowInfo,
fullMethodDefName,
frameInfo
)
if (cons != null) {
val fullMethodDefName =
cons.getName ++ Constants.SCOPE_SEPARATOR ++ method.methodName.name
val expressionProcessor = new ExpressionProcessor(
fullMethodDefName,
() => scopeInfo().graph,
() => scopeInfo().graph.rootScope,
dataflowInfo,
fullMethodDefName,
frameInfo
)
scopeBuilder.registerMethod(
cons,
method.methodName.name,
() => {
buildFunction(
method,
effectContext,
cons,
fullMethodDefName,
expressionProcessor
)
}
)
scopeBuilder.registerMethod(
cons,
method.methodName.name,
() => {
buildFunction(
method,
effectContext,
cons,
fullMethodDefName,
expressionProcessor
)
}
)
}
}
override protected def processTypeDefinition(typ: Definition.Type): Unit = {