resolve definition IDs in error messages #29

Closed
opened 2021-09-25 14:31:56 +08:00 by sb10q · 3 comments

This would be a significant improvement over the current messages such as "Cannot unify 1 with 0 at line 10 column 21"

This would be a significant improvement over the current messages such as "Cannot unify 1 with 0 at line 10 column 21"
sb10q added the
high-priority
label 2021-09-25 14:32:18 +08:00
Poster
Owner

I meant, instead of printing "1 with 0", print the class names "Foo with Bar". The code you committed does not do that AFAICT?

I meant, instead of printing "1 with 0", print the class names "Foo with Bar". The code you committed does not do that AFAICT?
sb10q reopened this issue 2021-09-26 07:47:04 +08:00

I meant, instead of printing "1 with 0", print the class names "Foo with Bar". The code you committed does not do that AFAICT?

It was already implemented, just missing some config in the toplevel module. You can try it.

Example:

setup time: 0ms
parse time: 0ms
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "Cannot unify int32 with B at line 25 column 15"', nac3standalone/src/main.rs:84:35
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: core::result::Result<T,E>::unwrap
             at /build/rustc-1.52.1-src/library/core/src/result.rs:1037:23
   4: nac3standalone::main
             at ./src/main.rs:84:5
   5: core::ops::function::FnOnce::call_once
             at /build/rustc-1.52.1-src/library/core/src/ops/function.rs:227:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
diff --git a/nac3standalone/demo/classes.py b/nac3standalone/demo/classes.py
index b2c534c..ca95094 100644
@@ -22,7 +22,7 @@ class B:
 
 def run() -> int32:
     a = A(10)
-    output_int(a.a)
+    output_int(a.b)
 
     a = A(20)
     output_int(a.a)
> I meant, instead of printing "1 with 0", print the class names "Foo with Bar". The code you committed does not do that AFAICT? It was already implemented, just missing some config in the toplevel module. You can try it. Example: ``` setup time: 0ms parse time: 0ms thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "Cannot unify int32 with B at line 25 column 15"', nac3standalone/src/main.rs:84:35 stack backtrace: 0: rust_begin_unwind 1: core::panicking::panic_fmt 2: core::result::unwrap_failed 3: core::result::Result<T,E>::unwrap at /build/rustc-1.52.1-src/library/core/src/result.rs:1037:23 4: nac3standalone::main at ./src/main.rs:84:5 5: core::ops::function::FnOnce::call_once at /build/rustc-1.52.1-src/library/core/src/ops/function.rs:227:5 note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace. ``` ```diff diff --git a/nac3standalone/demo/classes.py b/nac3standalone/demo/classes.py index b2c534c..ca95094 100644 @@ -22,7 +22,7 @@ class B: def run() -> int32: a = A(10) - output_int(a.a) + output_int(a.b) a = A(20) output_int(a.a) ```
Poster
Owner

OK, thanks

OK, thanks
sb10q closed this issue 2021-09-26 23:29:37 +08:00
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: M-Labs/nac3#29
There is no content yet.