From 6793563a7c971618503dac7b9cc339dd5f726869 Mon Sep 17 00:00:00 2001 From: David Mak Date: Fri, 9 Aug 2024 15:47:05 +0800 Subject: [PATCH] WIP8 - Expected Type --- nac3artiq/src/codegen.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nac3artiq/src/codegen.rs b/nac3artiq/src/codegen.rs index 5aef9c80..f84db0a8 100644 --- a/nac3artiq/src/codegen.rs +++ b/nac3artiq/src/codegen.rs @@ -24,7 +24,7 @@ use pyo3::{ use crate::{symbol_resolver::InnerResolver, timeline::TimeFns}; -use inkwell::values::PointerValue; +use inkwell::values::{PointerValue, StructValue}; use itertools::Itertools; use nac3core::codegen::classes::{ListValue, NDArrayValue, RangeValue, UntypedArrayLikeAccessor}; use nac3core::codegen::expr::destructure_range; @@ -1096,7 +1096,7 @@ pub fn call_core_log_impl<'ctx>( pub fn call_rtio_log_impl<'ctx>( ctx: &mut CodeGenContext<'ctx, '_>, generator: &mut dyn CodeGenerator, - channel: PointerValue<'ctx>, + channel: StructValue<'ctx>, arg: (Type, BasicValueEnum<'ctx>), ) -> Result<(), String> { let (arg_ty, arg_val) = arg; @@ -1146,7 +1146,7 @@ pub fn gen_rtio_log<'ctx>( let channel_ty = fun.0.args[0].ty; assert!(ctx.unifier.unioned(channel_ty, ctx.primitives.str)); let channel_arg = - args[0].1.clone().to_basic_value_enum(ctx, generator, channel_ty)?.into_pointer_value(); + args[0].1.clone().to_basic_value_enum(ctx, generator, channel_ty)?.into_struct_value(); let value_ty = fun.0.args[1].ty; let value_arg = args[1].1.clone().to_basic_value_enum(ctx, generator, value_ty)?;