From ed2e6284122d0556d87be1477ebb20c47d5b87c2 Mon Sep 17 00:00:00 2001 From: Amejonah1200 Date: Fri, 22 Sep 2023 19:15:01 +0200 Subject: [PATCH] Impl boolean logic op typing --- src/resolution/type_resolution.rs | 1 + tests/test-projects/001/src/main.aplang | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/resolution/type_resolution.rs b/src/resolution/type_resolution.rs index b0436f9..8347dc4 100644 --- a/src/resolution/type_resolution.rs +++ b/src/resolution/type_resolution.rs @@ -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, diff --git a/tests/test-projects/001/src/main.aplang b/tests/test-projects/001/src/main.aplang index 36bfc55..75437c0 100644 --- a/tests/test-projects/001/src/main.aplang +++ b/tests/test-projects/001/src/main.aplang @@ -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)