forked from M-Labs/nac3
1
0
Fork 0

WIP8 - Expected Type

This commit is contained in:
David Mak 2024-08-09 15:47:05 +08:00
parent 2a1d76213f
commit 6793563a7c
1 changed files with 3 additions and 3 deletions

View File

@ -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)?;