Skip to content
Snippets Groups Projects
Commit f54652bc authored by Lukas Stadler's avatar Lukas Stadler
Browse files

"unimplemented" with message in RInternalError

parent 450d5557
Branches
No related tags found
No related merge requests found
/*
* Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -40,7 +40,7 @@ public interface RSyntaxNode {
* implementation convenience.
*/
default void deparse(@SuppressWarnings("unused") State state) {
throw RInternalError.unimplemented();
throw RInternalError.unimplemented("deparse not implemented in " + getClass());
}
/**
......@@ -50,7 +50,7 @@ public interface RSyntaxNode {
* that no changes were made.
*/
default RNode substitute(@SuppressWarnings("unused") REnvironment env) {
throw RInternalError.unimplemented();
throw RInternalError.unimplemented("substitute not implemented in " + getClass());
}
/**
......
......@@ -50,6 +50,11 @@ public final class RInternalError extends Error {
throw new RInternalError("not implemented");
}
public static RuntimeException unimplemented(String message) {
CompilerDirectives.transferToInterpreter();
throw new RInternalError("not implemented: %s", message);
}
public static RuntimeException shouldNotReachHere() {
CompilerDirectives.transferToInterpreter();
throw new RInternalError("should not reach here");
......@@ -60,9 +65,9 @@ public final class RInternalError extends Error {
throw new RInternalError(cause, "should not reach here");
}
public static RuntimeException shouldNotReachHere(String msg) {
public static RuntimeException shouldNotReachHere(String message) {
CompilerDirectives.transferToInterpreter();
throw new RInternalError("should not reach here: %s", msg);
throw new RInternalError("should not reach here: %s", message);
}
static void reportError(Throwable t, SourceSection source) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment