diff --git a/engine/runtime-instrument-common/src/main/java/org/enso/interpreter/service/ExecutionCallbacks.java b/engine/runtime-instrument-common/src/main/java/org/enso/interpreter/service/ExecutionCallbacks.java index a9bbb3e8b8..88d7eecbe4 100644 --- a/engine/runtime-instrument-common/src/main/java/org/enso/interpreter/service/ExecutionCallbacks.java +++ b/engine/runtime-instrument-common/src/main/java/org/enso/interpreter/service/ExecutionCallbacks.java @@ -15,7 +15,6 @@ import org.enso.interpreter.instrument.profiling.ExecutionTime; import org.enso.interpreter.instrument.profiling.ProfilingInfo; import org.enso.interpreter.node.callable.FunctionCallInstrumentationNode; import org.enso.interpreter.runtime.callable.UnresolvedSymbol; -import org.enso.interpreter.runtime.data.EnsoMultiValue; import org.enso.interpreter.runtime.data.Type; import org.enso.interpreter.runtime.library.dispatch.TypeOfNode; import org.enso.interpreter.runtime.type.Constants; @@ -220,22 +219,18 @@ final class ExecutionCallbacks implements IdExecutionService.Callbacks { return new String[] {Constants.UNRESOLVED_SYMBOL}; } - if (value instanceof EnsoMultiValue multiValue) { - var valueTypes = multiValue.allTypes(); - var resultTypes = new String[valueTypes.length]; - - for (int i = 0; i < valueTypes.length; i++) { - resultTypes[i] = getTypeQualifiedName(valueTypes[i]); - } - - return resultTypes; - } - var typeOfNode = TypeOfNode.getUncached(); Object typeResult = value == null ? null : typeOfNode.execute(value); if (typeResult instanceof Type t) { return new String[] {getTypeQualifiedName(t)}; } + if (typeResult instanceof Type[] types) { + var result = new String[types.length]; + for (int i = 0; i < types.length; i++) { + result[i] = getTypeQualifiedName(types[i]); + } + return result; + } return null; } diff --git a/engine/runtime/src/main/java/org/enso/interpreter/runtime/library/dispatch/TypeOfNode.java b/engine/runtime/src/main/java/org/enso/interpreter/runtime/library/dispatch/TypeOfNode.java index 5d5baa4c2a..e0c124c5f3 100644 --- a/engine/runtime/src/main/java/org/enso/interpreter/runtime/library/dispatch/TypeOfNode.java +++ b/engine/runtime/src/main/java/org/enso/interpreter/runtime/library/dispatch/TypeOfNode.java @@ -75,6 +75,11 @@ public abstract class TypeOfNode extends Node { return withoutWarning.execute(value.getValue()); } + @Specialization + Object doEnsoMultiValue(EnsoMultiValue value) { + return value.allTypes(); + } + static boolean isWithType(Object value, TypesLibrary types, InteropLibrary iop) { if (value instanceof EnsoMultiValue) { return true;