Improve diagnostics for duplicated names

This commit is contained in:
J Henry Waugh
2020-08-27 22:26:05 -05:00
parent a50da4bb8c
commit 525ffe6f5a
9 changed files with 189 additions and 1 deletions

View File

@@ -0,0 +1,31 @@
use rhai::plugin::*;
#[derive(Clone)]
pub struct Point {
x: f32,
y: f32,
}
#[export_module]
pub mod test_module {
pub use super::Point;
pub fn test_fn(input: Point) -> bool {
input.x > input.y
}
pub fn test_fn(input: Point) -> bool {
input.x < input.y
}
}
fn main() {
let n = Point {
x: 0.0,
y: 10.0,
};
if test_module::test_fn(n) {
println!("yes");
} else {
println!("no");
}
}