Skip to content

Commit

Permalink
Fix benches, add a comment
Browse files Browse the repository at this point in the history
  • Loading branch information
jneem committed Oct 24, 2024
1 parent 7e42fa7 commit 2343582
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
11 changes: 9 additions & 2 deletions cli/src/typecheck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,15 @@ pub struct TypecheckCommand {
impl TypecheckCommand {
pub fn run(self, global: GlobalOptions) -> CliResult<()> {
if self.strict_typechecking {
// In strict mode we run *both* forms of typechecking, because in fact neither one
// is more strict than the other.
// In strict mode we run *both* forms of typechecking, because in
// fact neither one is more strict than the other. For example,
// given the input
//
// let x = (1 + 1) in (x + 1 : Number)
//
// typechecking in "enforce" mode will succeed because it will infer
// `x: Number`, while typechecking in walk mode will fail because it
// will treat `x` as `Dyn` and then try to typecheck `x + 1`.
let mut program = self.inputs.prepare(&global)?;
program
.typecheck(TypecheckMode::Enforce)
Expand Down
1 change: 1 addition & 0 deletions utils/src/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ macro_rules! ncl_bench_group {
cache::{Envs, Cache, ErrorTolerance, ImportResolver, InputFormat},
eval::{VirtualMachine, cache::{CacheImpl, Cache as EvalCache}},
transform::import_resolution::strict::resolve_imports,
typecheck::TypecheckMode,
error::report::{report, ColorOpt, ErrorFormat},
};

Expand Down

0 comments on commit 2343582

Please sign in to comment.