Warning exports InteropLibrary which delegates to value.

With the exception of toDisplayString message.
This commit is contained in:
Pavel Marek 2024-11-14 18:08:44 +01:00
parent 7fa2022b8c
commit f0dae474df

View File

@ -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() {