Cannot divide numbers of different types
Gipson62 opened this issue · 3 comments
Gipson62 commented
Got this issue will trying to divide an Int64
with a Float64
! Pretty annoying
thread 'main' panicked at 'Cannot divide numbers of different types', reg-lang-runtime/src/types/number/base_number.rs:134:18
stack backtrace:
0: rust_begin_unwind
at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:575:5
1: core::panicking::panic_fmt
at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/panicking.rs:65:14
2: <reg_lang_runtime::types::number::base_number::Numbers as reg_lang_runtime::types::number::base_number::Arithmetics>::div
at ./reg-lang-runtime/src/types/number/base_number.rs:134:18
3: reg_lang_runtime::operation
at ./reg-lang-runtime/src/lib.rs:107:20
4: reg_lang_runtime::run
at ./reg-lang-runtime/src/lib.rs:65:27
5: reg_lang::main
at ./reg-lang/src/main.rs:23:5
6: core::ops::function::FnOnce::call_once
at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/ops/function.rs:251:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Gipson62 commented
Even with the new PR, the problem stays. Except that the new Interpreter doesn't allow us to use multiple number types.
Gipson62 commented
Need to wait a bit and implement the float type. For now there only is the INT type and later on we gonna add the FLOAT type for number (just in the arithmetic instructions)
PS: a "paper" who explain how I'm gonna make is currently writing.