Skip to content

Commit

Permalink
Revert "Warning exports WarningsLibrary"
Browse files Browse the repository at this point in the history
This reverts commit a06c672.
  • Loading branch information
Akirathan committed Nov 18, 2024
1 parent a06c672 commit 9f33d74
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
Expand All @@ -13,7 +12,6 @@
import org.enso.interpreter.runtime.EnsoContext;
import org.enso.interpreter.runtime.warning.AppendWarningNode;
import org.enso.interpreter.runtime.warning.Warning;
import org.enso.interpreter.runtime.warning.WarningsLibrary;
import org.enso.interpreter.runtime.warning.WithWarnings;
import org.enso.test.utils.ContextUtils;
import org.graalvm.polyglot.Context;
Expand Down Expand Up @@ -196,11 +194,4 @@ public void warningOnAnError() throws Exception {
assertEquals(
"Standard.Base.Error.Error", errorWithWarning.getMetaObject().getMetaQualifiedName());
}

@Test
public void warningIsWarning_ViaWarningsLibrary() {
var warn = wrap.execute("Warning", 42L);
var warnsLib = WarningsLibrary.getUncached();
assertThat(warnsLib.hasWarnings(warn), is(true));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

@Builtin(pkg = "error", stdlibName = "Standard.Base.Warning.Warning")
@ExportLibrary(TypesLibrary.class)
@ExportLibrary(WarningsLibrary.class)
@ExportLibrary(value = InteropLibrary.class, delegateTo = "value")
public final class Warning extends EnsoObject {
final Object value;
Expand Down Expand Up @@ -134,27 +133,6 @@ Type getType(@Bind("$node") Node node) {
return EnsoContext.get(node).getBuiltins().warning();
}

@ExportMessage
boolean hasWarnings() {
return true;
}

@ExportMessage
EnsoHashMap getWarnings(boolean shouldWrap, @Cached HashMapInsertNode insertNode) {
var map = insertNode.execute(null, EnsoHashMap.empty(), 0, this);
return map;
}

@ExportMessage
Object removeWarnings() throws UnsupportedMessageException {
throw UnsupportedMessageException.create();
}

@ExportMessage
boolean isLimitReached() {
return true;
}

public static Warning wrapMapError(WarningsLibrary warningsLib, Warning warning, long index) {
var ctx = EnsoContext.get(warningsLib);
var error = warning.getValue();
Expand Down

0 comments on commit 9f33d74

Please sign in to comment.