Skip to content

Commit

Permalink
Impl boolean logic op typing
Browse files Browse the repository at this point in the history
  • Loading branch information
Amejonah1200 committed Sep 22, 2023
1 parent f4c707e commit ed2e628
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/resolution/type_resolution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,7 @@ impl<'a> ResolutionEnv<'a> {
_,
(Some(PrimitiveType::Float(w1)), Some(PrimitiveType::Float(w2))),
) => self.resolve_primitive(PrimitiveType::Float(w1.max(w2))),
(Logic, _, (Some(PrimitiveType::Boolean), Some(PrimitiveType::Boolean))) => lhs.info,
(_, _, (Some(lhs), Some(rhs))) => todo!(
"resolve_binary/other ops: {}, {}, PrimitiveType::{} and PrimitiveType::{}",
group,
Expand Down
2 changes: 1 addition & 1 deletion tests/test-projects/001/src/main.aplang
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ fn main() {
val person = Person(r"Amejonah", 42u8, Address(r"a", 12u16))
test_person(person)
val test = person.a
if(1u16) while(1u16) {}
if(true || false) while(1u16) {}
while(1u16) {}
test_wrong_return(r"6es6") = 0u16
b.a.b = test_wrong_return(16u16)
Expand Down

0 comments on commit ed2e628

Please sign in to comment.