From f0dae474dff22e9cfbeb0b48afbfaf879bbde3ac Mon Sep 17 00:00:00 2001 From: Pavel Marek Date: Thu, 14 Nov 2024 18:08:44 +0100 Subject: [PATCH] Warning exports InteropLibrary which delegates to value. With the exception of toDisplayString message. --- .../org/enso/interpreter/runtime/warning/Warning.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/engine/runtime/src/main/java/org/enso/interpreter/runtime/warning/Warning.java b/engine/runtime/src/main/java/org/enso/interpreter/runtime/warning/Warning.java index 1ca8ecae5ea..b6025eb2abd 100644 --- a/engine/runtime/src/main/java/org/enso/interpreter/runtime/warning/Warning.java +++ b/engine/runtime/src/main/java/org/enso/interpreter/runtime/warning/Warning.java @@ -20,8 +20,9 @@ import org.enso.interpreter.runtime.library.dispatch.TypesLibrary; @Builtin(pkg = "error", stdlibName = "Standard.Base.Warning.Warning") @ExportLibrary(TypesLibrary.class) +@ExportLibrary(value = InteropLibrary.class, delegateTo = "value") public final class Warning extends EnsoObject { - private final Object value; + final Object value; private final Object origin; private final long sequenceId; @@ -106,6 +107,12 @@ public final class Warning extends EnsoObject { return map; } + @ExportMessage + @Override + public Object toDisplayString(boolean enableSideEffects) { + return toString(); + } + @CompilerDirectives.TruffleBoundary @Override public String toString() {