Skip to content

Commit a348ef6

Browse files
Improve error reporting for interop (#391)
1 parent 0a1cf70 commit a348ef6

File tree

5 files changed

+364
-80
lines changed

5 files changed

+364
-80
lines changed

compiler+runtime/include/cpp/jank/error.hpp

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,22 @@ namespace jank::error
7979
analyze_unresolved_symbol,
8080
analyze_macro_expansion_exception,
8181
analyze_invalid_conversion,
82+
analyze_invalid_cpp_operator_call,
83+
analyze_invalid_cpp_constructor_call,
84+
analyze_invalid_cpp_member_call,
85+
analyze_invalid_cpp_function_call,
86+
analyze_invalid_cpp_call,
87+
analyze_invalid_cpp_conversion,
88+
analyze_invalid_cpp_symbol,
89+
analyze_unresolved_cpp_symbol,
90+
analyze_invalid_cpp_raw,
91+
analyze_invalid_cpp_type,
92+
analyze_invalid_cpp_cast,
93+
analyze_invalid_cpp_box,
94+
analyze_invalid_cpp_unbox,
95+
analyze_invalid_cpp_new,
96+
analyze_invalid_cpp_delete,
97+
analyze_invalid_cpp_member_access,
8298
internal_analyze_failure,
8399

84100
internal_codegen_failure,
@@ -227,6 +243,38 @@ namespace jank::error
227243
case kind::system_clang_executable_not_found:
228244
return "system/clang-executable-not-found";
229245

246+
case kind::analyze_invalid_cpp_operator_call:
247+
return "analyze/invalid-cpp-operator-call";
248+
case kind::analyze_invalid_cpp_constructor_call:
249+
return "analyze/invalid-cpp-constructor-call";
250+
case kind::analyze_invalid_cpp_member_call:
251+
return "analyze/invalid-cpp-member-call";
252+
case kind::analyze_invalid_cpp_function_call:
253+
return "analyze/invalid-cpp-function-call";
254+
case kind::analyze_invalid_cpp_call:
255+
return "analyze/invalid-cpp-call";
256+
case kind::analyze_invalid_cpp_conversion:
257+
return "analyze/invalid-cpp-conversion";
258+
case kind::analyze_invalid_cpp_symbol:
259+
return "analyze/invalid-cpp-symbol";
260+
case kind::analyze_unresolved_cpp_symbol:
261+
return "analyze/unresolved-cpp-symbol";
262+
case kind::analyze_invalid_cpp_raw:
263+
return "analyze/invalid-cpp-raw";
264+
case kind::analyze_invalid_cpp_type:
265+
return "analyze/invalid-cpp-type";
266+
case kind::analyze_invalid_cpp_cast:
267+
return "analyze/invalid-cpp-cast";
268+
case kind::analyze_invalid_cpp_box:
269+
return "analyze/invalid-cpp-box";
270+
case kind::analyze_invalid_cpp_unbox:
271+
return "analyze/invalid-cpp-unbox";
272+
case kind::analyze_invalid_cpp_new:
273+
return "analyze/invalid-cpp-new";
274+
case kind::analyze_invalid_cpp_delete:
275+
return "analyze/invalid-cpp-delete";
276+
case kind::analyze_invalid_cpp_member_access:
277+
return "analyze/invalid-cpp-member-access";
230278
case kind::internal_analyze_failure:
231279
return "internal/analysis-failure";
232280
case kind::internal_codegen_failure:

compiler+runtime/include/cpp/jank/error/analyze.hpp

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,64 @@ namespace jank::error
9393
read::source const &source,
9494
runtime::object_ref expansion);
9595
error_ref analyze_invalid_conversion(jtl::immutable_string const &message);
96+
error_ref analyze_invalid_cpp_operator_call(jtl::immutable_string const &message,
97+
read::source const &source,
98+
runtime::object_ref expansion);
99+
error_ref analyze_invalid_cpp_constructor_call(jtl::immutable_string const &message,
100+
read::source const &source,
101+
runtime::object_ref expansion);
102+
error_ref analyze_invalid_cpp_member_call(jtl::immutable_string const &message,
103+
read::source const &source,
104+
runtime::object_ref expansion);
105+
error_ref analyze_invalid_cpp_function_call(jtl::immutable_string const &message,
106+
read::source const &source,
107+
runtime::object_ref expansion);
108+
error_ref analyze_invalid_cpp_call(jtl::immutable_string const &message,
109+
read::source const &source,
110+
runtime::object_ref expansion);
111+
error_ref analyze_invalid_cpp_conversion(jtl::immutable_string const &message,
112+
read::source const &source,
113+
runtime::object_ref expansion);
114+
error_ref analyze_invalid_cpp_symbol(jtl::immutable_string const &message,
115+
read::source const &source,
116+
runtime::object_ref expansion);
117+
error_ref analyze_unresolved_cpp_symbol(jtl::immutable_string const &message,
118+
read::source const &source,
119+
jtl::immutable_string const &note_message,
120+
runtime::object_ref expansion);
121+
error_ref analyze_invalid_cpp_raw(jtl::immutable_string const &message,
122+
read::source const &source,
123+
runtime::object_ref expansion);
124+
error_ref analyze_invalid_cpp_type(jtl::immutable_string const &message,
125+
read::source const &source,
126+
jtl::immutable_string const &note_message,
127+
runtime::object_ref expansion);
128+
error_ref analyze_invalid_cpp_type(jtl::immutable_string const &message,
129+
read::source const &source,
130+
runtime::object_ref expansion);
131+
error_ref analyze_invalid_cpp_cast(jtl::immutable_string const &message,
132+
read::source const &source,
133+
jtl::immutable_string const &note_message,
134+
runtime::object_ref expansion);
135+
error_ref analyze_invalid_cpp_box(jtl::immutable_string const &message,
136+
read::source const &source,
137+
jtl::immutable_string const &note_message,
138+
runtime::object_ref expansion);
139+
error_ref analyze_invalid_cpp_unbox(jtl::immutable_string const &message,
140+
read::source const &source,
141+
jtl::immutable_string const &note_message,
142+
runtime::object_ref expansion);
143+
error_ref analyze_invalid_cpp_new(jtl::immutable_string const &message,
144+
read::source const &source,
145+
jtl::immutable_string const &note_message,
146+
runtime::object_ref expansion);
147+
error_ref analyze_invalid_cpp_delete(jtl::immutable_string const &message,
148+
read::source const &source,
149+
jtl::immutable_string const &note_message,
150+
runtime::object_ref expansion);
151+
error_ref analyze_invalid_cpp_member_access(jtl::immutable_string const &message,
152+
read::source const &source,
153+
runtime::object_ref expansion);
96154
error_ref
97155
internal_analyze_failure(jtl::immutable_string const &message, runtime::object_ref expansion);
98156
error_ref internal_analyze_failure(jtl::immutable_string const &message,

0 commit comments

Comments
 (0)