You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @mattsse ! How do I get foundry_compilers to throw errors when compiling faulty code? I wrote a Solidity code with syntax errors, and expect it to fail, but foundry_compilers compiles it.
use foundry_compilers::{Project,ProjectPathsConfig};fnmain(){let project = Project::builder().paths(ProjectPathsConfig::hardhat("/home/august/bad_code_solidity_hardhat").unwrap()).build().unwrap();ifletErr(e) = project.compile(){// The compilation failed, `e` contains the error.eprintln!("Compilation failed with error: {:?}", e);}
project.rerun_if_sources_changed();}
When I do cargo run I get the following output
Compiling compiler-test v0.1.0 (..../compiler-test)
Finished dev [unoptimized + debuginfo] target(s) in 2.16s
Running `target/debug/compiler-test`
cargo:rerun-if-changed=/home/august/bad_code_solidity_hardhat
Time taken: 2 seconds
ref foundry-rs/foundry#6722
this should improve error formatting and ideally highlight the conflicting versions
compilers/src/resolver/mod.rs
Lines 607 to 609 in 314c917
The text was updated successfully, but these errors were encountered: