-
Notifications
You must be signed in to change notification settings - Fork 15
[BUG] Syntax Errors in Core files in internal functions causes weird error messages #65
Copy link
Copy link
Open
Description
Describe the bug
If making an internal trait in the core standard library, (say string.rv) and any keywords are misspelled, the parser panics and also displays an incorrect parsing error message.
Raven Code To Reproduce
in string.rv:
internal impl Add<char, str> for char {
pub fun add(self, other: str) -> str {
// ^ wrong token
}
}
Error Output or Unexpected Behavior
when running cargo test --bin magpie -- --nocapture:
running 1 test
Running arrays::test
thread 'io-runtime' panicked at language\parser\src\parser\struct_parser.rs:204:18:
How'd you get here? string - FieldName (2, lic fn add(self, other)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Errors:
Failed to find type strcmp, did you import it correctly?
in file string.rv:16:21
|
16 | return strcmp(self, other) == 0;
| ^
thread 'test::test::test_magpie' panicked at tools\magpie\src\test.rs:52:32:
Failed to compile test arrays::test!
test test::test::test_magpie ... FAILED
failures:
failures:
test::test::test_magpie
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.03s
error: test failed, to rerun pass `-p magpie --bin magpie`
Additional context
This may or may not happen in other places, but this place is for sure.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels