Enable dot operations on constant variables.

This commit is contained in:
Stephen Chung
2020-03-20 19:27:02 +08:00
parent 16ea8f416e
commit ed996e71d6
7 changed files with 385 additions and 238 deletions

View File

@@ -23,10 +23,10 @@ fn test_type_of() -> Result<(), EvalAltResult> {
assert_eq!(engine.eval::<String>(r#"type_of("hello")"#)?, "string");
#[cfg(not(feature = "only_i32"))]
assert_eq!(engine.eval::<String>("let x = 123; x.type_of()")?, "i64");
assert_eq!(engine.eval::<String>("let x = 123; type_of(x)")?, "i64");
#[cfg(feature = "only_i32")]
assert_eq!(engine.eval::<String>("let x = 123; x.type_of()")?, "i32");
assert_eq!(engine.eval::<String>("let x = 123; type_of(x)")?, "i32");
Ok(())
}