Skip to content

Commit 9d70bc1

Browse files
puredangerstuarthalloway
authored andcommitted
CLJ-1745 Revert wrapping of macro exceptions in CompilerException from CLJ-1169
Signed-off-by: Stuart Halloway <stu@cognitect.com>
1 parent 41af6b2 commit 9d70bc1

File tree

3 files changed

+2
-12
lines changed

3 files changed

+2
-12
lines changed

src/jvm/clojure/lang/Compiler.java

-10
Original file line numberDiff line numberDiff line change
@@ -6635,16 +6635,6 @@ public static Object macroexpand1(Object x) {
66356635
// hide the 2 extra params for a macro
66366636
throw new ArityException(e.actual - 2, e.name);
66376637
}
6638-
catch(Throwable e)
6639-
{
6640-
if(!(e instanceof CompilerException)) {
6641-
Integer line = (Integer) LINE.deref();
6642-
Integer column = (Integer) COLUMN.deref();
6643-
String source = (String) SOURCE.deref();
6644-
throw new CompilerException(source, line, column, e);
6645-
} else
6646-
throw (CompilerException) e;
6647-
}
66486638
}
66496639
else
66506640
{

test/clojure/test_clojure/control.clj

+1-1
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@
373373
:a (char 97)))
374374
(testing "test error on duplicate test constants"
375375
(is (thrown-with-msg?
376-
clojure.lang.Compiler$CompilerException
376+
IllegalArgumentException
377377
#"Duplicate case test constant: 1"
378378
(eval `(case 0 1 :x 1 :y)))))
379379
(testing "test correct behaviour on Number truncation"

test/clojure/test_clojure/errors.clj

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
["let .* in %s:\\d+" '(let [a])]
4949
["let .* in %s:\\d+" '(let (a))]
5050
["renamed-with-open .* in %s:\\d+" '(renamed-with-open [a])]]]
51-
(is (thrown-with-msg? clojure.lang.Compiler$CompilerException
51+
(is (thrown-with-msg? IllegalArgumentException
5252
(re-pattern (format msg-regex-str *ns*))
5353
(macroexpand form)))))
5454

0 commit comments

Comments
 (0)