import lib
print lib.version
lib.drawPixel(40, 20)
class D {
fn drawPixel2(self) {
lib.drawPixel(40, 20)
}
}
lib.drawPixel(40, 20) # CASE 1: works fine
(D()).drawPixel2() # CASE 2: crashes and passes <module lib> as the first argument to `lib.drawPixel`
Stack Trace of Error
thread 'Main' panicked at compiler\src\ast\function_arguments.rs:59:21:
internal error: entered unreachable code: <module ".\\lib.ms">
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at src\main.rs:163:32:
called `Result::unwrap()` on an `Err` value: Any { .. }
Expected Behavior
lib.drawPixel is not an associated function, and should not take module as the first argument.
Any ideas where MScript breaks?
[ ] Bytecode Interpreter
[X] Compiler
[ ] Optimizer
[ ] Not Sure (It's okay!)
[ ] Other: please explain
Brain Dump (Optional)
Previously, this bug also emerged for CASE 1 but was resolved by explicitly checking for this edge case. To fix CASE 2, I might have to look into more core parsing behavior to find the root of the issue.
Snippet Responsible
Stack Trace of Error
Expected Behavior
lib.drawPixel
is not an associated function, and should not takemodule
as the first argument.Any ideas where MScript breaks?
Brain Dump (Optional)
Previously, this bug also emerged for
CASE 1
but was resolved by explicitly checking for this edge case. To fixCASE 2
, I might have to look into more core parsing behavior to find the root of the issue.