Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
# https://rust-lang.github.io/rustup/concepts/profiles.html
profile = "default"
# When updating, it might be necessary to run `nix flake update`.
channel = "1.90.0"
channel = "1.96.0"
8 changes: 7 additions & 1 deletion src/typechecker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -491,8 +491,14 @@ impl<'a> Typechecker<'a> {
types.insert(then_type_id);
types.insert(else_type_id);
self.create_oneof(types)
} else if then_type_id != NONE_TYPE {
// If the then-block is not a statement, then the
// resulting type is OneOf(Nothing, then_type)
let mut types = HashSet::new();
types.insert(then_type_id);
types.insert(NONE_TYPE);
self.create_oneof(types)
} else {
// If there's no else block, the if expression is a statement
NONE_TYPE
}
}
Expand Down
Loading