diff --git a/.vscode/settings.json b/.vscode/settings.json index 53ab3035..634ceda6 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -4,7 +4,9 @@ // "sus_lsp.executable_path": "${workspaceFolder}/target/release/sus_compiler", "sus_lsp.tcp_port": 25000, "sus_lsp.args": [ - "--lsp" + "--lsp", + // Tracking down slow compilations + "--kill-timeout", "2000ms" //, "--upto", "typecheck" ], "editor.lineHeight": 0, diff --git a/Cargo.toml b/Cargo.toml index fe0d242b..12a387b0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -51,6 +51,7 @@ lsp-server = {version = "0.7.1", optional = true} lsp-types = {version = "0.94.0", optional = true} serde_json = {version = "1.0.97", optional = true} serde = {version = "1.0.156", optional = true} +humantime = "2.2.0" [build-dependencies] dirs-next = "2.0.0" diff --git a/bad_syntax.sus b/bad_syntax.sus index c6ba16fb..8f6b2dd8 100644 --- a/bad_syntax.sus +++ b/bad_syntax.sus @@ -2,14 +2,14 @@ // This is there to check for ICEs -module multiply { - interface multiply : int a, int b -> int r +module multiply#(int MIN1, int MAX1, int MIN2, int MAX2) { + interface multiply : int#(MIN: MIN1, MAX: MAX1) a, int#(MIN: MIN2, MAX: MAX2) b -> int r r = a * b } // test module contains_submodule { - interface contains_submodule : int a, int b, int c -> int r + interface contains_submodule : int#(MIN: 0, MAX: 1) a, int b, int c -> int r int tmp = multiply(a, b) reg r = tmp + c } diff --git a/src/alloc.rs b/src/alloc.rs index 6b912ca7..8006d8d5 100644 --- a/src/alloc.rs +++ b/src/alloc.rs @@ -91,9 +91,6 @@ impl UUIDAllocator { self.cur.0 += 1; allocated_id } - pub fn peek(&self) -> UUID { - self.cur - } pub fn to_flat_alloc(&self) -> FlatAlloc { let mut result = FlatAlloc::with_capacity(self.cur.0); for _ in 0..self.cur.0 { @@ -303,6 +300,10 @@ impl ArenaAllocator { PhantomData, ) } + pub fn free_reservation(&mut self, UUID(uuid, _): UUID) { + assert!(self.data[uuid].is_none()); + self.free_slots.push(uuid); + } pub fn revert_to_reservation(&mut self, UUID(uuid, _): UUID) { assert!(self.data[uuid].is_some()); self.data[uuid] = None; @@ -353,6 +354,15 @@ impl ArenaAllocator { .find(|(id, v)| predicate(*id, v)) .map(|(id, _)| id) } + #[track_caller] + pub fn get2_mut( + &mut self, + UUID(uuid_a, _): UUID, + UUID(uuid_b, _): UUID, + ) -> Option<(&mut T, &mut T)> { + get2_mut(&mut self.data, uuid_a, uuid_b) + .map(|(a, b)| (a.as_mut().unwrap(), b.as_mut().unwrap())) + } } impl Index> for ArenaAllocator { @@ -614,8 +624,6 @@ impl FlatAlloc { _ph: PhantomData, } } - #[cfg(test)] - // Only for testing, so only enabled with test flag pub fn from_vec(data: Vec) -> Self { Self { data, @@ -678,17 +686,6 @@ impl FlatAlloc { _ph: PhantomData, } } - pub fn cast_to_array(&self) -> &[T; N] { - assert!(self.len() == N); - self.data.as_slice().try_into().unwrap() - } - pub fn map_to_array( - &self, - mut f: impl FnMut(UUID, &T) -> O, - ) -> [O; N] { - assert!(self.len() == N); - std::array::from_fn(|i| f(UUID::from_hidden_value(i), &self.data[i])) - } pub fn try_map( &self, mut f: impl FnMut((UUID, &T)) -> Result, @@ -702,6 +699,47 @@ impl FlatAlloc { _ph: PhantomData, }) } + pub fn try_map2( + &self, + second: &FlatAlloc, + mut f: impl FnMut((UUID, &T, &T2)) -> Result, + ) -> Result, ET> { + let mut data = Vec::with_capacity(self.len()); + for v in zip_eq(self.iter(), second.iter()) { + data.push(f(v)?); + } + Ok(FlatAlloc { + data, + _ph: PhantomData, + }) + } + pub fn try_map3( + &self, + second: &FlatAlloc, + third: &FlatAlloc, + mut f: impl FnMut((UUID, &T, &T2, &T3)) -> Result, + ) -> Result, ET> { + let mut data = Vec::with_capacity(self.len()); + for v in zip_eq3(self.iter(), second.iter(), third.iter()) { + data.push(f(v)?); + } + Ok(FlatAlloc { + data, + _ph: PhantomData, + }) + } + pub fn cast_to_array(&self) -> [&T; N] { + assert_eq!(self.len(), N); + std::array::from_fn(|i| &self.data[i]) + } + pub fn cast_to_array_mut(&mut self) -> [&mut T; N] { + assert_eq!(self.len(), N); + std::array::from_fn(|i| { + let ptr: *mut T = &mut self.data[i]; + // SAFETY: Of course, the data[i] accesses are all disjoint + unsafe { &mut *ptr } + }) + } pub fn find( &self, mut predicate: impl FnMut(UUID, &T) -> bool, diff --git a/src/append_only_vec.rs b/src/append_only_vec.rs new file mode 100644 index 00000000..6ad68516 --- /dev/null +++ b/src/append_only_vec.rs @@ -0,0 +1,50 @@ +use std::cell::UnsafeCell; + +/// An append-only Vector. The contents cannot be looked at, unless the vector is explicitly consumed. This allows us to present a const-ref [Self::push], which has nice ergonomics +#[derive(Debug)] +pub struct AppendOnlyVec { + v: UnsafeCell>, +} + +impl Default for AppendOnlyVec { + fn default() -> Self { + Self { + v: UnsafeCell::new(Vec::new()), + } + } +} + +impl From> for AppendOnlyVec { + fn from(existing_vec: Vec) -> Self { + Self { + v: UnsafeCell::new(existing_vec), + } + } +} + +impl AppendOnlyVec { + pub fn push(&self, data: T) { + // SAFETY: AppendOnlyVec is made such that references to the content can only be made from exclusive references. Hence, no reference can be taken and then invalidated by a push + unsafe { + (*self.v.get()).push(data); + } + } + pub fn new() -> Self { + Self::default() + } +} + +impl From> for Vec { + fn from(val: AppendOnlyVec) -> Self { + val.v.into_inner() + } +} + +impl IntoIterator for AppendOnlyVec { + type Item = T; + type IntoIter = std::vec::IntoIter; + + fn into_iter(self) -> Self::IntoIter { + self.v.into_inner().into_iter() + } +} diff --git a/src/codegen/system_verilog.rs b/src/codegen/system_verilog.rs index 25b8c75e..3a758425 100644 --- a/src/codegen/system_verilog.rs +++ b/src/codegen/system_verilog.rs @@ -9,7 +9,8 @@ use crate::flattening::{DeclarationKind, Instruction, Module, Port}; use crate::instantiation::{ InstantiatedModule, MultiplexerSource, RealWire, RealWireDataSource, RealWirePathElem, }; -use crate::typing::template::TVec; +use crate::typing::concrete_type::ConcreteTemplateArg; +use crate::typing::template::{TVec, TemplateKind}; use crate::{typing::concrete_type::ConcreteType, value::Value}; use super::shared::*; @@ -43,7 +44,7 @@ fn typ_to_declaration(mut typ: &ConcreteType, var_name: &str) -> String { let mut array_string = String::new(); while let ConcreteType::Array(arr) = typ { let (content_typ, size) = arr.deref(); - let sz = size.unwrap_value().unwrap_integer(); + let sz = size.unwrap_integer(); write!(array_string, "[{}:0]", sz - 1).unwrap(); typ = content_typ; } @@ -57,7 +58,6 @@ fn typ_to_declaration(mut typ: &ConcreteType, var_name: &str) -> String { } } ConcreteType::Array(_) => unreachable!("All arrays have been used up already"), - ConcreteType::Value(_) | ConcreteType::Unknown(_) => unreachable!(), } } @@ -251,7 +251,7 @@ impl<'g> CodeGenerationContext<'g> { idx += 1; let (new_typ, sz) = arr_box.deref(); typ = new_typ; - let sz = sz.unwrap_value().unwrap_integer(); + let sz = sz.unwrap_integer(); write!( for_stack, "for({for_should_declare_var}{var_name} = 0; {var_name} < {sz}; {var_name} = {var_name} + 1) " @@ -348,7 +348,7 @@ impl<'g> CodeGenerationContext<'g> { writeln!(self.program_text, "{wire_or_reg}{wire_decl};").unwrap(); let mut path = String::new(); - for n in 0_usize..*rank { + for n in 0..rank.len() { path.push_str(&format!("[_i{n}]")); writeln!(self.program_text, "foreach ({wire_name}{path}) begin").unwrap(); } @@ -361,7 +361,7 @@ impl<'g> CodeGenerationContext<'g> { ) .unwrap(); - for _n in 0_usize..*rank { + for _n in rank { writeln!(self.program_text, "end").unwrap(); } } @@ -387,7 +387,7 @@ impl<'g> CodeGenerationContext<'g> { let mut path = String::new(); - for n in 0_usize..*rank { + for n in 0..rank.len() { path.push_str(&format!("[_i{n}]")); writeln!(self.program_text, "foreach ({wire_name}{path}) begin").unwrap(); } @@ -401,7 +401,7 @@ impl<'g> CodeGenerationContext<'g> { ) .unwrap(); - for _n in 0_usize..*rank { + for _n in rank { writeln!(self.program_text, "end").unwrap(); } } @@ -488,7 +488,7 @@ impl<'g> CodeGenerationContext<'g> { fn write_template_args( &mut self, link_info: &LinkInfo, - concrete_template_args: &TVec, + concrete_template_args: &TVec, ) { self.program_text.write_str(&link_info.name).unwrap(); self.program_text.write_str(" #(").unwrap(); @@ -496,11 +496,12 @@ impl<'g> CodeGenerationContext<'g> { concrete_template_args.iter().for_each(|(arg_id, arg)| { let arg_name = &link_info.template_parameters[arg_id].name; let arg_value = match arg { - ConcreteType::Named(..) | ConcreteType::Array(..) => { - unreachable!("No extern module type arguments. Should have been caught by Lint") + TemplateKind::Type(_) => { + unreachable!( + "No extern module type arguments. Should have been caught by Lint" + ); } - ConcreteType::Value(value) => value.inline_constant_to_string(), - ConcreteType::Unknown(_) => unreachable!("All args are known at codegen"), + TemplateKind::Value(value) => value.inline_constant_to_string(), }; if first { self.program_text.write_char(',').unwrap(); @@ -593,8 +594,8 @@ impl<'g> CodeGenerationContext<'g> { self.program_text.write_str("\tassign out = in;\n").unwrap(); } "IntToBits" => { - let [num_bits] = self.instance.global_ref.template_args.cast_to_array(); - let num_bits: usize = num_bits.unwrap_value().unwrap_int(); + let [num_bits] = self.instance.global_ref.template_args.cast_to_int_array(); + let num_bits: usize = num_bits.try_into().unwrap(); let _value_port = self .md @@ -607,8 +608,8 @@ impl<'g> CodeGenerationContext<'g> { } } "BitsToInt" => { - let [num_bits] = self.instance.global_ref.template_args.cast_to_array(); - let num_bits: usize = num_bits.unwrap_value().unwrap_int(); + let [num_bits] = self.instance.global_ref.template_args.cast_to_int_array(); + let num_bits: usize = num_bits.try_into().unwrap(); let _bits_port = self .md diff --git a/src/codegen/vhdl.rs b/src/codegen/vhdl.rs index 39ee8d16..0a244054 100644 --- a/src/codegen/vhdl.rs +++ b/src/codegen/vhdl.rs @@ -42,7 +42,7 @@ fn typ_to_declaration(mut typ: &ConcreteType) -> String { let mut array_string = String::new(); while let ConcreteType::Array(arr) = typ { let (content_typ, size) = arr.deref(); - let sz = size.unwrap_value().unwrap_integer(); + let sz = size.unwrap_integer(); write!(array_string, "array (0 to {}) of", sz - 1).unwrap(); typ = content_typ; } @@ -56,7 +56,6 @@ fn typ_to_declaration(mut typ: &ConcreteType) -> String { } } ConcreteType::Array(_) => unreachable!("All arrays have been used up already"), - ConcreteType::Value(_) | ConcreteType::Unknown(_) => unreachable!(), } } diff --git a/src/compiler_top.rs b/src/compiler_top.rs index 80febb36..d577d058 100644 --- a/src/compiler_top.rs +++ b/src/compiler_top.rs @@ -1,6 +1,5 @@ use std::ffi::OsStr; use std::path::{Path, PathBuf}; -use std::rc::Rc; use std::str::FromStr; use crate::config::EarlyExitUpTo; @@ -236,10 +235,10 @@ impl Linker { if md.link_info.template_parameters.is_empty() { let _inst = self.instantiator.instantiate( self, - Rc::new(ConcreteGlobalReference { + ConcreteGlobalReference { id, template_args: FlatAlloc::new(), - }), + }, ); } } diff --git a/src/config.rs b/src/config.rs index e95e1cac..a1acb090 100644 --- a/src/config.rs +++ b/src/config.rs @@ -31,7 +31,9 @@ pub enum TargetLanguage { #[derive(Debug)] pub struct ConfigStruct { pub use_lsp: bool, + #[allow(unused)] pub lsp_debug_mode: bool, + #[allow(unused)] pub lsp_port: u16, pub codegen: bool, /// Enable debugging printouts and figures @@ -42,6 +44,7 @@ pub struct ConfigStruct { /// /// See also [Self::enabled_debug_paths] pub debug_whitelist: Vec, + pub kill_timeout: std::time::Duration, pub enabled_debug_paths: HashSet, pub codegen_module_and_dependencies_one_file: Option, pub early_exit: EarlyExitUpTo, @@ -87,6 +90,15 @@ fn command_builder() -> Command { .hide(true) .help("Enable debug prints and figures for specific modules.\nDebugging checks if the current debug stage print has one of the debug-whitelist arguments as a substring. So passing 'FIFO' debugs all FIFO stuff, but passing 'Typechecking FIFO' only shows debug prints during typechecking. To show everything, pass --debug-whitelist-is-blacklist") .action(clap::ArgAction::Append)) + .arg(Arg::new("kill-timeout") + .long("kill-timeout") + .hide(true) + .help("Sets how long an individual part of the compiler can take, before terminating. Set to 0 to disable") + .action(clap::ArgAction::Set) + .default_value("0s") + .value_parser(|duration : &str| { + humantime::parse_duration(duration) + })) .arg(Arg::new("codegen") .long("codegen") .help("Enable code generation for all modules. This creates a file named [ModuleName].sv per module.") @@ -147,7 +159,6 @@ where .unwrap_or_default() .cloned() .collect(); - let use_color = !matches.get_flag("nocolor") && !matches.get_flag("lsp"); let files: Vec = match matches.get_many("files") { Some(files) => files.cloned().collect(), @@ -167,6 +178,9 @@ where codegen, debug_whitelist, enabled_debug_paths, + kill_timeout: *matches + .get_one::("kill-timeout") + .unwrap(), codegen_module_and_dependencies_one_file: matches.get_one("standalone").cloned(), early_exit: *matches.get_one("upto").unwrap(), use_color, diff --git a/src/debug.rs b/src/debug.rs index 000898ef..418fd40e 100644 --- a/src/debug.rs +++ b/src/debug.rs @@ -1,8 +1,20 @@ -use std::{cell::RefCell, ops::Range}; +use std::{ + cell::RefCell, + ops::Range, + sync::{ + atomic::{AtomicBool, AtomicPtr}, + Arc, LazyLock, Mutex, + }, + thread, + time::{Duration, Instant}, +}; use circular_buffer::CircularBuffer; -use crate::{config::config, linker::FileData, prelude::Span, pretty_print_spans_in_reverse_order}; +use crate::{ + config::config, linker::FileData, prelude::Span, pretty_print_span, + pretty_print_spans_in_reverse_order, +}; /// Many duplicates will be produced, and filtering them out in the code itself is inefficient. Therefore just keep a big buffer and deduplicate as needed const SPAN_TOUCH_HISTORY_SIZE: usize = 256; @@ -22,6 +34,7 @@ struct SpanDebuggerStackElement { thread_local! { static DEBUG_STACK : RefCell = const { RefCell::new(PerThreadDebugInfo{debug_stack: Vec::new(), recent_debug_options: CircularBuffer::new()}) }; + static MOST_RECENT_FILE_DATA: std::sync::atomic::AtomicPtr = const {AtomicPtr::new(std::ptr::null_mut())} } /// Register a [crate::file_position::Span] for potential printing by [PanicGuardSpanPrinter] on panic. @@ -59,6 +72,19 @@ fn print_most_recent_spans(file_data: &FileData) { }); } +#[allow(unused)] +pub fn debug_print_span(span: Span, label: String) { + MOST_RECENT_FILE_DATA.with(|ptr| { + let ptr = ptr.load(std::sync::atomic::Ordering::SeqCst); + if ptr.is_null() { + eprintln!("No FileData registered!"); + } else { + let fd: &FileData = unsafe { &*ptr }; + pretty_print_span(fd, span.as_range(), label); + } + }) +} + /// Print the last [NUM_SPANS_TO_PRINT] touched spans on panic to aid in debugging /// /// If not defused, it will print when dropped, ostensibly when being unwound from a panic @@ -70,6 +96,10 @@ fn print_most_recent_spans(file_data: &FileData) { /// Maybe future work can remove dependency on Linker lifetime with some unsafe code. pub struct SpanDebugger<'text> { file_data: &'text FileData, + started_at: std::time::Instant, + /// Kills the process if a SpanDebugger lives longer than config.kill_timeout + #[allow(unused)] + out_of_time_killer: OutOfTimeKiller, } fn print_stack_top(enter_exit: &str) { @@ -96,10 +126,17 @@ fn print_stack_top(enter_exit: &str) { impl<'text> SpanDebugger<'text> { pub fn new(stage: &'static str, global_obj_name: &str, file_data: &'text FileData) -> Self { + MOST_RECENT_FILE_DATA.with(|ptr| { + let file_data = file_data as *const FileData; + ptr.store( + file_data as *mut FileData, + std::sync::atomic::Ordering::SeqCst, + ) + }); let context = format!("{stage} {global_obj_name}"); - DEBUG_STACK.with_borrow_mut(|history| { - let config = config(); + let config = config(); + DEBUG_STACK.with_borrow_mut(|history| { let debugging_enabled = config.debug_whitelist.is_empty() && !config.enabled_debug_paths.is_empty() || config @@ -108,20 +145,28 @@ impl<'text> SpanDebugger<'text> { .any(|v| global_obj_name.contains(v)); history.debug_stack.push(SpanDebuggerStackElement { - context, + context: context.clone(), debugging_enabled, span_history: CircularBuffer::new(), }); }); print_stack_top("Enter "); - Self { file_data } + Self { + file_data, + started_at: std::time::Instant::now(), + out_of_time_killer: OutOfTimeKiller::new(context), + } } } impl Drop for SpanDebugger<'_> { fn drop(&mut self) { - print_stack_top("Exit "); + let time_taken = std::time::Instant::now() - self.started_at; + print_stack_top(&format!( + "Exit (Took {})", + humantime::format_duration(time_taken) + )); DEBUG_STACK.with_borrow_mut(|stack| stack.debug_stack.pop()); print_stack_top(""); @@ -147,6 +192,16 @@ pub fn is_enabled(path_id: &'static str) -> bool { }) } +#[allow(unused)] +pub fn debugging_enabled() -> bool { + DEBUG_STACK.with_borrow_mut(|stack| { + let Some(last) = stack.debug_stack.last() else { + return false; + }; + last.debugging_enabled + }) +} + pub fn setup_panic_handler() { let default_hook = std::panic::take_hook(); std::panic::set_hook(Box::new(move |info| { @@ -160,3 +215,101 @@ pub fn setup_panic_handler() { }) })); } + +struct TimerEntry { + started_at: Instant, + info: String, + alive: Arc, +} + +static WATCHDOG: LazyLock>> = LazyLock::new(|| { + let list = Mutex::new(Vec::new()); + spawn_watchdog_thread(); + list +}); + +fn spawn_watchdog_thread() { + let duration = config().kill_timeout; + if duration.is_zero() { + return; // No watchdog + } + thread::spawn(move || loop { + thread::sleep(Duration::from_millis(50)); + + let mut timers = WATCHDOG.lock().unwrap(); + let now = Instant::now(); + timers.retain(|entry| { + let deadline = entry.started_at + duration; + if deadline <= now && entry.alive.load(std::sync::atomic::Ordering::SeqCst) { + println!("⏰⏰⏰⏰⏰⏰⏰⏰⏰"); // To show in stdout when this happens too + eprintln!( + "⏰ OutOfTimeKiller triggered in {} after it took more than {} to execute ⏰", + entry.info, + humantime::format_duration(now - entry.started_at) + ); + eprintln!("Process will now be terminated."); + std::process::exit(1); + } else { + deadline > now + } + }); + }); +} + +pub struct OutOfTimeKiller { + alive: Arc, +} + +impl OutOfTimeKiller { + pub fn new(info: String) -> Self { + let timeout = config().kill_timeout; + let alive = Arc::new(AtomicBool::new(true)); + if !timeout.is_zero() { + WATCHDOG.lock().unwrap().push(TimerEntry { + started_at: Instant::now(), + alive: alive.clone(), + info, + }); + } + + OutOfTimeKiller { alive } + } +} + +impl Drop for OutOfTimeKiller { + fn drop(&mut self) { + self.alive.store(false, std::sync::atomic::Ordering::SeqCst); + } +} + +#[macro_export] +macro_rules! __debug_span { + ($span:expr) => { + if $crate::debug::debugging_enabled() { + let tmp = $span; + std::eprintln!( + "[{}:{}:{}] {}:", + std::file!(), + std::line!(), + std::column!(), + std::stringify!($span) + ); + + $crate::debug::debug_print_span(tmp, String::new()); + } + }; + ($span:expr, $($arg:tt)*) => { + if $crate::debug::debugging_enabled() { + let tmp = $span; + std::eprintln!( + "[{}:{}:{}] {}:", + std::file!(), + std::line!(), + std::column!(), + std::stringify!($span) + ); + + $crate::debug::debug_print_span(tmp, format!($($arg)*)); + } + }; +} diff --git a/src/dev_aid/ariadne_interface.rs b/src/dev_aid/ariadne_interface.rs index 419bd2e5..87cdf8c0 100644 --- a/src/dev_aid/ariadne_interface.rs +++ b/src/dev_aid/ariadne_interface.rs @@ -194,6 +194,35 @@ pub fn pretty_print_spans_in_reverse_order(file_data: &FileData, spans: Vec, label: String) { + let text_len = file_data.file_text.len(); + let mut source = NamedSource { + source: Source::from(file_data.file_text.file_text.clone()), + name: &file_data.file_identifier, + }; + + // If span not in file, just don't print it. This happens. + if span.end > text_len { + println!( + "Span({}, {}) certainly does not correspond to this file. ", + span.start, span.end + ); + return; + } + + let config = ariadne_config(); + + let mut report: ReportBuilder<'_, Range> = + Report::build(ReportKind::Advice, span.clone()).with_config(config); + report = report.with_label( + Label::new(span.clone()) + .with_message(label) + .with_color(Color::Blue), + ); + + report.finish().print(&mut source).unwrap(); +} + pub fn pretty_print_many_spans(file_data: &FileData, spans: &[(String, Range)]) { let text_len = file_data.file_text.len(); let mut source = NamedSource { diff --git a/src/dev_aid/dot_graphs.rs b/src/dev_aid/dot_graphs.rs index 9ca06cd2..dc0fcb30 100644 --- a/src/dev_aid/dot_graphs.rs +++ b/src/dev_aid/dot_graphs.rs @@ -245,7 +245,7 @@ impl<'a> GraphWalk<'a, usize, LatencyEdge<'a>> for Problem<'a> { (0..self.lc_problem.map_latency_node_to_wire.len()).collect() } - fn edges(&'a self) -> Edges<'a, LatencyEdge> { + fn edges(&'a self) -> Edges<'a, LatencyEdge<'a>> { let mut result = Vec::with_capacity(self.lc_problem.edges.len()); for (to, fan_from) in &self.lc_problem.edges { diff --git a/src/dev_aid/lsp/hover_info.rs b/src/dev_aid/lsp/hover_info.rs index 48e512de..176b92b6 100644 --- a/src/dev_aid/lsp/hover_info.rs +++ b/src/dev_aid/lsp/hover_info.rs @@ -3,6 +3,7 @@ use std::borrow::Cow; use crate::alloc::ArenaAllocator; use crate::latency::CALCULATE_LATENCY_LATER; use crate::prelude::*; +use crate::typing::template::TemplateKind; use lsp_types::{LanguageString, MarkedString}; @@ -12,7 +13,7 @@ use crate::linker::{Documentation, FileData, GlobalUUID, LinkInfo}; use crate::typing::{ abstract_type::DomainType, - template::{GenerativeParameterKind, ParameterKind, TypeParameterKind}, + template::{GenerativeParameterKind, TypeParameterKind}, }; use super::tree_walk::{InGlobal, LocationInfo}; @@ -64,10 +65,10 @@ impl HoverCollector<'_> { if wire.original_instruction != id { continue; } - let typ_str = wire.typ.display(&self.linker.types); + let typ_str = wire.typ.display(&self.linker.types, true); let name_str = &wire.name; let latency_str = if wire.absolute_latency != CALCULATE_LATENCY_LATER { - format!("{}", wire.absolute_latency) + wire.absolute_latency.to_string() } else { "?".to_owned() }; @@ -82,7 +83,7 @@ impl HoverCollector<'_> { for (_template_args, inst) in self.linker.instantiator.borrow().iter_for_module(md_id) { for (_id, sm) in &inst.submodules { if sm.original_instruction == submodule_instr { - self.sus_code(sm.refers_to.pretty_print_concrete_instance(self.linker)); + self.sus_code(sm.refers_to.display(self.linker, true).to_string()); } } } @@ -112,10 +113,8 @@ pub fn hover(info: LocationInfo, linker: &Linker, file_data: &FileData) -> Vec = Vec::with_capacity(5); if let Some(md) = try_get_module(&linker.modules, obj_id) { - if md.implicit_clk_domain { - if let DomainType::Physical(ph) = decl.typ.domain { - details_vec.push(DomainType::physical_to_string(ph, &md.domains)); - } + if let DomainType::Physical(ph) = decl.typ.domain { + details_vec.push(DomainType::physical_to_string(ph, &md.domains)); } } @@ -166,31 +165,26 @@ pub fn hover(info: LocationInfo, linker: &Linker, file_data: &FileData) -> Vec { + LocationInfo::InGlobal(obj_id, link_info, id, InGlobal::Temporary(expr)) => { let mut details_vec: Vec> = Vec::with_capacity(2); - match wire.typ.domain { + match expr.domain { DomainType::Generative => details_vec.push(Cow::Borrowed("gen")), DomainType::Physical(ph) => { if let Some(md) = try_get_module(&linker.modules, obj_id) { - if md.implicit_clk_domain { - details_vec - .push(Cow::Owned(DomainType::physical_to_string(ph, &md.domains))) - } + details_vec + .push(Cow::Owned(DomainType::physical_to_string(ph, &md.domains))) } } DomainType::Unknown(_) => { @@ -198,13 +192,12 @@ pub fn hover(info: LocationInfo, linker: &Linker, file_data: &FileData) -> Vec { hover.sus_code( @@ -214,10 +207,10 @@ pub fn hover(info: LocationInfo, linker: &Linker, file_data: &FileData) -> Vec { match &template_arg.kind { - ParameterKind::Type(TypeParameterKind {}) => { + TemplateKind::Type(TypeParameterKind {}) => { hover.monospace(format!("type {}", template_arg.name)); } - ParameterKind::Generative(GenerativeParameterKind { + TemplateKind::Value(GenerativeParameterKind { decl_span: _, declaration_instruction, }) => { diff --git a/src/dev_aid/lsp/semantic_tokens.rs b/src/dev_aid/lsp/semantic_tokens.rs index 8649d3b2..a05fe626 100644 --- a/src/dev_aid/lsp/semantic_tokens.rs +++ b/src/dev_aid/lsp/semantic_tokens.rs @@ -1,4 +1,4 @@ -use crate::prelude::*; +use crate::{prelude::*, typing::template::TemplateKind}; use lsp_types::{ Position, SemanticToken, SemanticTokenModifier, SemanticTokenType, SemanticTokensFullOptions, @@ -12,7 +12,7 @@ use crate::{ linker::{FileData, GlobalUUID}, }; -use crate::typing::{abstract_type::DomainType, template::ParameterKind}; +use crate::typing::abstract_type::DomainType; use super::tree_walk::{self, InGlobal, LocationInfo}; @@ -156,8 +156,8 @@ fn walk_name_color(file: &FileData, linker: &Linker) -> Vec<(Span, IDEIdentifier LocationInfo::Type(_, _) => return, LocationInfo::Parameter(_id, _link_info, _, template_arg) => { match &template_arg.kind { - ParameterKind::Type(_) => IDEIdentifierType::Type, - ParameterKind::Generative(_) => IDEIdentifierType::Generative, + TemplateKind::Type(_) => IDEIdentifierType::Type, + TemplateKind::Value(_) => IDEIdentifierType::Generative, } } LocationInfo::Global(g) => match g { diff --git a/src/dev_aid/lsp/tree_walk.rs b/src/dev_aid/lsp/tree_walk.rs index eac42b5a..ba012416 100644 --- a/src/dev_aid/lsp/tree_walk.rs +++ b/src/dev_aid/lsp/tree_walk.rs @@ -5,9 +5,9 @@ use crate::prelude::*; use crate::linker::{FileData, GlobalUUID, LinkInfo}; +use crate::typing::template::TemplateArg; use crate::typing::template::{ - GenerativeParameterKind, GlobalReference, Parameter, ParameterKind, TemplateArgKind, - TypeParameterKind, + GenerativeParameterKind, GlobalReference, Parameter, TemplateKind, TypeParameterKind, }; use crate::typing::written_type::WrittenType; @@ -83,8 +83,8 @@ impl From> for RefersTo { LocationInfo::Type(_, _) => {} LocationInfo::Parameter(obj, _link_info, template_id, template_arg) => { match &template_arg.kind { - ParameterKind::Type(TypeParameterKind {}) => {} - ParameterKind::Generative(GenerativeParameterKind { + TemplateKind::Type(TypeParameterKind {}) => {} + TemplateKind::Value(GenerativeParameterKind { decl_span: _, declaration_instruction, }) => { @@ -218,22 +218,38 @@ impl<'linker, Visitor: FnMut(Span, LocationInfo<'linker>), Pruner: Fn(Span) -> b { let target_name_elem = GlobalUUID::from(global.id); self.visit(global.name_span, LocationInfo::Global(target_name_elem)); - for (id, template_arg) in global.template_args.iter_valids() { - let target_link_info = self.linker.get_link_info(target_name_elem); - self.visit( - template_arg.name_span, - LocationInfo::Parameter( - target_name_elem, - target_link_info, - id, - &target_link_info.template_parameters[id], - ), - ); - match &template_arg.kind { - TemplateArgKind::Type(typ_expr) => { + let target_link_info = self.linker.get_link_info(target_name_elem); + for (id, arg) in &global.template_args { + match arg { + TemplateKind::Type(TemplateArg::Provided { + name_span, + arg: typ_expr, + .. + }) => { + self.visit( + *name_span, + LocationInfo::Parameter( + target_name_elem, + target_link_info, + id, + &target_link_info.template_parameters[id], + ), + ); self.walk_type(parent, link_info, typ_expr); } - TemplateArgKind::Value(_) => {} // Covered by FlatIDs + TemplateKind::Value(TemplateArg::Provided { name_span, .. }) => { + self.visit( + *name_span, + LocationInfo::Parameter( + target_name_elem, + target_link_info, + id, + &target_link_info.template_parameters[id], + ), + ); + } + TemplateKind::Type(TemplateArg::NotProvided { .. }) + | TemplateKind::Value(TemplateArg::NotProvided { .. }) => {} } } } @@ -245,9 +261,9 @@ impl<'linker, Visitor: FnMut(Span, LocationInfo<'linker>), Pruner: Fn(Span) -> b wire_ref: &'linker WireReference, ) { match &wire_ref.root { - WireReferenceRoot::LocalDecl(decl_id, span) => { + WireReferenceRoot::LocalDecl(decl_id) => { self.visit( - *span, + wire_ref.root_span, LocationInfo::InGlobal( obj_id, link_info, @@ -365,7 +381,7 @@ impl<'linker, Visitor: FnMut(Span, LocationInfo<'linker>), Pruner: Fn(Span) -> b self.visit(link_info.name_span, LocationInfo::Global(name_elem)); for (template_id, template_arg) in &link_info.template_parameters { - if let ParameterKind::Type(TypeParameterKind {}) = &template_arg.kind { + if let TemplateKind::Type(TypeParameterKind {}) = &template_arg.kind { self.visit( template_arg.name_span, LocationInfo::Parameter(name_elem, link_info, template_id, template_arg), diff --git a/src/errors.rs b/src/errors.rs index 7fc5e8ca..1d60ad58 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -4,9 +4,7 @@ use std::cell::RefCell; use crate::{alloc::ArenaAllocator, typing::template::Parameter}; -use crate::flattening::{ - Declaration, DomainInfo, Instruction, Interface, Module, Port, SubModuleInstance, -}; +use crate::flattening::{Declaration, DomainInfo, Instruction, Module, Port, SubModuleInstance}; use crate::linker::{checkpoint::ErrorCheckpoint, FileData, LinkInfo}; #[derive(Debug, Clone, PartialEq, Eq)] @@ -58,6 +56,12 @@ impl ErrorStore { did_error: false, } } + pub fn new_did_error() -> ErrorStore { + ErrorStore { + errors: Vec::new(), + did_error: true, + } + } pub fn take(&mut self) -> Self { std::mem::replace(self, ErrorStore::new()) @@ -90,7 +94,13 @@ impl ErrorStore { } pub fn sort(&mut self) { - self.errors.sort_by_key(|a| a.position.as_range().start); + self.errors.sort_by(|a, b| { + a.position + .as_range() + .start + .cmp(&b.position.as_range().start) + .then_with(|| a.reason.cmp(&b.reason)) + }); } } @@ -379,18 +389,6 @@ impl FileKnowingErrorInfoObject for LinkInfo { } } -/// For interfaces of this module -impl FileKnowingErrorInfoObject for (&'_ Module, &'_ Interface) { - fn make_global_info(&self, _files: &ArenaAllocator) -> ErrorInfo { - let (md, interface) = *self; - ErrorInfo { - position: interface.name_span, - file: md.link_info.file, - info: format!("Interface '{}' defined here", &interface.name), - } - } -} - impl FileKnowingErrorInfoObject for Module { fn make_global_info(&self, files: &ArenaAllocator) -> ErrorInfo { let ports_str = diff --git a/src/flattening/flatten.rs b/src/flattening/flatten.rs index e4dd2caa..2fe416cf 100644 --- a/src/flattening/flatten.rs +++ b/src/flattening/flatten.rs @@ -1,6 +1,6 @@ use crate::alloc::{ArenaAllocator, UUIDAllocator, UUIDRange, UUID}; use crate::typing::abstract_type::DomainType; -use crate::typing::type_inference::{AbstractTypeSubstitutor, Substitutor, TypeSubstitutor}; +use crate::typing::type_inference::{AbstractTypeSubstitutor, TypeSubstitutor}; use crate::{alloc::UUIDRangeIter, prelude::*}; use ibig::IBig; @@ -14,7 +14,7 @@ use super::parser::Cursor; use super::*; use crate::typing::template::{ - GenerativeParameterKind, ParameterKind, TVec, TemplateArg, TemplateArgKind, + AbstractTemplateArg, GenerativeParameterKind, TVec, TemplateArg, TemplateKind, }; #[derive(Debug, Clone, Copy, PartialEq, Eq)] @@ -48,75 +48,7 @@ enum PartialWireReference { interface_name_span: Span, }, /// It's ready for use higher up - WireReference { - wire_ref: WireReference, - domain: DomainType, - }, -} - -impl PartialWireReference { - const ERROR: Self = PartialWireReference::WireReference { - wire_ref: WireReference::ERROR, - domain: DomainType::Generative, - }; -} - -impl PartialWireReference { - /// Returns the domain of the WireReferenceRoot - fn extract(self, ctx: &FlatteningContext) -> (WireReference, DomainType) { - match self { - PartialWireReference::ModuleButNoPort(submod_decl, span) => { - let md_uuid = ctx.instructions[submod_decl] - .unwrap_submodule() - .module_ref - .id; - ctx.errors - .error( - span, - "cannot operate on modules directly. Should use ports instead", - ) - .info_obj(&ctx.globals[md_uuid]); - (WireReference::ERROR, DomainType::Generative) - } - PartialWireReference::GlobalModuleName(md_ref) => { - let md = &ctx.globals[md_ref.id]; - ctx.errors - .error( - md_ref.name_span, - format!( - "Expected a Wire Reference, but found module '{}' instead", - md.link_info.name - ), - ) - .info_obj(md); - (WireReference::ERROR, DomainType::Generative) - } - PartialWireReference::ModuleWithInterface { - submodule_decl: submod_decl, - submodule_name_span: _, - interface, - interface_name_span, - } => { - let md_uuid = ctx.instructions[submod_decl] - .unwrap_submodule() - .module_ref - .id; - let md = &ctx.globals[md_uuid]; - let interf = &md.interfaces[interface]; - ctx.errors - .error( - interface_name_span, - format!( - "Expected a port, but found module interface '{}' instead", - &interf.name - ), - ) - .info((interf.name_span, md.link_info.file), "Declared here"); - (WireReference::ERROR, DomainType::Generative) - } - PartialWireReference::WireReference { wire_ref, domain } => (wire_ref, domain), - } - } + WireReference(WireReference), } impl UnaryOperator { @@ -247,6 +179,13 @@ enum InterfacePortsInfo { ConditionalBindings, } +struct WrittenTemplateArg<'a> { + name: &'a str, + name_span: Span, + value_span: Span, + kind: Option>, +} + struct FlatteningContext<'l, 'errs> { globals: &'l GlobalResolver<'l>, errors: &'errs ErrorCollector<'l>, @@ -256,7 +195,7 @@ struct FlatteningContext<'l, 'errs> { instructions: FlatAlloc, type_alloc: TypingAllocator, named_domain_alloc: UUIDAllocator, - is_implicit_clk_domain: bool, + current_domain: DomainID, fields_to_visit: UUIDRangeIter, ports_to_visit: UUIDRangeIter, @@ -325,105 +264,140 @@ impl<'l, 'c: 'l> FlatteningContext<'l, '_> { }) } - fn flatten_template_args( - &mut self, - found_global: GlobalUUID, - has_template_args: bool, - cursor: &mut Cursor<'c>, - ) -> TVec> { - let link_info = self.globals.get_link_info(found_global); - let full_object_name = link_info.get_full_name(); - - let mut template_arg_map: FlatAlloc, TemplateIDMarker> = - link_info.template_parameters.map(|_| None); - - if !has_template_args { - return template_arg_map; - } - - cursor.list(kind!("template_args"), |cursor| { + fn flatten_template_args(&mut self, cursor: &mut Cursor<'c>) -> Vec> { + cursor.collect_list(kind!("template_args"), |cursor| { cursor.go_down(kind!("template_arg"), |cursor| { let (name_span, name) = cursor.field_span(field!("name"), kind!("identifier")); - let name_found = link_info.template_parameters.iter().find(|(_id, arg)| arg.name == name); - if name_found.is_none() { - self.errors.error(name_span, format!("{name} is not a valid template argument of {full_object_name}")) - .info_obj(link_info); - } - - let (template_arg, value_span) = if cursor.optional_field(field!("val_arg")) { + let (kind, value_span) = if cursor.optional_field(field!("val_arg")) { let value_span = cursor.span(); let (expr, domain) = self.flatten_subexpr(cursor); if !domain.is_generative() { self.errors.error(value_span, "Template arguments must be known at compile-time!"); } - (TemplateArgKind::Value(expr), value_span) + (Some(TemplateKind::Value(expr)), value_span) } else if cursor.optional_field(field!("type_arg")) { let value_span = cursor.span(); let typ = self.flatten_type(cursor); - (TemplateArgKind::Type(typ), value_span) + (Some(TemplateKind::Type(typ)), value_span) } else { (match self.local_variable_context.get_declaration_for(name) { - Some(NamedLocal::TemplateType(t)) => TemplateArgKind::Type(WrittenType::TemplateVariable(name_span, t)), + Some(NamedLocal::TemplateType(t)) => Some(TemplateKind::Type(WrittenType::TemplateVariable(name_span, t))), Some(NamedLocal::Declaration(decl_id)) => { // Insert extra Expression, to support named template arg syntax #(MY_VAR, OTHER_VAR: BEEP) + let decl = self.instructions[decl_id].unwrap_declaration(); let wire_read_id = self.instructions.alloc(Instruction::Expression(Expression { - output: ExpressionOutput::SubExpression(self.type_alloc.alloc_unset_type(DomainType::Generative)), + output: ExpressionOutput::SubExpression(self.type_alloc.type_alloc.alloc_unknown()), span: name_span, domain: DomainType::Generative, - source: ExpressionSource::WireRef(WireReference::simple_var_read(decl_id, name_span)) + source: ExpressionSource::WireRef(WireReference { + root: WireReferenceRoot::LocalDecl(decl_id), + root_span: name_span, + root_typ: decl.typ.clone(), + path: Vec::new(), + }) })); - TemplateArgKind::Value(wire_read_id) + Some(TemplateKind::Value(wire_read_id)) } Some(NamedLocal::SubModule(sm)) => { self.errors.error(name_span, format!("{name} does not name a Type or a Value. Local submodules are not allowed!")) .info_obj_same_file(self.instructions[sm].unwrap_submodule()); - return; + None } Some(NamedLocal::DomainDecl(dom)) => { self.errors.error(name_span, format!("{name} does not name a Type or a Value. Domains are not allowed!")) .info_obj_same_file(&self.domains[dom]); - return; + None } None => { self.errors.error(name_span, format!("{name} does not name a Type or a Value.")); - return; + None }, }, name_span) }; - if let Some((id, parameter)) = name_found { - match (¶meter.kind, &template_arg) { - (ParameterKind::Type(_), TemplateArgKind::Type(_)) - | (ParameterKind::Generative(_), TemplateArgKind::Value(_)) => { - // Correct pairing - let elem = &mut template_arg_map[id]; - if let Some(prev) = elem { - self.errors.error(name_span, format!("'{name}' has already been defined previously")) - .info_same_file(prev.name_span, "Defined here previously"); - } else { - *elem = Some(TemplateArg { - name_span, - value_span, - kind: template_arg - }); - } + WrittenTemplateArg{ name, name_span, value_span, kind } + }) + }) + } + + fn apply_template_args_to_global( + &mut self, + found_global: GlobalUUID, + mut template_args: Vec>, + ) -> TVec { + let link_info = self.globals.get_link_info(found_global); + let full_object_name = link_info.get_full_name(); + let result = link_info.template_parameters.map(|(_, param)| { + let mut found_arg : Option = None; + + template_args.retain_mut(|arg| { + if arg.name == param.name { + if let Some(prev) = &found_arg { + self.errors.error(arg.name_span, format!("'{}' has already been defined previously", arg.name)) + .info_same_file(prev.name_span, "Defined here previously"); + } else { + found_arg = Some(WrittenTemplateArg{ name: arg.name, name_span: arg.name_span, value_span: arg.value_span, kind: arg.kind.take() }); + } + false + } else { + true + } + }); + + if let Some(WrittenTemplateArg { name, name_span, value_span, kind: Some(arg) }) = found_arg { + match (¶m.kind, arg) { + // Correct pairing + (TemplateKind::Type(_), TemplateKind::Type(arg)) => { + let abs_typ = self.type_alloc.type_alloc.written_to_abstract_type(&arg); + TemplateKind::Type(TemplateArg::Provided { name_span, value_span, arg, abs_typ }) } - (ParameterKind::Type(_), TemplateArgKind::Value(_)) => { + // Correct pairing + (TemplateKind::Value(_), TemplateKind::Value(arg)) => { + let abs_typ = self.instructions[arg].unwrap_subexpression().typ.clone(); + TemplateKind::Value(TemplateArg::Provided { name_span, value_span, arg, abs_typ }) + } + (TemplateKind::Type(_), TemplateKind::Value(_)) => { self.errors.error(name_span, format!("'{name}' is not a value. `type` keyword cannot be used for values")) - .info((parameter.name_span, link_info.file), "Declared here"); + .info((param.name_span, link_info.file), "Declared here"); + TemplateKind::Type(TemplateArg::NotProvided { + abs_typ: self.type_alloc.type_alloc.alloc_unknown(), + }) } - (ParameterKind::Generative(_), TemplateArgKind::Type(_)) => { + (TemplateKind::Value(_), TemplateKind::Type(_)) => { self.errors.error(name_span, format!("'{name}' is not a type. To use template type arguments use the `type` keyword like `T: type int[123]`")) - .info((parameter.name_span, link_info.file), "Declared here"); + .info((param.name_span, link_info.file), "Declared here"); + TemplateKind::Value(TemplateArg::NotProvided { + abs_typ: self.type_alloc.type_alloc.alloc_unknown(), + }) } } + } else { + match ¶m.kind { + TemplateKind::Type(_) => TemplateKind::Type(TemplateArg::NotProvided { + abs_typ: self.type_alloc.type_alloc.alloc_unknown(), + }), + TemplateKind::Value(_) => TemplateKind::Value(TemplateArg::NotProvided { + abs_typ: self.type_alloc.type_alloc.alloc_unknown(), + }), } - }); + } }); - template_arg_map + for remaining_arg in template_args { + self.errors + .error( + remaining_arg.name_span, + format!( + "{} is not a valid template argument of {full_object_name}", + remaining_arg.name + ), + ) + .info_obj(link_info); + } + + result } fn flatten_local_or_template_global(&mut self, cursor: &mut Cursor<'c>) -> LocalOrGlobal { @@ -441,9 +415,16 @@ impl<'l, 'c: 'l> FlatteningContext<'l, '_> { must_be_global = true; } - let template_args_used = cursor.optional_field(field!("template_args")); + let (template_args, template_span) = if cursor.optional_field(field!("template_args")) { + must_be_global = true; + let bracket_span = BracketSpan::from_outer(cursor.span()); - must_be_global |= template_args_used; + let args = self.flatten_template_args(cursor); + + (args, Some(bracket_span)) + } else { + (Vec::new(), None) + }; // Possibly local if !must_be_global { @@ -465,36 +446,25 @@ impl<'l, 'c: 'l> FlatteningContext<'l, '_> { .globals .resolve_global(name_span, &cursor.file_data.file_text[name_span]) { - // MUST Still be at field!("template_args") - let template_span = - template_args_used.then(|| BracketSpan::from_outer(cursor.span())); - - let template_args = - self.flatten_template_args(global_id, template_args_used, cursor); - - let template_arg_types = - template_args.map(|_| self.type_alloc.type_alloc.alloc_unknown()); + let template_args = self.apply_template_args_to_global(global_id, template_args); match global_id { GlobalUUID::Module(id) => LocalOrGlobal::Module(GlobalReference { id, name_span, template_args, - template_arg_types, template_span, }), GlobalUUID::Type(id) => LocalOrGlobal::Type(GlobalReference { id, name_span, template_args, - template_arg_types, template_span, }), GlobalUUID::Constant(id) => LocalOrGlobal::Constant(GlobalReference { id, name_span, template_args, - template_arg_types, template_span, }), } @@ -746,7 +716,7 @@ impl<'l, 'c: 'l> FlatteningContext<'l, '_> { }, DeclarationKind::GenerativeInput(_template_id) => {DomainType::Generative} DeclarationKind::StructField { field_id } => {*field_id = self.fields_to_visit.next().unwrap(); DomainType::Physical(UUID::PLACEHOLDER)} - DeclarationKind::RegularPort { is_input:_, port_id } => {*port_id = self.ports_to_visit.next().unwrap(); DomainType::Physical(self.named_domain_alloc.peek())} + DeclarationKind::RegularPort { is_input:_, port_id } => {*port_id = self.ports_to_visit.next().unwrap(); DomainType::Physical(self.current_domain)} }; cursor.field(field!("type")); @@ -841,7 +811,7 @@ impl<'l, 'c: 'l> FlatteningContext<'l, '_> { fn get_or_alloc_module(&mut self, cursor: &mut Cursor<'c>) -> Option { let outer_span = cursor.span(); - match self.flatten_wire_reference(cursor) { + match self.flatten_partial_wire_reference(cursor) { PartialWireReference::GlobalModuleName(module_ref) => { let documentation = cursor.extract_gathered_comments(); let interface_span = module_ref.get_total_span(); @@ -873,7 +843,7 @@ impl<'l, 'c: 'l> FlatteningContext<'l, '_> { name_span: Some(submodule_name_span), interface_span: interface_name_span, }), - PartialWireReference::WireReference { wire_ref, .. } => { + PartialWireReference::WireReference(wire_ref) => { if !wire_ref.is_error() { // Error already reported self.errors.error( @@ -889,7 +859,7 @@ impl<'l, 'c: 'l> FlatteningContext<'l, '_> { fn flatten_subexpr(&mut self, cursor: &mut Cursor<'c>) -> (FlatID, DomainType) { let (source, span, domain) = self.flatten_expr_source(cursor); - let typ = self.type_alloc.alloc_unset_type(domain); + let typ = self.type_alloc.type_alloc.alloc_unknown(); let wire_instance = Expression { domain, span, @@ -907,23 +877,40 @@ impl<'l, 'c: 'l> FlatteningContext<'l, '_> { let (source, span, domain) = self.flatten_expr_source(cursor); for to in &writes { - if to.to_type.domain.is_generative() && !domain.is_generative() { + if to.to.root_typ.domain.is_generative() && !domain.is_generative() { self.errors .error(span, "This value is non-generative, yet it is being assigned to a generative value") .info_same_file(to.to_span, "This object is generative"); } } + let output = match (&source, writes.is_empty()) { + (ExpressionSource::FuncCall(_), _) | (_, false) => ExpressionOutput::MultiWrite(writes), + (_, true) => { + self.errors.warn(span, "The result of this expression is not used. Only function calls can return nothing. "); + ExpressionOutput::SubExpression(self.type_alloc.type_alloc.alloc_unknown()) + } + }; + let wire_instance = Expression { span, domain, source, - output: ExpressionOutput::MultiWrite(writes), + output, }; self.instructions .alloc(Instruction::Expression(wire_instance)); } + fn new_error(&mut self, root_span: Span) -> WireReference { + WireReference { + root: WireReferenceRoot::Error, + path: Vec::new(), + root_span, + root_typ: self.type_alloc.alloc_unset_type(DomainType::Generative), + } + } + fn flatten_expr_source( &mut self, cursor: &mut Cursor<'c>, @@ -985,7 +972,7 @@ impl<'l, 'c: 'l> FlatteningContext<'l, '_> { // TODO add compile-time functions https://github.com/pc2/sus-compiler/issues/10 if resulting_domain.is_generative() { - resulting_domain.combine_with(self.type_alloc.domain_alloc.alloc_unknown()); + resulting_domain = self.type_alloc.domain_alloc.alloc_unknown(); } match interface_reference { @@ -994,7 +981,7 @@ impl<'l, 'c: 'l> FlatteningContext<'l, '_> { arguments, arguments_span, }), - None => ExpressionSource::WireRef(WireReference::ERROR), + None => ExpressionSource::WireRef(self.new_error(expr_span)), } }), kind!("parenthesis_expression") => { @@ -1012,17 +999,14 @@ impl<'l, 'c: 'l> FlatteningContext<'l, '_> { ExpressionSource::ArrayConstruct(list) } _other => { - let (wr, root_domain) = self.flatten_wire_reference(cursor).extract(self); + let wr = self.flatten_wire_reference(cursor, expr_span); - resulting_domain.combine_with(root_domain); + resulting_domain.combine_with(wr.root_typ.domain); for elem in &wr.path { match elem { - WireReferencePathElement::ArrayAccess { - idx, - bracket_span: _, - } => { + WireReferencePathElement::ArrayAccess { idx, .. } => { let idx_expr = self.instructions[*idx].unwrap_subexpression(); - resulting_domain.combine_with(idx_expr.typ.domain); + resulting_domain.combine_with(idx_expr.domain); } } } @@ -1032,23 +1016,77 @@ impl<'l, 'c: 'l> FlatteningContext<'l, '_> { (source, expr_span, resulting_domain) } - fn flatten_wire_reference(&mut self, cursor: &mut Cursor<'c>) -> PartialWireReference { + fn flatten_wire_reference(&mut self, cursor: &mut Cursor<'c>, span: Span) -> WireReference { + match self.flatten_partial_wire_reference(cursor) { + PartialWireReference::ModuleButNoPort(submod_decl, span) => { + let md_uuid = self.instructions[submod_decl] + .unwrap_submodule() + .module_ref + .id; + self.errors + .error( + span, + "cannot operate on modules directly. Should use ports instead", + ) + .info_obj(&self.globals[md_uuid]); + self.new_error(span) + } + PartialWireReference::GlobalModuleName(md_ref) => { + let md = &self.globals[md_ref.id]; + self.errors + .error( + md_ref.name_span, + format!( + "Expected a Wire Reference, but found module '{}' instead", + md.link_info.name + ), + ) + .info_obj(md); + self.new_error(span) + } + PartialWireReference::ModuleWithInterface { + submodule_decl: submod_decl, + submodule_name_span: _, + interface, + interface_name_span, + } => { + let md_uuid = self.instructions[submod_decl] + .unwrap_submodule() + .module_ref + .id; + let md = &self.globals[md_uuid]; + let interf = &md.interfaces[interface]; + self.errors + .error( + interface_name_span, + format!( + "Expected a port, but found module interface '{}' instead", + &interf.name + ), + ) + .info((interf.name_span, md.link_info.file), "Declared here"); + self.new_error(span) + } + PartialWireReference::WireReference(wr) => wr, + } + } + + fn flatten_partial_wire_reference(&mut self, cursor: &mut Cursor<'c>) -> PartialWireReference { let (kind, expr_span) = cursor.kind_span(); match kind { kind!("template_global") => { match self.flatten_local_or_template_global(cursor) { LocalOrGlobal::Local(span, named_obj) => match named_obj { NamedLocal::Declaration(decl_id) => { - let root = WireReferenceRoot::LocalDecl(decl_id, expr_span); - PartialWireReference::WireReference{ - wire_ref: WireReference { - root, - path: Vec::new(), - }, - domain: self.instructions[decl_id] - .unwrap_declaration() - .typ.domain - } + let decl = self.instructions[decl_id].unwrap_declaration(); + let root = WireReferenceRoot::LocalDecl(decl_id); + let root_typ = decl.typ.clone(); + PartialWireReference::WireReference(WireReference { + root, + root_typ, + root_span: expr_span, + path: Vec::new(), + }) } NamedLocal::SubModule(submod_id) => { PartialWireReference::ModuleButNoPort(submod_id, expr_span) @@ -1065,7 +1103,7 @@ impl<'l, 'c: 'l> FlatteningContext<'l, '_> { .info_obj_same_file( &self.working_on_link_info.template_parameters[template_id], ); - PartialWireReference::ERROR + PartialWireReference::WireReference(self.new_error(expr_span)) } NamedLocal::DomainDecl(domain_id) => { let domain = &self.domains[domain_id]; @@ -1078,30 +1116,31 @@ impl<'l, 'c: 'l> FlatteningContext<'l, '_> { ), ) .info_same_file(span, format!("Domain {} declared here", domain.name)); - PartialWireReference::ERROR + PartialWireReference::WireReference(self.new_error(expr_span)) } }, LocalOrGlobal::Constant(cst_ref) => { + let root_span = cst_ref.get_total_span(); let root = WireReferenceRoot::NamedConstant(cst_ref); - PartialWireReference::WireReference{ - wire_ref: WireReference { + PartialWireReference::WireReference(WireReference { root, + root_typ: self.type_alloc.alloc_unset_type(DomainType::Generative), + root_span, path: Vec::new(), - }, - domain: DomainType::Generative} + }) } LocalOrGlobal::Module(md_ref) => PartialWireReference::GlobalModuleName(md_ref), LocalOrGlobal::Type(type_ref) => { self.globals .not_expected_global_error(&type_ref, "named wire: local or constant"); - PartialWireReference::ERROR + PartialWireReference::WireReference(self.new_error(expr_span)) } - LocalOrGlobal::NotFound(_) => PartialWireReference::ERROR, // Error handled by [flatten_local_or_template_global] + LocalOrGlobal::NotFound(_) => PartialWireReference::WireReference(self.new_error(expr_span)), // Error handled by [flatten_local_or_template_global] } } kind!("array_op") => { cursor.go_down_no_check(|cursor| { cursor.field(field!("arr")); - let mut flattened_arr_expr = self.flatten_wire_reference(cursor); + let mut flattened_arr_expr = self.flatten_partial_wire_reference(cursor); cursor.field(field!("arr_idx")); let arr_idx_span = cursor.span(); @@ -1119,9 +1158,14 @@ impl<'l, 'c: 'l> FlatteningContext<'l, '_> { } => { self.errors.todo(arr_idx_span, "Module Arrays"); } - PartialWireReference::WireReference{wire_ref, domain: _} => { + PartialWireReference::WireReference(wire_ref) => { + let current_typ = wire_ref.get_output_typ(); + let output_typ = AbstractRankedType { + inner: current_typ.inner.clone(), + rank: self.type_alloc.type_alloc.rank_substitutor.alloc_unknown() + }; wire_ref.path - .push(WireReferencePathElement::ArrayAccess { idx, bracket_span }); + .push(WireReferencePathElement::ArrayAccess { idx, bracket_span, output_typ }); } } @@ -1130,20 +1174,20 @@ impl<'l, 'c: 'l> FlatteningContext<'l, '_> { } kind!("field_access") => { cursor.go_down_no_check(|cursor| { cursor.field(field!("left")); - let flattened_arr_expr = self.flatten_wire_reference(cursor); + let flattened_arr_expr = self.flatten_partial_wire_reference(cursor); let (port_name_span, port_name) = cursor.field_span(field!("name"), kind!("identifier")); match flattened_arr_expr { PartialWireReference::GlobalModuleName(md_ref) => { self.errors.error(md_ref.get_total_span(), "Ports or interfaces can only be accessed on modules that have been explicitly declared. Declare this submodule on its own line"); - PartialWireReference::ERROR + PartialWireReference::WireReference(self.new_error(expr_span)) } PartialWireReference::ModuleWithInterface { submodule_decl:_, submodule_name_span, interface:_, interface_name_span } => { self.errors.error(port_name_span, "Omit the interface when accessing a port") .suggest_remove(Span::new_overarching(submodule_name_span.empty_span_at_end(), interface_name_span)); - PartialWireReference::ERROR + PartialWireReference::WireReference(self.new_error(expr_span)) } PartialWireReference::ModuleButNoPort(submodule_decl, submodule_name_span) => { let submodule = self.instructions[submodule_decl].unwrap_submodule(); @@ -1159,45 +1203,46 @@ impl<'l, 'c: 'l> FlatteningContext<'l, '_> { port_name_span : Some(port_name_span), is_input: submod.ports[port].is_input }; - PartialWireReference::WireReference{ - wire_ref: WireReference{ + let root_typ_domain = self.type_alloc.domain_alloc.alloc_unknown(); + PartialWireReference::WireReference(WireReference{ root : WireReferenceRoot::SubModulePort(port_info), + root_typ: self.type_alloc.alloc_unset_type(root_typ_domain), + root_span: expr_span, path : Vec::new() - }, - domain: self.type_alloc.domain_alloc.alloc_unknown()} + }) } Some(PortOrInterface::Interface(interface)) => { PartialWireReference::ModuleWithInterface { submodule_decl, submodule_name_span, interface, interface_name_span: port_name_span } } - None => PartialWireReference::ERROR + None => PartialWireReference::WireReference(self.new_error(expr_span)) } } - PartialWireReference::WireReference{..} => { - println!("TODO: Struct fields"); - PartialWireReference::ERROR + PartialWireReference::WireReference(_) => { + self.errors.error(port_name_span, "TODO: Struct fields"); + PartialWireReference::WireReference(self.new_error(expr_span)) } } }) } kind!("number") => { self.errors .error(expr_span, "A constant is not a wire reference"); - PartialWireReference::ERROR + PartialWireReference::WireReference(self.new_error(expr_span)) } kind!("unary_op") | kind!("binary_op") => { self.errors.error( expr_span, "The result of an operator is not a wire reference", ); - PartialWireReference::ERROR + PartialWireReference::WireReference(self.new_error(expr_span)) } kind!("func_call") => { self.errors .error(expr_span, "A submodule call is not a wire reference"); - PartialWireReference::ERROR + PartialWireReference::WireReference(self.new_error(expr_span)) } kind!("parenthesis_expression") => { self.errors.error( expr_span, "Parentheses are not allowed within a wire reference", ); - PartialWireReference::ERROR + PartialWireReference::WireReference(self.new_error(expr_span)) } _other => cursor.could_not_match() } @@ -1363,11 +1408,7 @@ impl<'l, 'c: 'l> FlatteningContext<'l, '_> { // Skip, because we already covered domains in initialization. // TODO synchronous & async clocks - if self.is_implicit_clk_domain { - self.is_implicit_clk_domain = false; - } else { - self.named_domain_alloc.alloc(); - } + self.current_domain = self.named_domain_alloc.alloc(); } _other => cursor.could_not_match(), } @@ -1422,7 +1463,7 @@ impl<'l, 'c: 'l> FlatteningContext<'l, '_> { cursor.field(field!("expr_or_decl")); let (kind, to_span) = cursor.kind_span(); - if kind == kind!("declaration") { + let mut to = if kind == kind!("declaration") { let root = self.flatten_declaration::( self.default_declaration_context, false, @@ -1430,33 +1471,48 @@ impl<'l, 'c: 'l> FlatteningContext<'l, '_> { cursor, ); let flat_root_decl = self.instructions[root].unwrap_declaration(); - let is_generative = flat_root_decl.identifier_type.is_generative(); - let domain = if is_generative { - DomainType::Generative - } else { - self.type_alloc.domain_alloc.alloc_unknown() - }; - let to_type = self.type_alloc.alloc_unset_type(domain); - WriteTo { - to: WireReference { - root: WireReferenceRoot::LocalDecl(root, flat_root_decl.name_span), - path: Vec::new(), - }, - to_span, - write_modifiers, - to_type, + WireReference { + root: WireReferenceRoot::LocalDecl(root), + root_typ: flat_root_decl.typ.clone(), + root_span: flat_root_decl.name_span, + path: Vec::new(), } } else { // It's _expression - let (to, domain) = self.flatten_wire_reference(cursor).extract(self); - let to_type = self.type_alloc.alloc_unset_type(domain); - WriteTo { - to, - to_span, - write_modifiers, - to_type, + self.flatten_wire_reference(cursor, to_span) + }; + if let WireReferenceRoot::NamedConstant(global_reference) = &to.root { + self.errors + .error( + global_reference.name_span, + "Cannot write to a global constant!", + ) + .info_obj(&self.globals[global_reference.id].link_info); + } + match write_modifiers { + WriteModifiers::Connection { .. } => {} + WriteModifiers::Initial { initial_kw_span } => { + if to.root_typ.domain.is_generative() { + if let WireReferenceRoot::LocalDecl(decl_id) = &to.root { + self.errors + .error( + initial_kw_span, + "'initial' cannot be used with generative variables!", + ) + .info_obj_same_file( + self.instructions[*decl_id].unwrap_declaration(), + ); + } + } else { + to.root_typ.domain = DomainType::Generative; + } } } + WriteTo { + to, + to_span, + write_modifiers, + } }) }) } @@ -1547,7 +1603,6 @@ impl<'l, 'c: 'l> FlatteningContext<'l, '_> { let (name_span, module_name) = cursor.field_span(field!("name"), kind!("identifier")); self.flatten_parameters(cursor); - println!("TREE SITTER module! {module_name}"); if let Some(mut const_type_cursor) = const_type_cursor { let decl_span = const_type_cursor.span(); @@ -1621,20 +1676,15 @@ fn flatten_global(linker: &mut Linker, global_obj: GlobalUUID, cursor: &mut Curs let obj_link_info = linker.get_link_info(global_obj); let globals = GlobalResolver::new(linker, obj_link_info, errors_globals); - let _panic_guard = SpanDebugger::new("flatten_global", &obj_link_info.name, cursor.file_data); + let obj_name = &obj_link_info.name; + println!("Flattening {obj_name}"); + let _panic_guard = SpanDebugger::new("flatten_global", obj_name, cursor.file_data); let mut local_variable_context = LocalVariableContext::new_initial(); - let ( - ports_to_visit, - fields_to_visit, - default_declaration_context, - domains, - is_implicit_clk_domain, - ) = match global_obj { + let (ports_to_visit, fields_to_visit, default_declaration_context, domains) = match global_obj { GlobalUUID::Module(module_uuid) => { let md = &globals[module_uuid]; - for (id, domain) in &md.domains { if let Err(conflict) = local_variable_context.add_declaration(&domain.name, NamedLocal::DomainDecl(id)) @@ -1653,7 +1703,6 @@ fn flatten_global(linker: &mut Linker, global_obj: GlobalUUID, cursor: &mut Curs UUIDRange::empty().into_iter(), DeclarationContext::PlainWire, &md.domains, - !md.implicit_clk_domain, ) } GlobalUUID::Type(type_uuid) => { @@ -1663,7 +1712,6 @@ fn flatten_global(linker: &mut Linker, global_obj: GlobalUUID, cursor: &mut Curs typ.fields.id_range().into_iter(), DeclarationContext::StructField, &FlatAlloc::EMPTY_FLAT_ALLOC, - true, ) } GlobalUUID::Constant(_const_uuid) => ( @@ -1671,7 +1719,6 @@ fn flatten_global(linker: &mut Linker, global_obj: GlobalUUID, cursor: &mut Curs UUIDRange::empty().into_iter(), DeclarationContext::Generative(GenerativeKind::PlainGenerative), &FlatAlloc::EMPTY_FLAT_ALLOC, - true, ), }; @@ -1680,13 +1727,13 @@ fn flatten_global(linker: &mut Linker, global_obj: GlobalUUID, cursor: &mut Curs ports_to_visit, fields_to_visit, domains, - is_implicit_clk_domain, default_declaration_context, errors: &globals.errors, working_on_link_info: linker.get_link_info(global_obj), instructions: FlatAlloc::new(), type_alloc: Default::default(), named_domain_alloc: UUIDAllocator::new(), + current_domain: UUID::from_hidden_value(0), local_variable_context, }; @@ -1791,7 +1838,7 @@ fn flatten_global(linker: &mut Linker, global_obj: GlobalUUID, cursor: &mut Curs for (decl_id, instr) in &mut instructions { if let Instruction::Declaration(decl) = instr { if let DeclarationKind::GenerativeInput(this_template_id) = decl.decl_kind { - let ParameterKind::Generative(GenerativeParameterKind { + let TemplateKind::Value(GenerativeParameterKind { decl_span: _, declaration_instruction, }) = &mut link_info.template_parameters[this_template_id].kind diff --git a/src/flattening/initialization.rs b/src/flattening/initialization.rs index 95c906d0..584381af 100644 --- a/src/flattening/initialization.rs +++ b/src/flattening/initialization.rs @@ -8,7 +8,7 @@ use crate::flattening::Module; use crate::linker::{FileBuilder, LinkInfo, ResolvedGlobals}; use crate::typing::template::{ - GenerativeParameterKind, Parameter, ParameterKind, TVec, TypeParameterKind, + GenerativeParameterKind, Parameter, TVec, TemplateKind, TypeParameterKind, }; use super::parser::Cursor; @@ -47,7 +47,7 @@ impl InitializationContext<'_> { self.parameters.alloc(Parameter { name, name_span, - kind: ParameterKind::Type(TypeParameterKind {}), + kind: TemplateKind::Type(TypeParameterKind {}), }); }), kind!("declaration") => cursor.go_down_no_check(|cursor| { @@ -60,7 +60,7 @@ impl InitializationContext<'_> { self.parameters.alloc(Parameter { name, name_span, - kind: ParameterKind::Generative(GenerativeParameterKind { + kind: TemplateKind::Value(GenerativeParameterKind { decl_span, declaration_instruction: FlatID::PLACEHOLDER, }), @@ -374,9 +374,7 @@ fn initialize_global_object( link_info, ports: ctx.ports, latency_inference_info: PortLatencyInferenceInfo::default(), - named_domains: ctx.domains.id_range(), domains: ctx.domains, - implicit_clk_domain: ctx.implicit_clk_domain, interfaces: ctx.interfaces, }); } diff --git a/src/flattening/lints.rs b/src/flattening/lints.rs index c293f542..3a83f486 100644 --- a/src/flattening/lints.rs +++ b/src/flattening/lints.rs @@ -2,7 +2,7 @@ use sus_proc_macro::get_builtin_const; use crate::linker::{IsExtern, LinkInfo, AFTER_LINTS_CP}; use crate::prelude::*; -use crate::typing::template::{for_each_generative_input_in_template_args, ParameterKind}; +use crate::typing::template::{for_each_generative_input_in_template_args, TemplateKind}; use super::{ Expression, ExpressionOutput, ExpressionSource, Instruction, Module, WireReferencePathElement, @@ -30,7 +30,7 @@ pub fn perform_lints(linker: &mut Linker) { fn extern_objects_may_not_have_type_template_args(link_info: &LinkInfo, errors: &ErrorCollector) { if link_info.is_extern == IsExtern::Extern { for (_id, arg) in &link_info.template_parameters { - if let ParameterKind::Type(..) = &arg.kind { + if let TemplateKind::Type(_) = &arg.kind { errors.error( arg.name_span, "'extern' modules may not have 'type' arguments. Convert to bool[] first", diff --git a/src/flattening/mod.rs b/src/flattening/mod.rs index 8e3221f0..a918c4a9 100644 --- a/src/flattening/mod.rs +++ b/src/flattening/mod.rs @@ -6,9 +6,9 @@ mod parser; mod typechecking; mod walk; -use crate::alloc::{UUIDAllocator, UUIDRange}; +use crate::alloc::UUIDAllocator; use crate::prelude::*; -use crate::typing::abstract_type::{DomainType, PeanoType}; +use crate::typing::abstract_type::{AbstractRankedType, DomainType, PeanoType}; use crate::typing::written_type::WrittenType; use std::cell::OnceCell; @@ -58,11 +58,7 @@ pub struct Module { pub latency_inference_info: PortLatencyInferenceInfo, /// Created in Stage 1: Initialization - /// - /// [Self::domains] is then extended during abstract typechecking to add unnamed domains pub domains: FlatAlloc, - pub named_domains: UUIDRange, - pub implicit_clk_domain: bool, /// Created in Stage 1: Initialization pub interfaces: FlatAlloc, @@ -112,8 +108,17 @@ impl Module { None } + /// Temporary upgrade such that we can name the singular clock of the module, such that weirdly-named external module clocks can be used + /// + /// See #7 + pub fn get_clock_name(&self) -> &str { + &self.domains.iter().next().unwrap().1.name + } +} + +impl LinkInfo { pub fn get_instruction_span(&self, instr_id: FlatID) -> Span { - match &self.link_info.instructions[instr_id] { + match &self.instructions[instr_id] { Instruction::SubModule(sm) => sm.module_ref.get_total_span(), Instruction::Declaration(decl) => decl.decl_span, Instruction::Expression(w) => w.span, @@ -123,13 +128,6 @@ impl Module { } } } - - /// Temporary upgrade such that we can name the singular clock of the module, such that weirdly-named external module clocks can be used - /// - /// See #7 - pub fn get_clock_name(&self) -> &str { - &self.domains.iter().next().unwrap().1.name - } } /// Represents an opaque type in the compiler, like `int` or `bool`. @@ -189,6 +187,7 @@ pub enum PortOrInterface { #[derive(Debug, Clone)] pub struct DomainInfo { pub name: String, + /// May be [None] for the default `clk` domain pub name_span: Option, } @@ -199,13 +198,6 @@ pub struct InterfaceToDomainMap<'linker> { pub domains: &'linker FlatAlloc, } -impl<'linker> InterfaceToDomainMap<'linker> { - pub fn local_domain_to_global_domain(&self, domain: DomainID) -> &'linker DomainInfo { - let local_domain = self.local_domain_map[domain].unwrap_physical(); - &self.domains[local_domain] - } -} - /// What kind of wire/value does this identifier represent? /// /// We already know it's not a submodule @@ -308,11 +300,12 @@ impl Interface { /// An element in a [WireReference] path. Could be array accesses, slice accesses, field accesses, etc /// /// When executing, this turns into [crate::instantiation::RealWirePathElem] -#[derive(Debug, Clone, Copy)] +#[derive(Debug, Clone)] pub enum WireReferencePathElement { ArrayAccess { idx: FlatID, bracket_span: BracketSpan, + output_typ: AbstractRankedType, }, } @@ -327,7 +320,7 @@ pub enum WireReferenceRoot { /// ``` /// /// [FlatID] points to [Instruction::Declaration] - LocalDecl(FlatID, Span), + LocalDecl(FlatID), /// ```sus /// bool b = true // root is global constant `true` /// ``` @@ -344,7 +337,7 @@ pub enum WireReferenceRoot { impl WireReferenceRoot { pub fn get_root_flat(&self) -> Option { match self { - WireReferenceRoot::LocalDecl(f, _) => Some(*f), + WireReferenceRoot::LocalDecl(f) => Some(*f), WireReferenceRoot::NamedConstant(_) => None, WireReferenceRoot::SubModulePort(port) => Some(port.submodule_decl), WireReferenceRoot::Error => None, @@ -352,21 +345,11 @@ impl WireReferenceRoot { } #[track_caller] pub fn unwrap_local_decl(&self) -> FlatID { - let Self::LocalDecl(decl, _) = self else { + let Self::LocalDecl(decl) = self else { unreachable!() }; *decl } - pub fn get_span(&self) -> Option { - match self { - WireReferenceRoot::LocalDecl(_uuid, span) => Some(*span), - WireReferenceRoot::NamedConstant(global_reference) => { - Some(global_reference.get_total_span()) - } - WireReferenceRoot::SubModulePort(port_reference) => port_reference.port_name_span, - WireReferenceRoot::Error => None, - } - } } /// References to wires or generative variables. @@ -380,20 +363,21 @@ impl WireReferenceRoot { pub struct WireReference { pub root: WireReferenceRoot, pub path: Vec, + pub root_typ: FullType, + pub root_span: Span, } impl WireReference { - const ERROR: Self = WireReference { - root: WireReferenceRoot::Error, - path: Vec::new(), - }; pub fn is_error(&self) -> bool { matches!(&self.root, WireReferenceRoot::Error) } - fn simple_var_read(id: FlatID, name_span: Span) -> WireReference { - WireReference { - root: WireReferenceRoot::LocalDecl(id, name_span), - path: Vec::new(), + pub fn get_output_typ(&self) -> &AbstractRankedType { + if let Some(last) = self.path.last() { + match last { + WireReferencePathElement::ArrayAccess { output_typ, .. } => output_typ, + } + } else { + &self.root_typ.typ } } } @@ -438,13 +422,6 @@ pub struct WriteTo { /// Invalid [WireReference] is possible. pub to: WireReference, pub to_span: Span, - /// The type and domain to which will be written. - /// - /// The output_typ domain should be generative when to.root is generative, or a generative value is required such as with "initial" - /// When this is not the case, it should be initialized with an unknown Domain Variable - /// - /// In short, this should be the type and domain *to which* the read type must be unified. - pub to_type: FullType, pub write_modifiers: WriteModifiers, } @@ -537,7 +514,7 @@ pub enum ExpressionSource { /// - We refuse to have tuple types #[derive(Debug)] pub enum ExpressionOutput { - SubExpression(FullType), + SubExpression(AbstractRankedType), MultiWrite(Vec), } /// An [Instruction] that represents a single expression in the program. Like ((3) + (x)) @@ -565,11 +542,12 @@ impl Expression { let [single_write] = write_tos.as_slice() else { return None; }; - &single_write.to_type + single_write.to.get_output_typ() } }; Some(SingleOutputExpression { typ, + domain: self.domain, span: self.span, source: &self.source, }) @@ -660,7 +638,7 @@ pub struct SubModuleInstance { pub name: Option<(String, Span)>, /// Maps each of the module's local domains to the domain that it is used in. /// - /// These are *always* [DomainType::Physical] (of course, start out as [DomainType::DomainVariable] before typing) + /// These are *always* [DomainType::Physical] (of course, start out as [DomainType::Unknown] before typing) pub local_interface_domains: FlatAlloc, pub documentation: Documentation, } @@ -789,7 +767,8 @@ pub enum Instruction { /// Used as a convenient shorthand for [ExpressionOutput::SubExpression], to replace old uses of [Expression] #[derive(Debug, Clone, Copy)] pub struct SingleOutputExpression<'e> { - pub typ: &'e FullType, + pub typ: &'e AbstractRankedType, + pub domain: DomainType, pub span: Span, pub source: &'e ExpressionSource, } @@ -810,6 +789,7 @@ impl Instruction { }; SingleOutputExpression { typ, + domain: expr.domain, span: expr.span, source: &expr.source, } diff --git a/src/flattening/typechecking.rs b/src/flattening/typechecking.rs index f755c9b5..3e2b4c74 100644 --- a/src/flattening/typechecking.rs +++ b/src/flattening/typechecking.rs @@ -1,16 +1,17 @@ use crate::alloc::{zip_eq, ArenaAllocator}; use crate::errors::{ErrorInfo, ErrorInfoObject, FileKnowingErrorInfoObject}; use crate::prelude::*; -use crate::typing::template::{ParameterKind, TemplateArg}; -use crate::typing::type_inference::{FailedUnification, Substitutor}; +use crate::typing::abstract_type::{AbstractInnerType, AbstractRankedType}; +use crate::typing::template::TemplateArg; +use crate::typing::type_inference::{AbstractTypeSubstitutor, FailedUnification, Substitutor}; use crate::debug::SpanDebugger; -use crate::linker::{GlobalResolver, GlobalUUID, AFTER_TYPECHECK_CP}; +use crate::linker::{FileData, GlobalResolver, GlobalUUID, AFTER_TYPECHECK_CP}; use crate::typing::written_type::WrittenType; use crate::typing::{ abstract_type::{DomainType, FullTypeUnifier, BOOL_TYPE, INT_TYPE}, - template::TemplateArgKind, + template::TemplateKind, }; use super::*; @@ -50,12 +51,12 @@ pub fn typecheck_all_modules(linker: &mut Linker) { // Grab another mutable copy of md so it doesn't force a borrow conflict let working_on_mut = &mut linker.modules[module_uuid]; - apply_types( + let finalize_ctx = FinalizationContext { + linker_types: &linker.types, + errors: &errs_and_globals.0, type_checker, - working_on_mut, - &errs_and_globals.0, - &linker.types, - ); + }; + finalize_ctx.apply_types(working_on_mut); working_on_mut .link_info @@ -80,6 +81,83 @@ struct ConditionStackElem { domain: DomainType, } +struct RemoteSubModule<'l> { + submodule: &'l SubModuleInstance, + md: &'l Module, +} +impl<'l> RemoteSubModule<'l> { + fn get_port(&self, port_id: PortID) -> RemoteDeclaration<'l> { + RemoteDeclaration { + submodule: self.submodule, + remote_decl: self.md.get_port_decl(port_id), + file: self.md.link_info.file, + } + } + fn get_interface_reference(&self, interface_id: InterfaceID) -> RemoteInterface<'l> { + let interface = &self.md.interfaces[interface_id]; + RemoteInterface { + submodule: self.submodule, + md: self.md, + interface, + } + } +} +struct RemoteInterface<'l> { + submodule: &'l SubModuleInstance, + md: &'l Module, + interface: &'l Interface, +} +impl<'l> RemoteInterface<'l> { + fn get_port(&self, port_id: PortID) -> RemoteDeclaration<'l> { + RemoteDeclaration { + submodule: self.submodule, + remote_decl: self.md.get_port_decl(port_id), + file: self.md.link_info.file, + } + } +} +/// For interfaces of this module +impl FileKnowingErrorInfoObject for RemoteInterface<'_> { + fn make_global_info(&self, _files: &ArenaAllocator) -> ErrorInfo { + ErrorInfo { + position: self.interface.name_span, + file: self.md.link_info.file, + info: format!("Interface '{}' defined here", &self.interface.name), + } + } +} + +struct RemoteDeclaration<'l> { + submodule: &'l SubModuleInstance, + remote_decl: &'l Declaration, + file: FileUUID, +} +impl<'l> RemoteDeclaration<'l> { + fn get_local_type(&self, type_checker: &mut AbstractTypeSubstitutor) -> FullType { + let port_local_domain = + self.submodule.local_interface_domains[self.remote_decl.typ.domain.unwrap_physical()]; + let typ = type_checker.written_to_abstract_type_substitute_templates( + &self.remote_decl.typ_expr, + &self.submodule.module_ref.template_args, + ); + FullType { + typ, + domain: port_local_domain, + } + } + fn make_info(&self) -> ErrorInfo { + self.remote_decl.make_info(self.file).unwrap() + } + fn is_input(&self) -> bool { + self.remote_decl.decl_kind.is_io_port().unwrap() + } +} +impl FileKnowingErrorInfoObject for RemoteDeclaration<'_> { + fn make_global_info(&self, _files: &ArenaAllocator) -> ErrorInfo { + self.make_info() + } +} + struct TypeCheckingContext<'l, 'errs> { globals: &'l GlobalResolver<'l>, errors: &'errs ErrorCollector<'l>, @@ -89,59 +167,14 @@ struct TypeCheckingContext<'l, 'errs> { } impl<'l> TypeCheckingContext<'l, '_> { - fn get_decl_of_module_port( - &self, - port: PortID, - submodule_instr: FlatID, - ) -> (&'l Declaration, FileUUID) { - let submodule_id = self.working_on.instructions[submodule_instr] - .unwrap_submodule() - .module_ref - .id; - let module = &self.globals[submodule_id]; - let decl = module.get_port_decl(port); - (decl, module.link_info.file) - } - - fn get_type_of_port(&mut self, port: PortID, submodule_instr: FlatID) -> FullType { - let submodule_inst = self.working_on.instructions[submodule_instr].unwrap_submodule(); - let submodule_module = &self.globals[submodule_inst.module_ref.id]; - let decl = submodule_module.get_port_decl(port); - let port_interface = submodule_module.ports[port].domain; - let port_local_domain = submodule_inst.local_interface_domains[port_interface]; - let typ = self - .type_checker - .abstract_type_substitutor - .written_to_abstract_type_substitute_templates( - &decl.typ_expr, - &submodule_inst.module_ref.template_arg_types, - ); - FullType { - typ, - domain: port_local_domain, + fn get_submodule(&self, submodule_instr: FlatID) -> RemoteSubModule<'l> { + let submodule = self.working_on.instructions[submodule_instr].unwrap_submodule(); + RemoteSubModule { + submodule, + md: &self.globals[submodule.module_ref.id], } } - fn get_wire_ref_info(&self, wire_ref_root: &WireReferenceRoot) -> Option { - Some(match wire_ref_root { - WireReferenceRoot::LocalDecl(id, _) => { - let decl_root = self.working_on.instructions[*id].unwrap_declaration(); - decl_root.make_info(self.errors.file).unwrap() - } - WireReferenceRoot::NamedConstant(cst) => { - let linker_cst = &self.globals[cst.id]; - linker_cst.link_info.make_global_info(self.errors.files) - } - WireReferenceRoot::SubModulePort(port) => { - let (decl, file) = self.get_decl_of_module_port(port.port, port.submodule_decl); - decl.make_info(file).unwrap() - } - WireReferenceRoot::Error => { - return None; - } - }) - } - /// Wire references are used in two contexts: /// - Reading from a wire /// - Writing to a wire @@ -161,13 +194,11 @@ impl<'l> TypeCheckingContext<'l, '_> { &mut self, wire_ref: &WireReference, whole_span: Span, - output_typ: &FullType, + result_domain: DomainType, ) { - self.join_with_condition(&output_typ.domain, whole_span); - let root_type = match &wire_ref.root { - WireReferenceRoot::LocalDecl(id, _) => { - let decl_root = self.working_on.instructions[*id].unwrap_declaration(); - decl_root.typ.clone() + match &wire_ref.root { + WireReferenceRoot::LocalDecl(_uuid) => { + // When the decl was flattened, we set wire_ref.root_typ to decl.typ } WireReferenceRoot::NamedConstant(cst) => { self.typecheck_template_global(cst); @@ -180,70 +211,79 @@ impl<'l> TypeCheckingContext<'l, '_> { .abstract_type_substitutor .written_to_abstract_type_substitute_templates( &decl.typ_expr, - &cst.template_arg_types, + &cst.template_args, ); - FullType { - typ, - domain: DomainType::Generative, - } + self.type_checker + .abstract_type_substitutor + .unify_must_succeed(&wire_ref.root_typ.typ, &typ); + + assert!(wire_ref.root_typ.domain.is_generative()); } WireReferenceRoot::SubModulePort(port) => { - self.get_type_of_port(port.port, port.submodule_decl) + let submod_port = self.get_submodule(port.submodule_decl).get_port(port.port); + if submod_port.remote_decl.typ.domain.is_generative() { + self.errors + .error( + wire_ref.root_span, + "Invalid Submodule port: It is marked as generative!", + ) + .info_obj(&submod_port); + } + let submod_port_typ = + submod_port.get_local_type(&mut self.type_checker.abstract_type_substitutor); + self.type_checker + .unify_must_succeed(&wire_ref.root_typ, &submod_port_typ); } - WireReferenceRoot::Error => return, - }; + WireReferenceRoot::Error => {} + } + self.join_with_condition(&result_domain, whole_span); self.type_checker.unify_domains( - &root_type.domain, - &output_typ.domain, + &wire_ref.root_typ.domain, + &result_domain, whole_span, "wire reference root with root type", ); - let mut current_type_in_progress = root_type.typ; + let mut current_type_in_progress = &wire_ref.root_typ.typ; for p in &wire_ref.path { match p { - &WireReferencePathElement::ArrayAccess { idx, bracket_span } => { - let idx_expr = self.working_on.instructions[idx].unwrap_subexpression(); + WireReferencePathElement::ArrayAccess { + idx, + bracket_span, + output_typ, + } => { + let idx_expr = self.working_on.instructions[*idx].unwrap_subexpression(); - let new_resulting_variable = - self.type_checker.abstract_type_substitutor.alloc_unknown(); let arr_span = bracket_span.outer_span(); - { - self.type_checker - .abstract_type_substitutor - .unify_report_error( - &idx_expr.typ.typ, - &INT_TYPE.scalar(), - idx_expr.span, - "array index", - ); - self.type_checker.unify_with_array_of( - ¤t_type_in_progress, - new_resulting_variable.clone(), + self.type_checker + .abstract_type_substitutor + .unify_report_error( + idx_expr.typ, + &INT_TYPE.scalar(), + idx_expr.span, + "array index", + ); + + self.type_checker + .abstract_type_substitutor + .unify_report_error( + current_type_in_progress, + &output_typ.clone().rank_up(), arr_span, + "array access", ); - }; self.type_checker.unify_domains( - &idx_expr.typ.domain, - &output_typ.domain, + &idx_expr.domain, + &result_domain, idx_expr.span, "array access index", ); - current_type_in_progress = new_resulting_variable; + current_type_in_progress = output_typ; } } } - - self.type_checker - .abstract_type_substitutor - .unify_report_error( - &output_typ.typ, - ¤t_type_in_progress, - whole_span, - "variable reference", - ); } fn control_flow_visit_instruction(&mut self, inst_id: FlatID) { @@ -272,74 +312,68 @@ impl<'l> TypeCheckingContext<'l, '_> { .. }) => { for wr in writes { - let (decl, file) = match &wr.to.root { - WireReferenceRoot::LocalDecl(decl_id, _) => { + match &wr.to.root { + WireReferenceRoot::LocalDecl(decl_id) => { let decl = self.working_on.instructions[*decl_id].unwrap_declaration(); if decl.read_only { self.errors .error(wr.to_span, format!("'{}' is read-only", decl.name)) .info_obj_same_file(decl); } - (decl, self.errors.file) + + match wr.write_modifiers { + WriteModifiers::Connection { .. } => { + if decl.identifier_type.is_generative() { + // Check that this generative declaration isn't used in a non-compiletime if + if let Some(root_flat) = wr.to.root.get_root_flat() { + let to_decl = self.working_on.instructions[root_flat] + .unwrap_declaration(); + + let found_decl_depth = + *to_decl.declaration_runtime_depth.get().unwrap(); + if self.runtime_condition_stack.len() > found_decl_depth + { + let err_ref = self.errors.error(wr.to_span, "Cannot write to generative variables in runtime conditional block"); + err_ref.info_obj_same_file(decl); + for elem in &self.runtime_condition_stack + [found_decl_depth..] + { + err_ref.info_same_file( + elem.span, + "Runtime condition here", + ); + } + } + } + } + } + WriteModifiers::Initial { initial_kw_span } => { + if decl.identifier_type != IdentifierType::State { + self.errors + .error( + initial_kw_span, + "Initial values can only be given to state registers", + ) + .info_obj_same_file(decl); + } + } + } } WireReferenceRoot::NamedConstant(cst) => { self.errors .error(cst.name_span, "Cannot assign to a global"); - return; } WireReferenceRoot::SubModulePort(port) => { let module_port_decl = - self.get_decl_of_module_port(port.port, port.submodule_decl); + self.get_submodule(port.submodule_decl).get_port(port.port); - if !module_port_decl.0.decl_kind.is_io_port().unwrap() { + if !module_port_decl.is_input() { self.errors .error(wr.to_span, "Cannot assign to a submodule output port") - .info_obj_different_file( - module_port_decl.0, - module_port_decl.1, - ); - } - - module_port_decl - } - WireReferenceRoot::Error => { - return; - } - }; - - match wr.write_modifiers { - WriteModifiers::Connection { .. } => { - if decl.identifier_type.is_generative() { - // Check that this generative declaration isn't used in a non-compiletime if - if let Some(root_flat) = wr.to.root.get_root_flat() { - let to_decl = self.working_on.instructions[root_flat] - .unwrap_declaration(); - - let found_decl_depth = - *to_decl.declaration_runtime_depth.get().unwrap(); - if self.runtime_condition_stack.len() > found_decl_depth { - let err_ref = self.errors.error(wr.to_span, "Cannot write to generative variables in runtime conditional block"); - err_ref.info_obj_different_file(decl, file); - for elem in - &self.runtime_condition_stack[found_decl_depth..] - { - err_ref - .info((elem.span, file), "Runtime condition here"); - } - } - } - } - } - WriteModifiers::Initial { initial_kw_span } => { - if decl.identifier_type != IdentifierType::State { - self.errors - .error( - initial_kw_span, - "Initial values can only be given to state registers", - ) - .info_obj_different_file(decl, file); + .info_obj(&module_port_decl); } } + WireReferenceRoot::Error => {} } } } @@ -350,7 +384,7 @@ impl<'l> TypeCheckingContext<'l, '_> { self.runtime_condition_stack.push(ConditionStackElem { ends_at: if_stmt.else_block.1, span: condition_expr.span, - domain: condition_expr.typ.domain, + domain: condition_expr.domain, }); } } @@ -365,33 +399,13 @@ impl<'l> TypeCheckingContext<'l, '_> { let global_obj: GlobalUUID = global_ref.id.into(); let target_link_info = self.globals.get_link_info(global_obj); - for (_, argument_type, given_arg) in - zip_eq(&global_ref.template_arg_types, &global_ref.template_args) - { - if let Some(TemplateArg { - kind: TemplateArgKind::Type(wr_typ), - .. - }) = given_arg - { - self.typecheck_written_type(wr_typ); - // This slot will not have been filled out yet - let specified_arg_type = self - .type_checker - .abstract_type_substitutor - .written_to_abstract_type(wr_typ); - self.type_checker - .abstract_type_substitutor - .unify_must_succeed(argument_type, &specified_arg_type); - } - } - - for (_parameter_id, argument_type, parameter) in zip_eq( - &global_ref.template_arg_types, + for (_parameter_id, arg, parameter) in zip_eq( + &global_ref.template_args, &target_link_info.template_parameters, ) { - match ¶meter.kind { - ParameterKind::Type(_) => {} // Do nothing, nothing to unify with. Maybe in the future traits? - ParameterKind::Generative(parameter) => { + match arg.and_by_ref(¶meter.kind) { + TemplateKind::Type(_) => {} // Do nothing, nothing to unify with. Maybe in the future traits? + TemplateKind::Value((arg, parameter)) => { let decl = target_link_info.instructions[parameter.declaration_instruction] .unwrap_declaration(); @@ -400,34 +414,33 @@ impl<'l> TypeCheckingContext<'l, '_> { .abstract_type_substitutor .written_to_abstract_type_substitute_templates( &decl.typ_expr, - &global_ref.template_arg_types, // Yes that's right. We already must substitute the templates for type variables here + &global_ref.template_args, // Yes that's right. We already must substitute the templates for type variables here ); - self.type_checker - .abstract_type_substitutor - .unify_must_succeed(argument_type, ¶m_required_typ); + match arg { + TemplateArg::Provided { + value_span, + abs_typ, + .. + } => { + self.type_checker + .abstract_type_substitutor + .unify_report_error( + abs_typ, + ¶m_required_typ, + *value_span, + "template value parameter", + ); + } + TemplateArg::NotProvided { abs_typ } => { + self.type_checker + .abstract_type_substitutor + .unify_must_succeed(abs_typ, ¶m_required_typ); + } + } } } } - - for (_, argument_type, given_arg) in - zip_eq(&global_ref.template_arg_types, &global_ref.template_args) - { - if let Some(TemplateArg { - kind: TemplateArgKind::Value(val), - .. - }) = given_arg - { - let argument_expr = self.working_on.instructions[*val].unwrap_subexpression(); - - self.type_checker.typecheck_write_to_abstract( - &argument_expr.typ.typ, - argument_type, - argument_expr.span, - "generative template argument", - ); - } - } } /// Critically, this is different from [TypeUnifier::unify_with_written_type]. @@ -447,8 +460,8 @@ impl<'l> TypeCheckingContext<'l, '_> { self.typecheck_written_type(content_typ); let idx_expr = self.working_on.instructions[*arr_idx].unwrap_subexpression(); - self.type_checker.typecheck_write_to_abstract( - &idx_expr.typ.typ, + self.type_checker.unify_write_to_abstract( + idx_expr.typ, &INT_TYPE.scalar(), idx_expr.span, "array size", @@ -480,8 +493,8 @@ impl<'l> TypeCheckingContext<'l, '_> { if let Some(latency_spec) = lat_spec { let latency_specifier_expr = self.working_on.instructions[latency_spec].unwrap_subexpression(); - self.type_checker.typecheck_write_to_abstract( - &latency_specifier_expr.typ.typ, + self.type_checker.unify_write_to_abstract( + latency_specifier_expr.typ, &INT_TYPE.scalar(), latency_specifier_expr.span, "latency specifier", @@ -489,47 +502,15 @@ impl<'l> TypeCheckingContext<'l, '_> { } } - fn typecheck_visit_write_to( - &mut self, - write_to: &WriteTo, - from_typ: &FullType, - from_span: Span, - ) { - let write_context = match write_to.write_modifiers { - WriteModifiers::Connection { .. } => "connection", - WriteModifiers::Initial { initial_kw_span: _ } => "initial value", - }; - let declared_here = self.get_wire_ref_info(&write_to.to.root); - self.type_checker - .typecheck_write_to(from_typ, &write_to.to_type, from_span, || { - ( - write_context.to_string(), - declared_here.into_iter().collect(), - ) - }); - } - - fn get_interface_reference( - &self, - interface_reference: &ModuleInterfaceReference, - ) -> (&'l Module, &'l Interface) { - let submodule = - self.working_on.instructions[interface_reference.submodule_decl].unwrap_submodule(); - let md = &self.globals[submodule.module_ref.id]; - let interface = &md.interfaces[interface_reference.submodule_interface]; - (md, interface) - } - fn report_errors_for_bad_function_call( &self, func_call: &FuncCall, + interface: &RemoteInterface<'l>, whole_func_span: Span, mut to_spans_iter: impl ExactSizeIterator, ) { - let (md, interface) = self.get_interface_reference(&func_call.interface_reference); - let arg_count = func_call.arguments.len(); - let expected_arg_count = interface.func_call_inputs.len(); + let expected_arg_count = interface.interface.func_call_inputs.len(); if arg_count != expected_arg_count { if arg_count > expected_arg_count { @@ -545,16 +526,16 @@ impl<'l> TypeCheckingContext<'l, '_> { self.errors .error(excess_args_span, format!("Excess argument. Function takes {expected_arg_count} args, but {arg_count} were passed.")) - .info_obj(&(md, interface)); + .info_obj(interface); } else { // Too few args, mention missing argument names self.errors .error(func_call.arguments_span.close_bracket(), format!("Too few arguments. Function takes {expected_arg_count} args, but {arg_count} were passed.")) - .info_obj(&(md, interface)); + .info_obj(interface); } } - let num_func_outputs = interface.func_call_outputs.len(); + let num_func_outputs = interface.interface.func_call_outputs.len(); let num_targets = to_spans_iter.size_hint().0; if num_targets != num_func_outputs { if num_targets > num_func_outputs { @@ -567,57 +548,66 @@ impl<'l> TypeCheckingContext<'l, '_> { let excess_results_span = Span::new_overarching(start_span, end_span); self.errors .error(excess_results_span, format!("Excess output targets. Function returns {num_func_outputs} results, but {num_targets} targets were given.")) - .info_obj(&(md, interface)); + .info_obj(interface); } else { self.errors .error(whole_func_span, format!("Too few output targets. Function returns {num_func_outputs} results, but {num_targets} targets were given.")) - .info_obj(&(md, interface)); + .info_obj(interface); } } } - fn typecheck_func_call(&mut self, func_call: &FuncCall) -> PortIDRange { - let (md, interface) = self.get_interface_reference(&func_call.interface_reference); + fn typecheck_func_call(&mut self, func_call: &FuncCall) -> RemoteInterface<'l> { + let interface = self + .get_submodule(func_call.interface_reference.submodule_decl) + .get_interface_reference(func_call.interface_reference.submodule_interface); - for (port, arg) in std::iter::zip(interface.func_call_inputs, &func_call.arguments) { + for (port, arg) in + std::iter::zip(interface.interface.func_call_inputs, &func_call.arguments) + { + let port_decl = interface.get_port(port); let port_type = - self.get_type_of_port(port, func_call.interface_reference.submodule_decl); - - let decl = md.get_port_decl(port); + port_decl.get_local_type(&mut self.type_checker.abstract_type_substitutor); // Typecheck the value with target type let from = self.working_on.instructions[*arg].unwrap_subexpression(); self.join_with_condition(&port_type.domain, from.span); self.type_checker - .typecheck_write_to(from.typ, &port_type, from.span, || { - ( - "function argument".to_string(), - vec![decl.make_info(md.link_info.file).unwrap()], - ) + .unify_write_to(from.typ, &from.domain, &port_type, from.span, || { + ("function argument".to_string(), vec![port_decl.make_info()]) }); } - interface.func_call_outputs + interface } fn typecheck_single_output_expr(&mut self, expr: SingleOutputExpression) { match expr.source { - ExpressionSource::WireRef(from_wire) => { - self.typecheck_wire_reference(from_wire, expr.span, expr.typ); + ExpressionSource::WireRef(wire_ref) => { + self.typecheck_wire_reference(wire_ref, expr.span, expr.domain); + + self.type_checker + .abstract_type_substitutor + .unify_report_error( + expr.typ, + wire_ref.get_output_typ(), + expr.span, + "reading from wire reference", + ); } ExpressionSource::UnaryOp { op, rank, right } => { let right_expr = self.working_on.instructions[*right].unwrap_subexpression(); self.type_checker.typecheck_unary_operator_abstr( *op, rank, - &right_expr.typ.typ, + right_expr.typ, right_expr.span, - &expr.typ.typ, + expr.typ, ); self.type_checker.unify_domains( - &right_expr.typ.domain, - &expr.typ.domain, + &right_expr.domain, + &expr.domain, right_expr.span, "unary op", ); @@ -634,65 +624,73 @@ impl<'l> TypeCheckingContext<'l, '_> { self.type_checker.typecheck_binary_operator_abstr( *op, rank, - &left_expr.typ.typ, - &right_expr.typ.typ, + left_expr.typ, + right_expr.typ, left_expr.span, right_expr.span, - &expr.typ.typ, + expr.typ, ); self.type_checker.unify_domains( - &left_expr.typ.domain, - &expr.typ.domain, + &left_expr.domain, + &expr.domain, left_expr.span, "binop left", ); self.type_checker.unify_domains( - &right_expr.typ.domain, - &expr.typ.domain, + &right_expr.domain, + &expr.domain, right_expr.span, "binop right", ); } } ExpressionSource::FuncCall(func_call) => { - let func_call_outputs = self.typecheck_func_call(func_call); + let interface = self.typecheck_func_call(func_call); self.report_errors_for_bad_function_call( func_call, + &interface, expr.span, std::iter::once(expr.span), ); - if let Some(first_output) = func_call_outputs.first() { - let port_type = self.get_type_of_port( - first_output, - func_call.interface_reference.submodule_decl, - ); + if let Some(first_output) = interface.interface.func_call_outputs.first() { + let port_decl = interface.get_port(first_output); + let port_type = + port_decl.get_local_type(&mut self.type_checker.abstract_type_substitutor); - self.type_checker.typecheck_write_to( - &port_type, + self.type_checker.unify_write_to( expr.typ, + &expr.domain, + &port_type, expr.span, "function call as expression", ); } } ExpressionSource::Constant(value) => { + let var_typ = AbstractRankedType { + inner: AbstractInnerType::Named(value.get_type_id()), + rank: PeanoType::Zero, + }; self.type_checker - .unify_with_constant(&expr.typ.typ, value, expr.span) + .unify_write_to_abstract(expr.typ, &var_typ, expr.span, "Constant"); } ExpressionSource::ArrayConstruct(arr) => { for elem_id in arr { let elem_expr = self.working_on.instructions[*elem_id].unwrap_subexpression(); - self.type_checker.unify_with_array_of( - &expr.typ.typ, - elem_expr.typ.typ.clone(), - elem_expr.span, - ); + self.type_checker + .abstract_type_substitutor + .unify_report_error( + expr.typ, + &elem_expr.typ.clone().rank_up(), + elem_expr.span, + "array access", + ); self.type_checker.unify_domains( - &elem_expr.typ.domain, - &expr.typ.domain, + &elem_expr.domain, + &expr.domain, elem_expr.span, "Array construction", ); @@ -701,21 +699,33 @@ impl<'l> TypeCheckingContext<'l, '_> { }; } fn typecheck_multi_output_expr(&mut self, expr: &Expression, multi_write: &[WriteTo]) { + for wr in multi_write { + self.typecheck_wire_reference(&wr.to, wr.to_span, expr.domain); + } match &expr.source { ExpressionSource::FuncCall(func_call) => { - let func_call_outputs = self.typecheck_func_call(func_call); + let interface = self.typecheck_func_call(func_call); self.report_errors_for_bad_function_call( func_call, + &interface, expr.span, multi_write.iter().map(|v| v.to_span), ); - for (port, to) in std::iter::zip(func_call_outputs, multi_write) { + for (port, to) in std::iter::zip(interface.interface.func_call_outputs, multi_write) + { + let port_decl = interface.get_port(port); let port_type = - self.get_type_of_port(port, func_call.interface_reference.submodule_decl); + port_decl.get_local_type(&mut self.type_checker.abstract_type_substitutor); - self.typecheck_visit_write_to(to, &port_type, expr.span); + self.type_checker.unify_write_to( + to.to.get_output_typ(), + &expr.domain, + &port_type, + to.to_span, + || ("function output".to_string(), vec![port_decl.make_info()]), + ); } } ExpressionSource::WireRef(..) @@ -723,9 +733,19 @@ impl<'l> TypeCheckingContext<'l, '_> { | ExpressionSource::BinaryOp { .. } | ExpressionSource::ArrayConstruct(..) | ExpressionSource::Constant(..) => { - if let Some(single_write) = multi_write.first() { + if let Some(first_write) = multi_write.first() { self.typecheck_single_output_expr(SingleOutputExpression { - typ: &single_write.to_type, + typ: first_write.to.get_output_typ(), + domain: expr.domain, + span: expr.span, + source: &expr.source, + }); + } else { + let sentinel = self.type_checker.abstract_type_substitutor.alloc_unknown(); + + self.typecheck_single_output_expr(SingleOutputExpression { + typ: &sentinel, + domain: expr.domain, span: expr.span, source: &expr.source, }); @@ -743,20 +763,6 @@ impl<'l> TypeCheckingContext<'l, '_> { } } } - if let ExpressionSource::WireRef(wire_ref) = &expr.source { - if let Some(first_write) = multi_write.first() { - self.typecheck_wire_reference(wire_ref, expr.span, &first_write.to_type); - } else { - let sentinel = FullType { - typ: self.type_checker.abstract_type_substitutor.alloc_unknown(), - domain: expr.domain, - }; - self.typecheck_wire_reference(wire_ref, expr.span, &sentinel); - } - } - for wr in multi_write { - self.typecheck_wire_reference(&wr.to, wr.to_span, &wr.to_type); - } } fn typecheck_visit_instruction(&mut self, instr_id: FlatID) { @@ -772,8 +778,8 @@ impl<'l> TypeCheckingContext<'l, '_> { Instruction::IfStatement(stm) => { let condition_expr = &self.working_on.instructions[stm.condition].unwrap_subexpression(); - self.type_checker.typecheck_write_to_abstract( - &condition_expr.typ.typ, + self.type_checker.unify_write_to_abstract( + condition_expr.typ, &BOOL_TYPE.scalar(), condition_expr.span, "if statement condition", @@ -784,14 +790,14 @@ impl<'l> TypeCheckingContext<'l, '_> { let start = self.working_on.instructions[stm.start].unwrap_subexpression(); let end = self.working_on.instructions[stm.end].unwrap_subexpression(); - self.type_checker.typecheck_write_to_abstract( - &start.typ.typ, + self.type_checker.unify_write_to_abstract( + start.typ, &loop_var.typ.typ, start.span, "for loop start", ); - self.type_checker.typecheck_write_to_abstract( - &end.typ.typ, + self.type_checker.unify_write_to_abstract( + end.typ, &loop_var.typ.typ, end.span, "for loop end", @@ -801,6 +807,7 @@ impl<'l> TypeCheckingContext<'l, '_> { ExpressionOutput::SubExpression(typ) => { self.typecheck_single_output_expr(SingleOutputExpression { typ, + domain: expr.domain, span: expr.span, source: &expr.source, }); @@ -828,141 +835,175 @@ impl<'l> TypeCheckingContext<'l, '_> { // ====== Free functions for actually applying the result of type checking ====== -pub fn apply_types( - mut type_checker: FullTypeUnifier, - working_on: &mut Module, - errors: &ErrorCollector, - linker_types: &ArenaAllocator, -) { - // Set the remaining domain variables that aren't associated with a module port. - // We just find domain IDs that haven't been - let mut leftover_domain_alloc = - UUIDAllocator::new_start_from(working_on.domains.get_next_alloc_id()); - for (_, d) in type_checker.domain_substitutor.iter() { - if d.get().is_none() { - assert!(d - .set(DomainType::Physical(leftover_domain_alloc.alloc())) - .is_ok()); - } - } +struct FinalizationContext<'l, 'errs> { + linker_types: &'l ArenaAllocator, + errors: &'errs ErrorCollector<'l>, + type_checker: FullTypeUnifier, +} - // Assign names to all of the domains in this module - working_on.domains = leftover_domain_alloc.as_range().map(|id| { - if let Some(work_on_domain) = working_on.domains.get(id) { - work_on_domain.clone() - } else { - DomainInfo { - name: format!("domain_{}", id.get_hidden_value()), - name_span: None, +impl FinalizationContext<'_, '_> { + pub fn apply_types(mut self, working_on: &mut Module) { + // Set the remaining domain variables that aren't associated with a module port. + // We just find domain IDs that haven't been + let mut leftover_domain_alloc = + UUIDAllocator::new_start_from(working_on.domains.get_next_alloc_id()); + for (_, d) in self.type_checker.domain_substitutor.iter() { + if d.get().is_none() { + assert!(d + .set(DomainType::Physical(leftover_domain_alloc.alloc())) + .is_ok()); } } - }); - - // Post type application. Solidify types and flag any remaining AbstractType::Unknown - for (_id, inst) in working_on.link_info.instructions.iter_mut() { - match inst { - Instruction::Expression(expr) => { - type_checker.finalize_domain_type(&mut expr.domain); - match &mut expr.output { - ExpressionOutput::SubExpression(expr_typ) => { - type_checker.finalize_type(linker_types, expr_typ, expr.span, errors); + + // Post type application. Solidify types and flag any remaining AbstractType::Unknown + for (_id, inst) in working_on.link_info.instructions.iter_mut() { + match inst { + Instruction::Expression(expr) => { + self.finalize_domain_type(&mut expr.domain); + match &mut expr.output { + ExpressionOutput::SubExpression(expr_typ) => { + self.finalize_abstract_type(expr_typ, expr.span); + } + ExpressionOutput::MultiWrite(write_tos) => { + for wr in write_tos { + self.finalize_wire_ref(&mut wr.to); + } + } } - ExpressionOutput::MultiWrite(write_tos) => { - for wr in write_tos { - type_checker.finalize_type( - linker_types, - &mut wr.to_type, - wr.to_span, - errors, - ); - type_checker.finalize_wire_ref(linker_types, &mut wr.to, errors); + match &mut expr.source { + ExpressionSource::WireRef(wr) => { + self.finalize_wire_ref(wr); + } + ExpressionSource::UnaryOp { rank, .. } + | ExpressionSource::BinaryOp { rank, .. } => { + let _ = rank.fully_substitute( + &self.type_checker.abstract_type_substitutor.rank_substitutor, + ); // No need to report incomplete peano error, as one of the ports would have reported it } + _ => {} } } - match &mut expr.source { - ExpressionSource::WireRef(wr) => { - type_checker.finalize_wire_ref(linker_types, wr, errors); - } - ExpressionSource::UnaryOp { rank, .. } - | ExpressionSource::BinaryOp { rank, .. } => { - let _ = type_checker - .abstract_type_substitutor - .rank_substitutor - .fully_substitute(rank); // No need to report incomplete peano error, as one of the ports would have reported it + Instruction::Declaration(decl) => self.finalize_type(&mut decl.typ, decl.name_span), + // TODO Submodule domains may not be crossed either? + Instruction::SubModule(sm) => { + for (_domain_id_in_submodule, domain_assigned_to_it_here) in + &mut sm.local_interface_domains + { + self.finalize_domain_type(domain_assigned_to_it_here); } - _ => {} - } - } - Instruction::Declaration(decl) => { - type_checker.finalize_type(linker_types, &mut decl.typ, decl.name_span, errors) - } - // TODO Submodule domains may not be crossed either? - Instruction::SubModule(sm) => { - for (_domain_id_in_submodule, domain_assigned_to_it_here) in - &mut sm.local_interface_domains - { - type_checker.finalize_domain_type(domain_assigned_to_it_here); + self.finalize_global_ref(&mut sm.module_ref); } - type_checker.finalize_global_ref(linker_types, &mut sm.module_ref, errors); + _other => {} } - _other => {} } - } - // Print all errors - for FailedUnification { - mut found, - mut expected, - span, - context, - infos, - } in type_checker.abstract_type_substitutor.extract_errors() - { - // Not being able to fully substitute is not an issue. We just display partial types - let _ = type_checker - .abstract_type_substitutor - .fully_substitute(&mut found); - let _ = type_checker - .abstract_type_substitutor - .fully_substitute(&mut expected); - - let expected_name = expected - .display(linker_types, &type_checker.template_type_names) - .to_string(); - let found_name = found - .display(linker_types, &type_checker.template_type_names) - .to_string(); - errors + // Print all errors + for FailedUnification { + mut found, + mut expected, + span, + context, + infos, + } in self.type_checker.abstract_type_substitutor.extract_errors() + { + // Not being able to fully substitute is not an issue. We just display partial types + let _ = found.fully_substitute(&self.type_checker.abstract_type_substitutor); + let _ = expected.fully_substitute(&self.type_checker.abstract_type_substitutor); + + let expected_name = expected + .display(self.linker_types, &self.type_checker.template_type_names) + .to_string(); + let found_name = found + .display(self.linker_types, &self.type_checker.template_type_names) + .to_string(); + self.errors .error(span, format!("Typing Error: {context} expects a {expected_name} but was given a {found_name}")) .add_info_list(infos); - assert!( - expected_name != found_name, - "{expected_name} != {found_name}" - ); - } - for FailedUnification { - mut found, - mut expected, - span, - context, - infos, - } in type_checker.domain_substitutor.extract_errors() - { - assert!(type_checker.domain_substitutor.fully_substitute(&mut found)); - assert!(type_checker - .domain_substitutor - .fully_substitute(&mut expected)); - - let expected_name = format!("{expected:?}"); - let found_name = format!("{found:?}"); - errors + assert_ne!(found, expected); + + /*assert!( + expected_name != found_name, + "{expected_name} != {found_name}" + );*/ + } + for FailedUnification { + mut found, + mut expected, + span, + context, + infos, + } in self.type_checker.domain_substitutor.extract_errors() + { + let _ = found.fully_substitute(&self.type_checker.domain_substitutor); + let _ = expected.fully_substitute(&self.type_checker.domain_substitutor); + + let expected_name = format!("{expected:?}"); + let found_name = format!("{found:?}"); + self.errors .error(span, format!("Domain error: Attempting to combine domains {found_name} and {expected_name} in {context}")) .add_info_list(infos); - assert!( - expected_name != found_name, - "{expected_name} != {found_name}" - ); + assert_ne!(found, expected); + + /*assert!( + expected_name != found_name, + "{expected_name} != {found_name}" + );*/ + } + } + + pub fn finalize_abstract_type(&self, typ: &mut AbstractRankedType, span: Span) { + if !typ.fully_substitute(&self.type_checker.abstract_type_substitutor) { + self.errors.error( + span, + format!( + "Could not fully figure out the type of this object. {}", + typ.display(self.linker_types, &self.type_checker.template_type_names) + ), + ); + + if crate::debug::is_enabled("TEST") { + println!("COULD_NOT_FULLY_FIGURE_OUT") + } + } + } + + pub fn finalize_domain_type(&self, typ_domain: &mut DomainType) { + assert!(typ_domain.fully_substitute(&self.type_checker.domain_substitutor)); + } + + pub fn finalize_type(&self, typ: &mut FullType, span: Span) { + self.finalize_domain_type(&mut typ.domain); + self.finalize_abstract_type(&mut typ.typ, span); + } + + pub fn finalize_global_ref(&self, global_ref: &mut GlobalReference) { + let global_ref_span = global_ref.get_total_span(); + for (_template_id, arg) in &mut global_ref.template_args { + let template_typ = match arg { + TemplateKind::Type(t) => t.get_abstract_typ_mut(), + TemplateKind::Value(v) => v.get_abstract_typ_mut(), + }; + self.finalize_abstract_type(template_typ, global_ref_span); + } + } + + pub fn finalize_wire_ref(&self, wire_ref: &mut WireReference) { + if let WireReferenceRoot::NamedConstant(cst) = &mut wire_ref.root { + self.finalize_global_ref(cst); + } + self.finalize_type(&mut wire_ref.root_typ, wire_ref.root_span); + for path_elem in &mut wire_ref.path { + match path_elem { + WireReferencePathElement::ArrayAccess { + output_typ, + bracket_span, + .. + } => { + self.finalize_abstract_type(output_typ, bracket_span.outer_span()); + } + } + } } } diff --git a/src/flattening/walk.rs b/src/flattening/walk.rs index 0b5b62a6..4d262324 100644 --- a/src/flattening/walk.rs +++ b/src/flattening/walk.rs @@ -1,4 +1,4 @@ -use crate::typing::template::TemplateArgKind; +use crate::typing::template::{TemplateArg, TemplateKind}; use super::{ExpressionSource, WireReferencePathElement, WireReferenceRoot}; use crate::prelude::*; @@ -9,15 +9,19 @@ impl ExpressionSource { match self { ExpressionSource::WireRef(wire_ref) => { match &wire_ref.root { - WireReferenceRoot::LocalDecl(decl_id, _) => collect(*decl_id), + WireReferenceRoot::LocalDecl(decl_id) => collect(*decl_id), WireReferenceRoot::NamedConstant(cst) => { for (_id, arg) in &cst.template_args { - let Some(arg) = arg else { continue }; - match &arg.kind { - TemplateArgKind::Type(written_type) => { - written_type.for_each_generative_input(collect) - } - TemplateArgKind::Value(uuid) => collect(*uuid), + match arg { + TemplateKind::Type(TemplateArg::Provided { + arg: wr_typ, .. + }) => wr_typ.for_each_generative_input(collect), + TemplateKind::Value(TemplateArg::Provided { + arg: value_id, + .. + }) => collect(*value_id), + TemplateKind::Type(TemplateArg::NotProvided { .. }) + | TemplateKind::Value(TemplateArg::NotProvided { .. }) => {} } } } diff --git a/src/instantiation/concrete_typecheck.rs b/src/instantiation/concrete_typecheck.rs index 3b51532a..f120b0e4 100644 --- a/src/instantiation/concrete_typecheck.rs +++ b/src/instantiation/concrete_typecheck.rs @@ -1,268 +1,301 @@ use ibig::IBig; +use sus_proc_macro::get_builtin_type; use crate::alloc::{zip_eq, zip_eq3}; -use crate::typing::abstract_type::PeanoType; -use crate::typing::{ - concrete_type::{ConcreteType, BOOL_CONCRETE_TYPE, INT_CONCRETE_TYPE}, - type_inference::{ - DelayedConstraint, DelayedConstraintStatus, DelayedConstraintsList, FailedUnification, - }, -}; +use crate::typing::set_unifier::{DelayedErrorCollector, FullySubstitutable}; +use crate::typing::value_unifier::{ValueErrorReporter, ValueUnifierStore}; +use crate::typing::{concrete_type::ConcreteType, value_unifier::ValueUnifier}; use super::*; -use crate::typing::type_inference::{Substitutor, TypeSubstitutor}; +macro_rules! unifier_constraint_ints { + ($unifier:ident, [$($var:ident),+], $body:block) => { + $unifier.add_constraint([$($var),+], move |$unifier| { + $(let $var = $unifier.unwrap_known($var).unwrap_integer();)+ + $body + }) + }; +} -impl InstantiationContext<'_, '_> { - fn peano_to_nested_array_of( - &mut self, - p: &PeanoType, - c: ConcreteType, - dims: &mut Vec, - ) -> ConcreteType { - match p { - PeanoType::Zero => c, - PeanoType::Succ(p) => { - let this_dim_var = self.type_substitutor.alloc_unknown(); - let arr = ConcreteType::Array(Box::new((c, this_dim_var.clone()))); - let typ = self.peano_to_nested_array_of(p, arr, dims); - dims.push(this_dim_var.clone()); - typ - } - _ => unreachable!("Peano abstract ranks being used at concrete type-checking time should never be anything other than Zero, Succ or Named ({p:?})"), - } - } - fn walk_type_along_path( - type_substitutor: &mut TypeUnifier>, - mut current_type_in_progress: ConcreteType, - path: &[RealWirePathElem], - ) -> ConcreteType { - for p in path { - let typ_after_applying_array = type_substitutor.alloc_unknown(); - match p { - RealWirePathElem::ArrayAccess { - span: _, - idx_wire: _, - } => { - // TODO #28 integer size <-> array bound check - let arr_size = type_substitutor.alloc_unknown(); - let arr_box = Box::new((typ_after_applying_array.clone(), arr_size)); - type_substitutor.unify_must_succeed( - ¤t_type_in_progress, - &ConcreteType::Array(arr_box), - ); - current_type_in_progress = typ_after_applying_array; - } +macro_rules! assert_due_to_variable_clones { + ($cond:expr) => { + assert!($cond, "This assertion cannot fail, because the variables that caused the unification failure should have been cloned in execute") + }; +} + +fn unify_rank<'inst>( + rank: &'inst [UnifyableValue], + mut typ: &'inst ConcreteType, + unifier: &mut ValueUnifier<'inst>, +) -> bool { + rank.iter().all(|r| { + let_unwrap!(ConcreteType::Array(arr), typ); + typ = &arr.0; + unifier.unify(r, &arr.1) + }) +} + +impl<'inst, 'l: 'inst> ModuleTypingContext<'l> { + pub fn typecheck(&mut self, type_substitutor_alloc: ValueUnifierAlloc) { + let error_reporter = DelayedErrorCollector::new(); + + let mut unifier = ValueUnifier::from_alloc(type_substitutor_alloc); + + self.typecheck_all_wires(&mut unifier, &error_reporter); + self.typecheck_all_submodules(&mut unifier); + + unifier.execute_ready_constraints(); + + loop { + self.infer_parameters_for_latencies(&mut unifier); + if !unifier.execute_ready_constraints() { + break; } } - current_type_in_progress - } + let substitutor = unifier.decomission(); - fn typecheck_all_wires(&mut self) { - for this_wire_id in self.wires.id_range() { - let this_wire = &self.wires[this_wire_id]; - let span = self.md.get_instruction_span(this_wire.original_instruction); + error_reporter.report(&substitutor); + + self.finalize(&substitutor); + + self.compute_latencies(&substitutor); + } + fn typecheck_all_wires( + &'inst self, + unifier: &mut ValueUnifier<'inst>, + errors: &ValueErrorReporter<'inst>, + ) { + for (_, out) in &self.wires { + let original_instr = &self.link_info.instructions[out.original_instruction]; + let span = original_instr.get_span(); span.debug(); - match &this_wire.source { + match &out.source { RealWireDataSource::ReadOnly => {} - RealWireDataSource::Multiplexer { is_state, sources } => { - if let Some(is_state) = is_state { - let value_typ = is_state.get_type(&mut self.type_substitutor); - self.type_substitutor.unify_report_error( - &value_typ, - &this_wire.typ, - span, - "initial value of state", - ); - } - for s in sources { - let source_typ = &self.wires[s.from].typ; - let destination_typ = Self::walk_type_along_path( - &mut self.type_substitutor, - self.wires[this_wire_id].typ.clone(), - &s.to_path, - ); - self.type_substitutor.unify_report_error( - &destination_typ, - source_typ, - span, - "write wire access", - ); - } + RealWireDataSource::Multiplexer { + is_state: _, + sources, + } => { + unifier.create_subtype_constraint(sources.iter().map(|s| { + let source_wire = &self.wires[s.from]; + let destination_typ = out.typ.walk_path(&s.to_path); + (destination_typ, &source_wire.typ) + })); } - &RealWireDataSource::UnaryOp { op, rank: _, right } => { + RealWireDataSource::UnaryOp { op, rank, right } => { // TODO overloading - let (input_typ, output_typ) = match op { - UnaryOperator::Not => (BOOL_CONCRETE_TYPE, BOOL_CONCRETE_TYPE), - UnaryOperator::Negate => (INT_CONCRETE_TYPE, INT_CONCRETE_TYPE), - UnaryOperator::And | UnaryOperator::Or | UnaryOperator::Xor => ( - self.type_substitutor.make_array_of(BOOL_CONCRETE_TYPE), - BOOL_CONCRETE_TYPE, - ), - UnaryOperator::Sum | UnaryOperator::Product => ( - self.type_substitutor.make_array_of(INT_CONCRETE_TYPE), - INT_CONCRETE_TYPE, - ), - }; - - self.type_substitutor.unify_report_error( - &self.wires[right].typ, - &input_typ, - span, - "unary input", - ); - self.type_substitutor.unify_report_error( - &self.wires[this_wire_id].typ, - &output_typ, - span, - "unary output", - ); + let right = &self.wires[*right]; + let out_root = out.typ.walk_rank(rank.len()); + let right_root = right.typ.walk_rank(rank.len()); + assert_due_to_variable_clones!(unify_rank(rank, &out.typ, unifier)); + if !unify_rank(rank, &right.typ, unifier) { + errors.error(|substitutor| { + self.errors + .error(right.get_span(self.link_info), format!("Incompatible multi-rank for higher-rank operator: Found {} but output is {}", + right.typ.display_substitute(self.linker, substitutor), + out.typ.display_substitute(self.linker, substitutor)) + ); + }); + } + match op { + UnaryOperator::Not => { + assert_eq!(right_root.unwrap_named().id, get_builtin_type!("bool")); + assert_eq!(out_root.unwrap_named().id, get_builtin_type!("bool")); + } + UnaryOperator::And | UnaryOperator::Or | UnaryOperator::Xor => { + assert_eq!( + right_root.unwrap_array().0.unwrap_named().id, + get_builtin_type!("bool") + ); + assert_eq!(out_root.unwrap_named().id, get_builtin_type!("bool")); + } + UnaryOperator::Negate => { + let [min, max] = right_root.get_value_args(get_builtin_type!("int")); + + unifier_constraint_ints!(unifier, [min, max], { + assert!(right_root.set_named_template_args( + get_builtin_type!("int"), + unifier, + [-(max.clone()), -(min.clone())] + )); + }); + } + UnaryOperator::Sum => { + let (content, sz) = right_root.unwrap_array(); + let [min, max] = content.get_value_args(get_builtin_type!("int")); + + unifier_constraint_ints!(unifier, [min, max, sz], { + assert!(out_root.set_named_template_args( + get_builtin_type!("int"), + unifier, + [min * sz, max * sz] + )); + }); + } + UnaryOperator::Product => { + let (content, sz) = right_root.unwrap_array(); + let [min, max] = content.get_value_args(get_builtin_type!("int")); + + unifier_constraint_ints!(unifier, [min, max, sz], { + let sz = usize::try_from(sz).unwrap(); + assert!(out_root.set_named_template_args( + get_builtin_type!("int"), + unifier, + [min.pow(sz), max.pow(sz)] + )); + }); + } + } } - &RealWireDataSource::BinaryOp { + RealWireDataSource::BinaryOp { op, - rank: _, + rank, left, right, } => { + let left = &self.wires[*left]; + let right = &self.wires[*right]; + let out_root = out.typ.walk_rank(rank.len()); + let left_root = left.typ.walk_rank(rank.len()); + let right_root = right.typ.walk_rank(rank.len()); + assert_due_to_variable_clones!(unify_rank(rank, &out.typ, unifier)); + if !unify_rank(rank, &left.typ, unifier) { + errors.error(|substitutor| { + self.errors + .error(left.get_span(self.link_info), format!("Incompatible multi-rank for higher-rank operator: Found {} but output is {}", + left.typ.display_substitute(self.linker, substitutor), + out.typ.display_substitute(self.linker, substitutor)) + ).info_same_file(right.get_span(self.link_info), format!("Right argument has type {}", right.typ.display_substitute(self.linker, substitutor))); + }); + } + if !unify_rank(rank, &right.typ, unifier) { + errors.error(|substitutor| { + self.errors + .error(right.get_span(self.link_info), format!("Incompatible multi-rank for higher-rank operator: Found {} but output is {}", + right.typ.display_substitute(self.linker, substitutor), + out.typ.display_substitute(self.linker, substitutor)) + ).info_same_file(left.get_span(self.link_info), format!("Left argument has type {}", left.typ.display_substitute(self.linker, substitutor))); + }); + } // TODO overloading - let ((left_typ, right_typ), output_typ) = match op { - BinaryOperator::And => { - ((BOOL_CONCRETE_TYPE, BOOL_CONCRETE_TYPE), BOOL_CONCRETE_TYPE) - } - BinaryOperator::Or => { - ((BOOL_CONCRETE_TYPE, BOOL_CONCRETE_TYPE), BOOL_CONCRETE_TYPE) - } - BinaryOperator::Xor => { - ((BOOL_CONCRETE_TYPE, BOOL_CONCRETE_TYPE), BOOL_CONCRETE_TYPE) - } - BinaryOperator::Add => { - ((INT_CONCRETE_TYPE, INT_CONCRETE_TYPE), INT_CONCRETE_TYPE) - } - BinaryOperator::Subtract => { - ((INT_CONCRETE_TYPE, INT_CONCRETE_TYPE), INT_CONCRETE_TYPE) - } - BinaryOperator::Multiply => { - ((INT_CONCRETE_TYPE, INT_CONCRETE_TYPE), INT_CONCRETE_TYPE) + // Typecheck generic INT + match op { + BinaryOperator::And | BinaryOperator::Or | BinaryOperator::Xor => { + assert_eq!(left_root.unwrap_named().id, get_builtin_type!("bool")); + assert_eq!(right_root.unwrap_named().id, get_builtin_type!("bool")); + assert_eq!(out_root.unwrap_named().id, get_builtin_type!("bool")); } - BinaryOperator::Divide => { - ((INT_CONCRETE_TYPE, INT_CONCRETE_TYPE), INT_CONCRETE_TYPE) + BinaryOperator::Add + | BinaryOperator::Subtract + | BinaryOperator::Multiply + | BinaryOperator::Divide + | BinaryOperator::Modulo => { + let [left_min, left_max] = + left_root.get_value_args(get_builtin_type!("int")); + let [right_min, right_max] = + right_root.get_value_args(get_builtin_type!("int")); + unifier_constraint_ints!( + unifier, + [left_min, left_max, right_min, right_max], + { + let (out_min, out_max) = match op { + BinaryOperator::Add => { + (right_min + left_min, right_max + left_max) + } + BinaryOperator::Subtract => { + (left_min - right_max, left_max - right_min) + } + BinaryOperator::Multiply => { + let potentials = [ + left_min * right_min, + left_min * right_max, + left_max * right_min, + left_max * right_max, + ]; + ( + potentials.iter().min().unwrap().clone(), + potentials.iter().max().unwrap().clone(), + ) + } + BinaryOperator::Divide => { + if right_min <= &IBig::from(0) + && right_max >= &IBig::from(0) + { + self.errors.error(right.get_span(self.link_info), format!("Divisor may not possibly be == 0, but its range is {right_min}..{right_max}")); + (IBig::from(0), IBig::from(0)) + } else { + let potentials = [ + left_min / right_max, + left_min / right_min, + left_max / right_max, + left_max / right_min, + ]; + ( + potentials.iter().min().unwrap().clone(), + potentials.iter().max().unwrap().clone(), + ) + } + } + BinaryOperator::Modulo => { + if !right_min > IBig::from(0) { + self.errors.error(right.get_span(self.link_info), format!("Modulo divisor must be > 0, but its range is {right_min}..{right_max}")); + (IBig::from(0), IBig::from(0)) + } else { + (IBig::from(0), right_max - IBig::from(1)) + } + } + _ => { + unreachable!("The BinaryOpTypecheckConstraint should only check arithmetic operations but got {}", op); + } + }; + assert!(out.typ.set_named_template_args( + get_builtin_type!("int"), + unifier, + [out_min, out_max] + )) + } + ); } - BinaryOperator::Modulo => { - ((INT_CONCRETE_TYPE, INT_CONCRETE_TYPE), INT_CONCRETE_TYPE) - } - BinaryOperator::Equals => { - ((INT_CONCRETE_TYPE, INT_CONCRETE_TYPE), BOOL_CONCRETE_TYPE) - } - BinaryOperator::NotEquals => { - ((INT_CONCRETE_TYPE, INT_CONCRETE_TYPE), BOOL_CONCRETE_TYPE) - } - BinaryOperator::GreaterEq => { - ((INT_CONCRETE_TYPE, INT_CONCRETE_TYPE), BOOL_CONCRETE_TYPE) - } - BinaryOperator::Greater => { - ((INT_CONCRETE_TYPE, INT_CONCRETE_TYPE), BOOL_CONCRETE_TYPE) - } - BinaryOperator::LesserEq => { - ((INT_CONCRETE_TYPE, INT_CONCRETE_TYPE), BOOL_CONCRETE_TYPE) + BinaryOperator::Equals | BinaryOperator::NotEquals => { + if !unifier.unify_concrete::(left_root, right_root) { + errors.error(move |substitutor| { + self.errors.error( + span, + format!( + "Typecheck error: Found {}, but expected {}", + right_root.display_substitute(self.linker, substitutor), + left_root.display_substitute(self.linker, substitutor) + ), + ); + }); + } + assert_eq!(out_root.unwrap_named().id, get_builtin_type!("bool")); } - BinaryOperator::Lesser => { - ((INT_CONCRETE_TYPE, INT_CONCRETE_TYPE), BOOL_CONCRETE_TYPE) + BinaryOperator::GreaterEq + | BinaryOperator::Greater + | BinaryOperator::LesserEq + | BinaryOperator::Lesser => { + assert_eq!(left_root.unwrap_named().id, get_builtin_type!("int")); + assert_eq!(right_root.unwrap_named().id, get_builtin_type!("int")); + assert_eq!(out_root.unwrap_named().id, get_builtin_type!("bool")); } - }; - - // gets the corresponding abstract type to figure out how many layers of array to unify with: - let peano_type = &self.md.link_info.instructions - [this_wire.original_instruction] - .unwrap_expression() - .as_single_output_expr() - .unwrap() - .typ - .typ - .rank; - let mut out_dims = vec![]; - let out_type = - self.peano_to_nested_array_of(peano_type, output_typ, &mut out_dims); - - let mut in_left_dims = vec![]; - let in_left_type = - self.peano_to_nested_array_of(peano_type, left_typ, &mut in_left_dims); - - for (in_left, out) in out_dims.iter().zip(in_left_dims.iter()) { - self.type_substitutor.unify_report_error( - in_left, - out, - span, - "binary output dimension", - ); - } - - let mut in_right_dims = vec![]; - let in_right_type = - self.peano_to_nested_array_of(peano_type, right_typ, &mut in_right_dims); - - for (in_right, out) in out_dims.iter().zip(in_right_dims.iter()) { - self.type_substitutor.unify_report_error( - in_right, - out, - span, - "binary output dimension", - ); } - - self.type_substitutor.unify_report_error( - &self.wires[this_wire_id].typ, - &out_type, - span, - "binary output", - ); - self.type_substitutor.unify_report_error( - &self.wires[left].typ, - &in_left_type, - span, - "binary left", - ); - self.type_substitutor.unify_report_error( - &self.wires[right].typ, - &in_right_type, - span, - "binary right", - ); } RealWireDataSource::Select { root, path } => { - let found_typ = Self::walk_type_along_path( - &mut self.type_substitutor, - self.wires[*root].typ.clone(), - path, - ); - self.type_substitutor.unify_report_error( - &found_typ, - &self.wires[this_wire_id].typ, - span, - "wire access", - ); + let found_typ = self.wires[*root].typ.walk_path(path); + let _ = unifier.unify_concrete::(&out.typ, found_typ); } RealWireDataSource::ConstructArray { array_wires } => { - let mut array_wires_iter = array_wires.iter(); - let first_elem = array_wires_iter.next().unwrap(); - let element_type = self.wires[*first_elem].typ.clone(); - for w in array_wires_iter { - self.type_substitutor.unify_report_error( - &self.wires[*w].typ, - &element_type, - span, - "array construction", - ); - } - let array_size_value = - ConcreteType::Value(Value::Integer(IBig::from(array_wires.len()))); - self.type_substitutor.unify_report_error( - &self.wires[this_wire_id].typ, - &ConcreteType::Array(Box::new((element_type, array_size_value))), - span, - "array construction", - ); + let (array_content_supertyp, array_size) = out.typ.unwrap_array(); + + unifier.create_subtype_constraint(array_wires.iter().map(|w_id| { + let w = &self.wires[*w_id]; + (array_content_supertyp, &w.typ) + })); + + // Error is reported in final_checks + let _ = unifier.set(array_size, Value::Integer(IBig::from(array_wires.len()))); } // type is already set when the wire was created RealWireDataSource::Constant { value: _ } => {} @@ -270,229 +303,165 @@ impl InstantiationContext<'_, '_> { } } - fn finalize(&mut self) { - for (_id, w) in &mut self.wires { - if !self.type_substitutor.fully_substitute(&mut w.typ) { - let typ_as_str = w.typ.display(&self.linker.types); - - let span = self.md.get_instruction_span(w.original_instruction); - span.debug(); - self.errors.error(span, format!("Could not finalize this type, some parameters were still unknown: {typ_as_str}")); - } - } - - // Print all errors - for FailedUnification { - mut found, - mut expected, - span, - context, - infos, - } in self.type_substitutor.extract_errors() - { - // Not being able to fully substitute is not an issue. We just display partial types - let _ = self.type_substitutor.fully_substitute(&mut found); - let _ = self.type_substitutor.fully_substitute(&mut expected); - - let expected_name = expected.display(&self.linker.types).to_string(); - let found_name = found.display(&self.linker.types).to_string(); - self.errors - .error(span, format!("Typing Error: {context} expects a {expected_name} but was given a {found_name}")) - .add_info_list(infos); - - assert!( - expected_name != found_name, - "{expected_name} != {found_name}" - ); - } - } - - pub fn typecheck(&mut self) { - let mut delayed_constraints: DelayedConstraintsList = DelayedConstraintsList::new(); - for (sm_id, sm) in &self.submodules { - let sub_module = &self.linker.modules[sm.refers_to.id]; - - for (port_id, p) in sm.port_map.iter_valids() { - let wire = &self.wires[p.maps_to_wire]; - - let port_decl_instr = sub_module.ports[port_id].declaration_instruction; - let port_decl = - sub_module.link_info.instructions[port_decl_instr].unwrap_declaration(); - - let typ_for_inference = self - .type_substitutor - .concretize_written_type_with_possible_template_args( - &port_decl.typ_expr, - &sm.refers_to.template_args, - &sub_module.link_info, - ); - - self.type_substitutor - .unify_must_succeed(&wire.typ, &typ_for_inference); - } - - delayed_constraints.push(SubmoduleTypecheckConstraint { sm_id }); - } - - self.typecheck_all_wires(); - - delayed_constraints.push(LatencyInferenceDelayedConstraint {}); - - delayed_constraints.resolve_delayed_constraints(self); - - self.finalize(); - } -} - -struct SubmoduleTypecheckConstraint { - sm_id: SubModuleID, -} + fn typecheck_all_submodules(&'inst self, unifier: &mut ValueUnifier<'inst>) { + for (_, sm) in &self.submodules { + assert!(sm.instance.get().is_none()); -impl DelayedConstraint> for SubmoduleTypecheckConstraint { - fn try_apply(&mut self, context: &mut InstantiationContext) -> DelayedConstraintStatus { - let sm = &mut context.submodules[self.sm_id]; - assert!(sm.instance.get().is_none()); + // Check if there's any argument that isn't known + let mut substitutables = Vec::new(); + sm.refers_to + .template_args + .gather_all_substitutables(&mut substitutables); - let submod_instr = - context.md.link_info.instructions[sm.original_instruction].unwrap_submodule(); + unifier.add_constraint(substitutables, |unifier| { + let submod_instr = + self.link_info.instructions[sm.original_instruction].unwrap_submodule(); - let sub_module = &context.linker.modules[sm.refers_to.id]; + let mut refers_to_clone = sm.refers_to.clone(); + refers_to_clone.template_args.fully_substitute(&unifier.store); - // Check if there's any argument that isn't known - for (_id, arg) in &mut Rc::get_mut(&mut sm.refers_to).unwrap().template_args { - if !context.type_substitutor.fully_substitute(arg) { - // We don't actually *need* to already fully_substitute here, but it's convenient and saves some work - return DelayedConstraintStatus::NoProgress; - } - } + if let Some(instance) = self + .linker + .instantiator + .instantiate(self.linker, refers_to_clone) + { + let sub_module = &self.linker.modules[sm.refers_to.id]; - if let Some(instance) = context - .linker - .instantiator - .instantiate(context.linker, sm.refers_to.clone()) - { - for (_port_id, concrete_port, source_code_port, connecting_wire) in - zip_eq3(&instance.interface_ports, &sub_module.ports, &sm.port_map) - { - match (concrete_port, connecting_wire) { - (None, None) => {} // Invalid port not connected, good! - (None, Some(connecting_wire)) => { - // Port is not enabled, but attempted to be used - // A question may be "What if no port was in the source code? There would be no error reported" - // But this is okay, because nonvisible ports are only possible for function calls - // We have a second routine that reports invalid interfaces. - for span in &connecting_wire.name_refs { - context.errors.error(*span, format!("Port '{}' is used, but the instantiated module has this port disabled", source_code_port.name)) - .info_obj_different_file(source_code_port, sub_module.link_info.file) - .info_obj_same_file(submod_instr); + for (_port_id, concrete_port, source_code_port, connecting_wire) in + zip_eq3(&instance.interface_ports, &sub_module.ports, &sm.port_map) + { + match (concrete_port, connecting_wire) { + (None, None) => {} // Invalid port not connected, good! + (None, Some(connecting_wire)) => { + // Port is not enabled, but attempted to be used + // A question may be "What if no port was in the source code? There would be no error reported" + // But this is okay, because nonvisible ports are only possible for function calls + // We have a second routine that reports invalid interfaces. + for span in &connecting_wire.name_refs { + self.errors.error(*span, format!("Port '{}' is used, but the instantiated module has this port disabled", source_code_port.name)) + .info_obj_different_file(source_code_port, sub_module.link_info.file) + .info_obj_same_file(submod_instr); + } + } + (Some(_concrete_port), None) => { + // Port is enabled, but not used + self.errors + .warn( + submod_instr.module_ref.get_total_span(), + format!("Unused port '{}'", source_code_port.name), + ) + .info_obj_different_file( + source_code_port, + sub_module.link_info.file, + ) + .info_obj_same_file(submod_instr); + } + (Some(concrete_port), Some(connecting_wire)) => { + let wire = &self.wires[connecting_wire.maps_to_wire]; + if source_code_port.is_input { + // Subtype relations always flow FORWARD. + unifier.unify_concrete::(&wire.typ, &concrete_port.typ); + } else { + unifier.unify_concrete::(&wire.typ, &concrete_port.typ); + } + } } } - (Some(_concrete_port), None) => { - // Port is enabled, but not used - context - .errors - .warn( - submod_instr.module_ref.get_total_span(), - format!("Unused port '{}'", source_code_port.name), - ) - .info_obj_different_file(source_code_port, sub_module.link_info.file) - .info_obj_same_file(submod_instr); - } - (Some(concrete_port), Some(connecting_wire)) => { - let wire = &context.wires[connecting_wire.maps_to_wire]; - context.type_substitutor.unify_report_error( - &wire.typ, - &concrete_port.typ, - submod_instr.module_ref.get_total_span(), - || { - use crate::errors::ErrorInfoObject; - let port_declared_here = source_code_port - .make_info(sub_module.link_info.file) - .unwrap(); - - ( - format!("Port '{}'", source_code_port.name), - vec![port_declared_here], - ) - }, - ); - } - } - } - for (_interface_id, interface_references, sm_interface) in - zip_eq(&sm.interface_call_sites, &sub_module.interfaces) - { - if !interface_references.is_empty() { - let interface_name = &sm_interface.name; - if let Some(representative_port) = sm_interface - .func_call_inputs - .first() - .or(sm_interface.func_call_outputs.first()) + for (_interface_id, interface_references, sm_interface) in + zip_eq(&sm.interface_call_sites, &sub_module.interfaces) { - if instance.interface_ports[representative_port].is_none() { - for span in interface_references { - context.errors.error(*span, format!("The interface '{interface_name}' is disabled in this submodule instance")) + if !interface_references.is_empty() { + let interface_name = &sm_interface.name; + if let Some(representative_port) = sm_interface + .func_call_inputs + .first() + .or(sm_interface.func_call_outputs.first()) + { + if instance.interface_ports[representative_port].is_none() { + for span in interface_references { + self.errors.error(*span, format!("The interface '{interface_name}' is disabled in this submodule instance")) + .info_obj_same_file(submod_instr) + .info((sm_interface.name_span, sub_module.link_info.file), format!("Interface '{interface_name}' declared here")); + } + } + } else { + for span in interface_references { + self.errors.todo(*span, format!("Using empty interface '{interface_name}' (This is a TODO with Actions etc)")) .info_obj_same_file(submod_instr) .info((sm_interface.name_span, sub_module.link_info.file), format!("Interface '{interface_name}' declared here")); + } + } + if sm_interface + .all_ports() + .iter() + .any(|port_id| instance.interface_ports[port_id].is_none()) + { + // We say an interface is invalid if it has an invalid port. + todo!("Invalid Interfaces"); } } - } else { - for span in interface_references { - context.errors.todo(*span, format!("Using empty interface '{interface_name}' (This is a TODO with Actions etc)")) - .info_obj_same_file(submod_instr) - .info((sm_interface.name_span, sub_module.link_info.file), format!("Interface '{interface_name}' declared here")); - } - } - if sm_interface - .all_ports() - .iter() - .any(|port_id| instance.interface_ports[port_id].is_none()) - { - // We say an interface is invalid if it has an invalid port. - todo!("Invalid Interfaces"); } - } - } - - // Overwrite the refers_to with the identical instance.global_ref - assert!(sm.refers_to == instance.global_ref); - sm.refers_to = instance.global_ref.clone(); - sm.instance - .set(instance) - .expect("Can only set an InstantiatedModule once"); - - DelayedConstraintStatus::Resolved - } else { - context.errors.error( - submod_instr.module_ref.get_total_span(), - "Error instantiating submodule", - ); - DelayedConstraintStatus::Resolved + sm.instance + .set(instance) + .expect("Can only set an InstantiatedModule once"); + } else { + self.errors.error( + submod_instr.module_ref.get_total_span(), + "Error instantiating submodule", + ); + } + }); } } - fn report_could_not_resolve_error(&self, context: &InstantiationContext) { - let sm = &context.submodules[self.sm_id]; - - let submod_instr = - context.md.link_info.instructions[sm.original_instruction].unwrap_submodule(); - - let submodule_template_args_string = - sm.refers_to.pretty_print_concrete_instance(context.linker); - let message = format!("Could not fully instantiate {submodule_template_args_string}"); + /// Calls [FullySubstitutable::fully_substitute] on everything. From this point on the substitutor is unneccesary + fn finalize(&mut self, substitutor: &ValueUnifierStore) { + for (_id, w) in &mut self.wires { + if !w.typ.fully_substitute(substitutor) { + let span = w.get_span(self.link_info); + span.debug(); + self.errors.error( + span, + format!( + "Could not finalize this type, some parameters were still unknown: {}", + w.typ.display(&self.linker.types, true) + ), + ); + } + match &mut w.source { + RealWireDataSource::UnaryOp { rank, .. } + | RealWireDataSource::BinaryOp { rank, .. } => { + for r in rank { + // Rank not fully substituting is caught by the fully_substitute calls on w + let _ = r.fully_substitute(substitutor); + } + } + _ => {} + } + } - context - .errors - .error(submod_instr.get_most_relevant_span(), message); - } -} + for (_, sm) in &mut self.submodules { + if !sm.refers_to.template_args.fully_substitute(substitutor) { + self.errors.error(sm.get_span(self.link_info), format!("Could not infer the parameters of this submodule, some parameters were still unknown: {}", + sm.refers_to.display(self.linker, true) + )); + } + if let Some(instance) = sm.instance.get() { + for (_port_id, concrete_port, connecting_wire) in + zip_eq(&instance.interface_ports, &sm.port_map) + { + let (Some(concrete_port), Some(connecting_wire)) = + (concrete_port, connecting_wire) + else { + continue; + }; -pub struct LatencyInferenceDelayedConstraint {} -impl DelayedConstraint> for LatencyInferenceDelayedConstraint { - fn try_apply(&mut self, context: &mut InstantiationContext<'_, '_>) -> DelayedConstraintStatus { - context.infer_parameters_for_latencies() + // We overwrite the ports, to have the Multiplexer inputs correctly call type errors on submodule inputs + let connecting_wire = &mut self.wires[connecting_wire.maps_to_wire]; + connecting_wire.typ.clone_from(&concrete_port.typ); + } + } + } } - - fn report_could_not_resolve_error(&self, _context: &InstantiationContext<'_, '_>) {} // Handled by incomplete submodules themselves } diff --git a/src/instantiation/execute.rs b/src/instantiation/execute.rs index d15f1ea9..25bbfe6f 100644 --- a/src/instantiation/execute.rs +++ b/src/instantiation/execute.rs @@ -7,13 +7,13 @@ use std::ops::{Deref, Index, IndexMut}; use crate::latency::CALCULATE_LATENCY_LATER; -use crate::linker::IsExtern; -use crate::typing::abstract_type::DomainType; -use crate::typing::template::GlobalReference; -use crate::typing::type_inference::Substitutor; +use crate::linker::{GlobalUUID, IsExtern, LinkInfo}; +use crate::prelude::*; +use crate::typing::abstract_type::{AbstractInnerType, AbstractRankedType, PeanoType}; +use crate::typing::concrete_type::ConcreteTemplateArg; +use crate::typing::template::{GlobalReference, TVec, TemplateArg}; use crate::typing::written_type::WrittenType; use crate::util::{unwrap_single_element, zip_eq}; -use crate::{let_unwrap, prelude::*}; use ibig::{IBig, UBig}; @@ -23,12 +23,61 @@ use crate::flattening::*; use crate::value::{compute_binary_op, compute_unary_op, Value}; use crate::typing::{ - concrete_type::{ConcreteType, INT_CONCRETE_TYPE}, - template::TemplateArgKind, + abstract_type::DomainType, concrete_type::ConcreteType, template::TemplateKind, }; use super::*; +pub fn execute( + link_info: &LinkInfo, + linker: &Linker, + working_on_template_args: &TVec, +) -> Executed { + let mut context = ExecutionContext { + generation_state: GenerationState { + link_info, + generation_state: link_info + .instructions + .map(|(_, _)| SubModuleOrWire::Unnasigned), + }, + type_substitutor: Default::default(), + //type_value_substitutor: Default::default(), + condition_stack: Vec::new(), + wires: FlatAlloc::new(), + submodules: FlatAlloc::new(), + unique_name_producer: UniqueNames::new(), + working_on_template_args, + link_info, + linker, + }; + + let execution_status = context.instantiate_code_block(link_info.instructions.id_range()); + + Executed { + wires: context.wires, + submodules: context.submodules, + type_var_alloc: context.type_substitutor, + generation_state: context.generation_state.generation_state, + execution_status, + } +} + +/// As with other contexts, this is the shared state we're lugging around while executing & typechecking a module. +struct ExecutionContext<'l> { + wires: FlatAlloc, + submodules: FlatAlloc, + type_substitutor: ValueUnifierAlloc, + + /// Used for Execution + generation_state: GenerationState<'l>, + unique_name_producer: UniqueNames, + condition_stack: Vec, + + working_on_template_args: &'l TVec, + link_info: &'l LinkInfo, + linker: &'l Linker, +} + macro_rules! caught_by_typecheck { ($arg:literal) => { panic!("{} should have been caught by typecheck!", $arg) @@ -40,9 +89,18 @@ macro_rules! caught_by_typecheck { pub type ExecutionResult = Result; +/// Every [crate::flattening::Instruction] has an associated value (See [SubModuleOrWire]). +/// They are either what this local name is currently referencing (either a wire instance or a submodule instance). +/// Or in the case of Generative values, the current value in the generative variable. +#[derive(Debug)] +struct GenerationState<'l> { + generation_state: FlatAlloc, + link_info: &'l LinkInfo, +} + impl GenerationState<'_> { fn span_of(&self, v: FlatID) -> Span { - let instr = &self.md.link_info.instructions[v]; + let instr = &self.link_info.instructions[v]; match instr { Instruction::Declaration(d) => d.name_span, Instruction::Expression(expr) => expr.span, @@ -58,7 +116,11 @@ impl GenerationState<'_> { ) -> ExecutionResult<()> { for elem in conn_path { match elem { - &WireReferencePathElement::ArrayAccess { idx, bracket_span } => { + &WireReferencePathElement::ArrayAccess { + idx, + bracket_span, + output_typ: _, + } => { let idx = self.get_generation_integer(idx)?; // Caught by typecheck let Value::Array(a_box) = target else { caught_by_typecheck!("Non-array") @@ -181,50 +243,231 @@ fn factorial(mut n: UBig) -> UBig { /// /// See [WireReferenceRoot] #[derive(Debug, Clone)] -enum RealWireRefRoot { +enum RealWireRefRoot<'t> { /// The preamble isn't really used yet, but it's there for when we have submodule arrays (soon) Wire { wire_id: WireID, preamble: Vec, }, Generative(FlatID), - Constant(Value), + Constant(Value, &'t AbstractRankedType), } -impl InstantiationContext<'_, '_> { - /// Uses the current context to turn a [WrittenType] into a [ConcreteType]. +trait Concretizer { + fn get_type(&mut self, id: TemplateID) -> ConcreteType; + fn get_value(&mut self, expr: FlatID) -> ExecutionResult; + fn alloc_unknown(&mut self) -> UnifyableValue; +} + +struct LocalTypeConcretizer<'substitutor, 'linker> { + template_args: &'linker TVec, + generation_state: &'linker GenerationState<'linker>, + type_substitutor: &'substitutor mut ValueUnifierAlloc, +} +impl Concretizer for LocalTypeConcretizer<'_, '_> { + fn get_type(&mut self, id: TemplateID) -> ConcreteType { + self.template_args[id].unwrap_type().clone() + } + fn get_value(&mut self, expr: FlatID) -> ExecutionResult { + Ok(self + .generation_state + .get_generation_value(expr)? + .clone() + .into()) + } + + fn alloc_unknown(&mut self) -> UnifyableValue { + self.type_substitutor.alloc_unknown() + } +} +struct SubModuleTypeConcretizer<'substitutor, 'linker> { + submodule_template_args: &'linker TVec, + instructions: &'linker FlatAlloc, + type_substitutor: &'substitutor mut ValueUnifierAlloc, +} +impl Concretizer for SubModuleTypeConcretizer<'_, '_> { + fn get_type(&mut self, id: TemplateID) -> ConcreteType { + self.submodule_template_args[id].unwrap_type().clone() + } + + /// Part of Template Value Inference. /// - /// Failures are fatal. - fn concretize_type(&self, typ: &WrittenType) -> ExecutionResult { - Ok(match typ { - WrittenType::Error(_) => caught_by_typecheck!("Error Type"), - WrittenType::TemplateVariable(_, template_id) => { - self.working_on_global_ref.template_args[*template_id].clone() - } - WrittenType::Named(named_type) => ConcreteType::Named(ConcreteGlobalReference { - id: named_type.id, - template_args: FlatAlloc::new(), - }), - WrittenType::Array(_, arr_box) => { - let (arr_content_typ, arr_size_wire, _bracket_span) = arr_box.deref(); - let inner_typ = self.concretize_type(arr_content_typ)?; - let arr_size = self - .generation_state - .get_generation_integer(*arr_size_wire)?; - ConcreteType::Array(Box::new(( - inner_typ, - ConcreteType::Value(Value::Integer(arr_size.clone())), - ))) + /// Specifically, for code like this: + /// + /// ```sus + /// module add_all #(int Size) { + /// input int[Size] arr // We're targeting the 'Size' within the array size + /// output int total + /// } + /// ``` + fn get_value(&mut self, expr: FlatID) -> ExecutionResult { + let expr = self.instructions[expr].unwrap_expression(); + Ok(match &expr.source { + ExpressionSource::WireRef(wr) => { + if !wr.path.is_empty() { + return Ok(self.type_substitutor.alloc_unknown()); + } // Must be a plain, no fuss reference to a de + let WireReferenceRoot::LocalDecl(wire_declaration) = &wr.root else { + return Ok(self.type_substitutor.alloc_unknown()); + }; + let template_arg_decl = self.instructions[*wire_declaration].unwrap_declaration(); + let DeclarationKind::GenerativeInput(template_id) = &template_arg_decl.decl_kind + else { + return Ok(self.type_substitutor.alloc_unknown()); + }; + self.submodule_template_args[*template_id] + .unwrap_value() + .clone() } + ExpressionSource::Constant(cst) => cst.clone().into(), + _ => self.type_substitutor.alloc_unknown(), }) } + fn alloc_unknown(&mut self) -> UnifyableValue { + self.type_substitutor.alloc_unknown() + } +} + +fn concretize_type_recurse( + linker: &Linker, + inner: &AbstractInnerType, + rank: &PeanoType, + wr_typ: Option<&WrittenType>, + concretizer: &mut impl Concretizer, +) -> ExecutionResult { + Ok(match rank { + PeanoType::Zero => match inner { + AbstractInnerType::Template(id) => concretizer.get_type(*id), + AbstractInnerType::Named(name) => { + let template_params = &linker.types[*name].link_info.template_parameters; + let template_args = match wr_typ { + Some(WrittenType::Named(wr_named)) => { + assert_eq!(wr_named.id, *name); + wr_named.template_args.try_map(|(_, arg)| { + Ok(match arg { + TemplateKind::Type(_) => { + todo!("Abstract Type Args aren't yet supported!") + } + TemplateKind::Value(TemplateArg::Provided { arg, .. }) => { + TemplateKind::Value(concretizer.get_value(*arg)?) + } + TemplateKind::Value(TemplateArg::NotProvided { .. }) => { + TemplateKind::Value(concretizer.alloc_unknown()) + } + }) + })? + } + Some(_) => unreachable!("Can't get Array from Non-Array WrittenType!"), // TODO Fix with Let bindings (#57) + None => template_params.map(|(_, arg)| match &arg.kind { + TemplateKind::Type(_) => { + todo!("Abstract Type Args aren't yet supported!") + } + TemplateKind::Value(_) => TemplateKind::Value(concretizer.alloc_unknown()), + }), + }; + + ConcreteType::Named(ConcreteGlobalReference { + id: *name, + template_args, + }) + } + AbstractInnerType::Unknown(_) => { + unreachable!("Should have been resolved already!") + } + }, + PeanoType::Succ(one_down) => { + let (new_wr_typ, size) = match wr_typ { + Some(WrittenType::Array(_span, arr)) => { + let (content, arr_size, _) = arr.deref(); + (Some(content), concretizer.get_value(*arr_size)?) + } + Some(_) => unreachable!("Impossible: Can't get Array from Non-Array WrittenType!"), // TODO Fix with Let bindings (#57) + None => (None, concretizer.alloc_unknown()), + }; + ConcreteType::Array(Box::new(( + concretize_type_recurse(linker, inner, one_down, new_wr_typ, concretizer)?, + size, + ))) + } + PeanoType::Unknown(_) => { + caught_by_typecheck!("No PeanoType::Unknown should be left in execute!") + } + }) +} + +impl<'l> ExecutionContext<'l> { + fn alloc_array_dimensions_stack(&mut self, peano_type: &PeanoType) -> Vec { + (0..peano_type.count().unwrap()) + .map(|_| self.type_substitutor.alloc_unknown()) + .collect() + } + /// Uses the current context to turn a [WrittenType] into a [ConcreteType]. + /// + /// Failures are fatal. + fn concretize_type( + &mut self, + abs: &AbstractRankedType, + wr_typ: &WrittenType, + ) -> ExecutionResult { + let mut concretizer = LocalTypeConcretizer { + template_args: self.working_on_template_args, + generation_state: &self.generation_state, + type_substitutor: &mut self.type_substitutor, + }; + concretize_type_recurse( + self.linker, + &abs.inner, + &abs.rank, + Some(wr_typ), + &mut concretizer, + ) + } + /// Uses the current context to turn a [AbstractRankedType] into a [ConcreteType]. + /// + /// Failures as impossible as we don't need to read from [Self::generation_state] + fn concretize_type_no_written_reference(&mut self, abs: &AbstractRankedType) -> ConcreteType { + let mut concretizer = LocalTypeConcretizer { + template_args: self.working_on_template_args, + generation_state: &self.generation_state, + type_substitutor: &mut self.type_substitutor, + }; + concretize_type_recurse(self.linker, &abs.inner, &abs.rank, None, &mut concretizer).unwrap() + } + /// Uses the current context to turn a [WrittenType] from a [SubModule] into a [ConcreteType]. + /// + /// Cannot fail, since we're not using [Self::generation_state] + fn concretize_submodule_port_type( + type_substitutor: &mut ValueUnifierAlloc, + linker: &Linker, + submodule_port: &Port, + submodule_template_args: &TVec, + submodule_link_info: &LinkInfo, + ) -> ConcreteType { + let submodule_decl = submodule_link_info.instructions + [submodule_port.declaration_instruction] + .unwrap_declaration(); + let mut concretizer = SubModuleTypeConcretizer { + submodule_template_args, + instructions: &submodule_link_info.instructions, + type_substitutor, + }; + concretize_type_recurse( + linker, + &submodule_decl.typ.typ.inner, + &submodule_decl.typ.typ.rank, + Some(&submodule_decl.typ_expr), + &mut concretizer, + ) + .unwrap() + } + fn instantiate_port_wire_ref_root( &mut self, port: PortID, submodule_instr: FlatID, port_name_span: Option, - ) -> RealWireRefRoot { + ) -> RealWireRefRoot<'l> { let submod_id = self.generation_state[submodule_instr].unwrap_submodule_instance(); let wire_id = self.get_submodule_port(submod_id, port, port_name_span); RealWireRefRoot::Wire { @@ -241,8 +484,7 @@ impl InstantiationContext<'_, '_> { get_builtin_const!("true") => Ok(Value::Bool(true)), get_builtin_const!("false") => Ok(Value::Bool(false)), get_builtin_const!("clog2") => { - let [val] = cst_ref.template_args.cast_to_array(); - let val = val.unwrap_value().unwrap_integer(); + let [val] = cst_ref.template_args.cast_to_int_array(); if val > &ibig::ibig!(0) { let val = UBig::try_from(val - 1).unwrap(); Ok(Value::Integer(IBig::from(val.bit_len()))) @@ -253,8 +495,7 @@ impl InstantiationContext<'_, '_> { } } get_builtin_const!("pow2") => { - let [exponent] = cst_ref.template_args.cast_to_array(); - let exponent = exponent.unwrap_value().unwrap_integer(); + let [exponent] = cst_ref.template_args.cast_to_int_array(); if let Ok(exp) = usize::try_from(exponent) { let mut result = ibig::ubig!(0); result.set_bit(exp); @@ -264,9 +505,7 @@ impl InstantiationContext<'_, '_> { } } get_builtin_const!("pow") => { - let [base, exponent] = cst_ref.template_args.cast_to_array(); - let base = base.unwrap_value().unwrap_integer(); - let exponent = exponent.unwrap_value().unwrap_integer(); + let [base, exponent] = cst_ref.template_args.cast_to_int_array(); if let Ok(exp) = usize::try_from(exponent) { Ok(Value::Integer(base.pow(exp))) } else { @@ -274,17 +513,14 @@ impl InstantiationContext<'_, '_> { } } get_builtin_const!("factorial") => { - let [n] = cst_ref.template_args.cast_to_array(); - let n = n.unwrap_value().unwrap_integer(); + let [n] = cst_ref.template_args.cast_to_int_array(); let n = must_be_positive(n, "factorial parameter")?; Ok(Value::Integer(factorial(n).into())) } get_builtin_const!("falling_factorial") => { - let [n, k] = cst_ref.template_args.cast_to_array(); - let n = n.unwrap_value().unwrap_integer(); + let [n, k] = cst_ref.template_args.cast_to_int_array(); let n = must_be_positive(n, "comb n parameter")?; - let k = k.unwrap_value().unwrap_integer(); let k = must_be_positive(k, "comb k parameter")?; if k > n { @@ -294,10 +530,8 @@ impl InstantiationContext<'_, '_> { Ok(Value::Integer(falling_factorial(n, &k).into())) } get_builtin_const!("comb") => { - let [n, k] = cst_ref.template_args.cast_to_array(); - let n = n.unwrap_value().unwrap_integer(); + let [n, k] = cst_ref.template_args.cast_to_int_array(); let n = must_be_positive(n, "comb n parameter")?; - let k = k.unwrap_value().unwrap_integer(); let k = must_be_positive(k, "comb k parameter")?; if k > n { @@ -320,7 +554,7 @@ impl InstantiationContext<'_, '_> { get_builtin_const!("sizeof") => { let [concrete_typ] = cst_ref.template_args.cast_to_array(); - if let Some(typ_sz) = concrete_typ.sizeof() { + if let Some(typ_sz) = concrete_typ.unwrap_type().sizeof() { Ok(Value::Integer(typ_sz)) } else { Err("This is an incomplete type".into()) @@ -374,10 +608,10 @@ impl InstantiationContext<'_, '_> { // Points to the wire in the hardware that corresponds to the root of this. fn determine_wire_ref_root( &mut self, - wire_ref_root: &WireReferenceRoot, - ) -> ExecutionResult { - Ok(match wire_ref_root { - &WireReferenceRoot::LocalDecl(decl_id, _) => match &self.generation_state[decl_id] { + wire_ref: &'l WireReference, + ) -> ExecutionResult> { + Ok(match &wire_ref.root { + &WireReferenceRoot::LocalDecl(decl_id) => match &self.generation_state[decl_id] { SubModuleOrWire::Wire(w) => RealWireRefRoot::Wire { wire_id: *w, preamble: Vec::new(), @@ -386,9 +620,10 @@ impl InstantiationContext<'_, '_> { SubModuleOrWire::SubModule(_) => unreachable!(), SubModuleOrWire::Unnasigned => unreachable!(), }, - WireReferenceRoot::NamedConstant(cst) => { - RealWireRefRoot::Constant(self.get_named_constant_value(cst)?) - } + WireReferenceRoot::NamedConstant(cst) => RealWireRefRoot::Constant( + self.get_named_constant_value(cst)?, + &wire_ref.root_typ.typ, + ), WireReferenceRoot::SubModulePort(port) => { return Ok(self.instantiate_port_wire_ref_root( port.port, @@ -409,14 +644,12 @@ impl InstantiationContext<'_, '_> { ) -> ExecutionResult> { for v in path { match v { - &WireReferencePathElement::ArrayAccess { idx, bracket_span } => { + &WireReferencePathElement::ArrayAccess { + idx, + bracket_span, + output_typ: _, + } => { let idx_wire = self.get_wire_or_constant_as_wire(idx, domain)?; - self.type_substitutor.unify_report_error( - &self.wires[idx_wire].typ, - &INT_CONCRETE_TYPE, - bracket_span.inner_span(), - "Caught by typecheck", - ); preamble.push(RealWirePathElem::ArrayAccess { span: bracket_span, idx_wire, @@ -434,7 +667,7 @@ impl InstantiationContext<'_, '_> { to_path: Vec, from: WireID, num_regs: i64, - original_instruction: FlatID, + wr_ref: WriteReference, ) { let RealWireDataSource::Multiplexer { is_state: _, @@ -449,15 +682,15 @@ impl InstantiationContext<'_, '_> { num_regs, from, condition: self.condition_stack.clone().into_boxed_slice(), - original_connection: original_instruction, + wr_ref, }); } fn write_non_generative( &mut self, - write_to: &WriteTo, + write_to: &'l WriteTo, from: WireID, - original_connection: FlatID, + wr_ref: WriteReference, ) -> ExecutionResult<()> { let_unwrap!( WriteModifiers::Connection { @@ -471,32 +704,26 @@ impl InstantiationContext<'_, '_> { wire_id: target_wire, preamble, }, - self.determine_wire_ref_root(&write_to.to.root)? + self.determine_wire_ref_root(&write_to.to)? ); let domain = self.wires[target_wire].domain; let instantiated_path = self.instantiate_wire_ref_path(preamble, &write_to.to.path, domain)?; - self.instantiate_write_to_wire( - target_wire, - instantiated_path, - from, - *num_regs, - original_connection, - ); + self.instantiate_write_to_wire(target_wire, instantiated_path, from, *num_regs, wr_ref); Ok(()) } fn write_generative( &mut self, - write_to: &WriteTo, + write_to: &'l WriteTo, value: Value, - original_connection: FlatID, + original_expression: FlatID, ) -> ExecutionResult<()> { match &write_to.write_modifiers { WriteModifiers::Connection { num_regs, regs_span: _, - } => match self.determine_wire_ref_root(&write_to.to.root)? { + } => match self.determine_wire_ref_root(&write_to.to)? { RealWireRefRoot::Wire { wire_id: target_wire, preamble, @@ -504,9 +731,10 @@ impl InstantiationContext<'_, '_> { let domain = self.wires[target_wire].domain; let from = self.alloc_wire_for_const( value, - original_connection, + write_to.to.get_output_typ(), + original_expression, domain, - self.md.link_info.instructions[original_connection] + self.link_info.instructions[original_expression] .unwrap_expression() .span, )?; @@ -517,7 +745,10 @@ impl InstantiationContext<'_, '_> { instantiated_path, from, *num_regs, - original_connection, + WriteReference { + original_expression, + write_idx: 0, + }, ); } RealWireRefRoot::Generative(target_decl) => { @@ -540,7 +771,7 @@ impl InstantiationContext<'_, '_> { }; *v_writable = new_val; } - RealWireRefRoot::Constant(_cst) => { + RealWireRefRoot::Constant(_cst, _) => { caught_by_typecheck!("Cannot assign to constants"); } }, @@ -566,15 +797,23 @@ impl InstantiationContext<'_, '_> { fn alloc_wire_for_const( &mut self, value: Value, + abs_typ: &AbstractRankedType, original_instruction: FlatID, domain: DomainID, const_span: Span, ) -> ExecutionResult { - if value.contains_errors_or_unsets() { + if value.contains_unset() { return Err((const_span, format!("This compile-time value was not fully resolved by the time it needed to be converted to a wire: {value}"))); } Ok(self.wires.alloc(RealWire { - typ: value.get_type(&mut self.type_substitutor), + typ: value + .concretize_type( + self.linker, + abs_typ, + self.working_on_template_args, + &mut self.type_substitutor, + ) + .map_err(|msg| (const_span, msg))?, source: RealWireDataSource::Constant { value }, original_instruction, domain, @@ -594,14 +833,14 @@ impl InstantiationContext<'_, '_> { SubModuleOrWire::Wire(w) => Ok(*w), SubModuleOrWire::CompileTimeValue(v) => { let value = v.clone(); - + let original_expr = + self.link_info.instructions[original_instruction].unwrap_subexpression(); self.alloc_wire_for_const( value, + original_expr.typ, original_instruction, domain, - self.md.link_info.instructions[original_instruction] - .unwrap_expression() - .span, + original_expr.span, ) } } @@ -624,8 +863,9 @@ impl InstantiationContext<'_, '_> { } wire_found.maps_to_wire } else { - let port_data = &self.linker.modules[submod_instance.refers_to.id].ports[port_id]; - let submodule_instruction = self.md.link_info.instructions + let submod_md = &self.linker.modules[submod_instance.refers_to.id]; + let port_data = &submod_md.ports[port_id]; + let submodule_instruction = self.link_info.instructions [submod_instance.original_instruction] .unwrap_submodule(); let source = if port_data.is_input { @@ -637,11 +877,18 @@ impl InstantiationContext<'_, '_> { RealWireDataSource::ReadOnly }; let domain = submodule_instruction.local_interface_domains[port_data.domain]; + let typ = Self::concretize_submodule_port_type( + &mut self.type_substitutor, + self.linker, + port_data, + &submod_instance.refers_to.template_args, + &submod_md.link_info, + ); let new_wire = self.wires.alloc(RealWire { source, original_instruction: submod_instance.original_instruction, domain: domain.unwrap_physical(), - typ: self.type_substitutor.alloc_unknown(), + typ, name: self .unique_name_producer .get_unique_name(format!("{}_{}", submod_instance.name, port_data.name)), @@ -665,33 +912,36 @@ impl InstantiationContext<'_, '_> { fn get_wire_ref_root_as_wire( &mut self, - wire_ref_root: &WireReferenceRoot, + wire_ref: &'l WireReference, original_instruction: FlatID, domain: DomainID, ) -> ExecutionResult<(WireID, Vec)> { - let root = self.determine_wire_ref_root(wire_ref_root)?; + let root = self.determine_wire_ref_root(wire_ref)?; Ok(match root { RealWireRefRoot::Wire { wire_id, preamble } => (wire_id, preamble), RealWireRefRoot::Generative(decl_id) => { + let decl = self.link_info.instructions[decl_id].unwrap_declaration(); let value = self.generation_state[decl_id] .unwrap_generation_value() .clone(); ( self.alloc_wire_for_const( value, + &decl.typ.typ, decl_id, domain, - wire_ref_root.get_span().unwrap(), + wire_ref.root_span, )?, Vec::new(), ) } - RealWireRefRoot::Constant(value) => ( + RealWireRefRoot::Constant(value, typ) => ( self.alloc_wire_for_const( value, + typ, original_instruction, domain, - wire_ref_root.get_span().unwrap(), + wire_ref.root_span, )?, Vec::new(), ), @@ -700,14 +950,14 @@ impl InstantiationContext<'_, '_> { fn expression_to_real_wire( &mut self, - expression: &Expression, + expression: &'l Expression, original_instruction: FlatID, domain: DomainID, ) -> ExecutionResult> { let source = match &expression.source { ExpressionSource::WireRef(wire_ref) => { let (root_wire, path_preamble) = - self.get_wire_ref_root_as_wire(&wire_ref.root, original_instruction, domain)?; + self.get_wire_ref_root_as_wire(wire_ref, original_instruction, domain)?; let path = self.instantiate_wire_ref_path(path_preamble, &wire_ref.path, domain)?; if path.is_empty() { @@ -724,7 +974,7 @@ impl InstantiationContext<'_, '_> { let right = self.get_wire_or_constant_as_wire(*right, domain)?; RealWireDataSource::UnaryOp { op: *op, - rank: rank.count_unwrap(), + rank: self.alloc_array_dimensions_stack(rank), right, } } @@ -738,7 +988,7 @@ impl InstantiationContext<'_, '_> { let right = self.get_wire_or_constant_as_wire(*right, domain)?; RealWireDataSource::BinaryOp { op: *op, - rank: rank.count_unwrap(), + rank: self.alloc_array_dimensions_stack(rank), left, right, } @@ -746,7 +996,7 @@ impl InstantiationContext<'_, '_> { ExpressionSource::FuncCall(fc) => { let submod_id = self.generation_state[fc.interface_reference.submodule_decl] .unwrap_submodule_instance(); - let original_submod_instr = self.md.link_info.instructions + let original_submod_instr = self.link_info.instructions [fc.interface_reference.submodule_decl] .unwrap_submodule(); let submod_md = &self.linker.modules[original_submod_instr.module_ref.id]; @@ -761,7 +1011,9 @@ impl InstantiationContext<'_, '_> { fc.interface_reference.interface_span, ); - for (port, arg) in zip_eq(interface.func_call_inputs, &fc.arguments) { + for (write_idx, (port, arg)) in + zip_eq(interface.func_call_inputs, &fc.arguments).enumerate() + { let from = self.get_wire_or_constant_as_wire(*arg, domain)?; let port_wire = self.get_submodule_port(submod_id, port, None); self.instantiate_write_to_wire( @@ -769,7 +1021,10 @@ impl InstantiationContext<'_, '_> { Vec::new(), from, 0, - original_instruction, + WriteReference { + original_expression: original_instruction, + write_idx, + }, ); } @@ -791,9 +1046,11 @@ impl InstantiationContext<'_, '_> { unreachable!("Constant cannot be non-compile-time"); } }; + let typ = self + .concretize_type_no_written_reference(expression.as_single_output_expr().unwrap().typ); Ok(vec![self.wires.alloc(RealWire { name: self.unique_name_producer.get_unique_name(""), - typ: self.type_substitutor.alloc_unknown(), + typ, original_instruction, domain, source, @@ -815,18 +1072,20 @@ impl InstantiationContext<'_, '_> { wire_decl: &Declaration, original_instruction: FlatID, ) -> ExecutionResult { - let typ = self.concretize_type(&wire_decl.typ_expr)?; + let typ = self.concretize_type(&wire_decl.typ.typ, &wire_decl.typ_expr)?; Ok(if wire_decl.identifier_type == IdentifierType::Generative { - let value = if let DeclarationKind::GenerativeInput(template_id) = wire_decl.decl_kind { - // Only for template arguments, we must initialize their value to the value they've been assigned in the template instantiation - self.working_on_global_ref.template_args[template_id] - .unwrap_value() - .clone() - } else { - // Empty initial value - typ.get_initial_val() - }; + let value: Value = + if let DeclarationKind::GenerativeInput(template_id) = wire_decl.decl_kind { + // Only for template arguments, we must initialize their value to the value they've been assigned in the template instantiation + self.working_on_template_args[template_id] + .unwrap_value() + .unwrap_set() + .clone() + } else { + // Empty initial value + typ.get_initial_val() + }; SubModuleOrWire::CompileTimeValue(value) } else { let source = if wire_decl.read_only { @@ -857,24 +1116,36 @@ impl InstantiationContext<'_, '_> { }) } - fn execute_global_ref( + fn execute_global_ref>( &mut self, global_ref: &GlobalReference, ) -> ExecutionResult> { - let template_args = - global_ref - .template_args - .try_map(|(_, v)| -> ExecutionResult { - Ok(match v { - Some(arg) => match &arg.kind { - TemplateArgKind::Type(typ) => self.concretize_type(typ)?, - TemplateArgKind::Value(v) => ConcreteType::Value( - self.generation_state.get_generation_value(*v)?.clone(), - ), - }, - None => self.type_substitutor.alloc_unknown(), - }) - })?; + let template_args = global_ref.template_args.try_map( + |(_, arg)| -> ExecutionResult { + Ok(match arg { + TemplateKind::Type(arg) => TemplateKind::Type(match arg { + TemplateArg::Provided { arg, abs_typ, .. } => { + self.concretize_type(abs_typ, arg)? + } + TemplateArg::NotProvided { abs_typ } => { + self.concretize_type_no_written_reference(abs_typ) + } + }), + TemplateKind::Value(arg) => TemplateKind::Value({ + match arg { + TemplateArg::Provided { arg, .. } => self + .generation_state + .get_generation_value(*arg)? + .clone() + .into(), + TemplateArg::NotProvided { .. } => { + self.type_substitutor.alloc_unknown() + } + } + }), + }) + }, + )?; Ok(ConcreteGlobalReference { id: global_ref.id, template_args, @@ -883,7 +1154,7 @@ impl InstantiationContext<'_, '_> { fn compute_compile_time_wireref(&mut self, wire_ref: &WireReference) -> ExecutionResult { let mut work_on_value: Value = match &wire_ref.root { - &WireReferenceRoot::LocalDecl(decl_id, _span) => { + &WireReferenceRoot::LocalDecl(decl_id) => { self.generation_state.get_generation_value(decl_id)?.clone() } WireReferenceRoot::NamedConstant(cst) => self.get_named_constant_value(cst)?, @@ -895,7 +1166,11 @@ impl InstantiationContext<'_, '_> { for path_elem in &wire_ref.path { work_on_value = match path_elem { - &WireReferencePathElement::ArrayAccess { idx, bracket_span } => { + &WireReferencePathElement::ArrayAccess { + idx, + bracket_span, + output_typ: _, + } => { let idx = self.generation_state.get_generation_integer(idx)?; array_access(&work_on_value, idx, bracket_span)?.clone() @@ -939,7 +1214,7 @@ impl InstantiationContext<'_, '_> { } ExpressionSource::UnaryOp { op, rank, right } => { let right_val = self.generation_state.get_generation_value(*right)?; - duplicate_for_all_array_ranks(&[right_val], rank.count_unwrap(), &mut |[v]| { + duplicate_for_all_array_ranks(&[right_val], rank.count().unwrap(), &mut |[v]| { Ok(compute_unary_op(*op, v)) }) .unwrap() @@ -955,7 +1230,7 @@ impl InstantiationContext<'_, '_> { duplicate_for_all_array_ranks( &[left_val, right_val], - rank.count_unwrap(), + rank.count().unwrap(), &mut |[l, r]| { match op { BinaryOperator::Divide | BinaryOperator::Modulo => { @@ -992,8 +1267,10 @@ impl InstantiationContext<'_, '_> { fn instantiate_code_block(&mut self, block_range: FlatIDRange) -> ExecutionResult<()> { let mut instruction_range = block_range.into_iter(); while let Some(original_instruction) = instruction_range.next() { - let instr = &self.md.link_info.instructions[original_instruction]; - self.md.get_instruction_span(original_instruction).debug(); + let instr = &self.link_info.instructions[original_instruction]; + self.link_info + .get_instruction_span(original_instruction) + .debug(); let instance_to_add: SubModuleOrWire = match instr { Instruction::SubModule(submodule) => { let sub_module = &self.linker.modules[submodule.module_ref.id]; @@ -1006,12 +1283,12 @@ impl InstantiationContext<'_, '_> { let port_map = sub_module.ports.map(|_| None); let interface_call_sites = sub_module.interfaces.map(|_| Vec::new()); - let concrete_ref = self.execute_global_ref(&submodule.module_ref)?; + let refers_to = self.execute_global_ref(&submodule.module_ref)?; SubModuleOrWire::SubModule(self.submodules.alloc(SubModule { original_instruction, instance: OnceCell::new(), - refers_to: Rc::new(concrete_ref), + refers_to, port_map, interface_call_sites, name: self.unique_name_producer.get_unique_name(name_origin), @@ -1050,11 +1327,16 @@ impl InstantiationContext<'_, '_> { if write_tos.is_empty() { continue; // See no errors on zero outputs (#79) } - for (expr_output, write) in zip_eq(output_wires, write_tos) { + for (write_idx, (expr_output, write)) in + zip_eq(output_wires, write_tos).enumerate() + { self.write_non_generative( write, expr_output, - original_instruction, + WriteReference { + original_expression: original_instruction, + write_idx, + }, )?; } continue; @@ -1107,8 +1389,8 @@ impl InstantiationContext<'_, '_> { .clone(); if start_val > end_val { let start_flat = - &self.md.link_info.instructions[stm.start].unwrap_expression(); - let end_flat = &self.md.link_info.instructions[stm.end].unwrap_expression(); + &self.link_info.instructions[stm.start].unwrap_expression(); + let end_flat = &self.link_info.instructions[stm.end].unwrap_expression(); return Err(( Span::new_overarching(start_flat.span, end_flat.span), format!("for loop range end is before begin: {start_val}:{end_val}"), @@ -1136,28 +1418,6 @@ impl InstantiationContext<'_, '_> { } Ok(()) } - - fn make_interface(&mut self) { - for (port_id, port) in &self.md.ports { - let port_decl_id = port.declaration_instruction; - if let SubModuleOrWire::Wire(wire_id) = &self.generation_state[port_decl_id] { - let wire = &self.wires[*wire_id]; - self.interface_ports[port_id] = Some(InstantiatedPort { - wire: *wire_id, - is_input: port.is_input, - absolute_latency: CALCULATE_LATENCY_LATER, - typ: wire.typ.clone(), - domain: wire.domain, - }) - } - } - } - - pub fn execute_module(&mut self) -> ExecutionResult<()> { - let result = self.instantiate_code_block(self.md.link_info.instructions.id_range()); - self.make_interface(); - result - } } #[cfg(test)] diff --git a/src/instantiation/final_checks.rs b/src/instantiation/final_checks.rs index c35be90e..b9cf4fdc 100644 --- a/src/instantiation/final_checks.rs +++ b/src/instantiation/final_checks.rs @@ -1,51 +1,133 @@ //! After instantiation, we preform a few final checks of each module. +//! - Check all subtype relations +//! - Check array bounds -use crate::{typing::concrete_type::ConcreteType, value::Value}; +use ibig::IBig; -use super::{InstantiationContext, RealWireDataSource, RealWirePathElem}; -impl InstantiationContext<'_, '_> { - fn check_array_accesses_in(&self, path: &[RealWirePathElem], mut arr_typ: &ConcreteType) { - for elem in path { - match elem { +use crate::{errors::ErrorReference, typing::concrete_type::ConcreteType}; + +use super::{ModuleTypingContext, RealWire, RealWireDataSource, RealWirePathElem}; + +impl<'l> ModuleTypingContext<'l> { + fn wire_must_be_subtype( + &self, + wire: &RealWire, + expected: &ConcreteType, + ) -> Option> { + (!wire.typ.is_subtype_of(expected)).then(|| { + self.errors.error( + wire.get_span(self.link_info), + format!( + "Typecheck error: Found {}, which is not a subtype of the expected type {}", + wire.typ.display(&self.linker.types, true), + expected.display(&self.linker.types, true) + ), + ) + }) + } + fn check_wire_ref_bounds<'c>( + &self, + mut typ: &'c ConcreteType, + path: &[RealWirePathElem], + ) -> &'c ConcreteType { + for path_elem in path { + match path_elem { RealWirePathElem::ArrayAccess { span, idx_wire } => { - let ConcreteType::Array(arr) = arr_typ else { - break; - }; // May still contain unknowns - let ConcreteType::Value(Value::Integer(arr_sz)) = &arr.1 else { - break; - }; // May still contain unknowns - arr_typ = &arr.0; - - let idx_wire_wire = &self.wires[*idx_wire]; - if let RealWireDataSource::Constant { value } = &idx_wire_wire.source { - // Constant access into array! We can check. - let integer_value = value.unwrap_integer(); - if integer_value >= arr_sz || integer_value < &ibig::ibig!(0) { - self.errors - .error(span.inner_span(), format!("Index out of bounds. Array is of size {arr_sz}, but the index is {integer_value}.")); - } + let (content, arr_sz) = typ.unwrap_array(); + let arr_sz = arr_sz.unwrap_integer(); + typ = content; + let idx_wire = &self.wires[*idx_wire]; + let (min, max) = idx_wire.typ.unwrap_integer_bounds(); + if min < &IBig::from(0) || max >= arr_sz { + self.errors.error(span.inner_span(), format!("Out of bounds! The array is of size {arr_sz}, but the index has bounds {min}..{max}")); } } } } + typ } - pub fn check_array_accesses(&self) { - for (_id, w) in &self.wires { + fn check_all_subtypes_in_wires(&self) { + for (_, w) in &self.wires { match &w.source { - RealWireDataSource::Select { root, path } => { - let from = &self.wires[*root]; - self.check_array_accesses_in(path, &from.typ); - } - RealWireDataSource::Multiplexer { - is_state: _, - sources, - } => { + RealWireDataSource::ReadOnly => {} + RealWireDataSource::Multiplexer { is_state, sources } => { + if let Some(is_state) = is_state { + if !is_state.is_of_type(&w.typ) { + self.errors.error( + w.get_span(self.link_info), + "Wire's initial value is not a subtype of the wire's type!", + ); + } + } for s in sources { - self.check_array_accesses_in(&s.to_path, &w.typ); + let target_typ = self.check_wire_ref_bounds(&w.typ, &s.to_path); + if let Some(e) = self.wire_must_be_subtype(&self.wires[s.from], target_typ) + { + if let Some(write_to) = s.wr_ref.get(self.link_info) { + e.info_same_file( + write_to.to_span, + format!( + "Writing to this, which has type {}", + target_typ.display(&self.linker.types, true) + ), + ); + } + } + } + } + RealWireDataSource::ConstructArray { array_wires } => { + let (arr_content, array_size) = w.typ.unwrap_array(); + + let array_wires_len = array_wires.len(); + let expected_array_size: usize = array_size.unwrap_int(); + + if array_wires_len != expected_array_size { + self.errors.error(w.get_span(self.link_info), format!("This construct creates an array of size {array_wires_len}, but the expected size is {expected_array_size}")); + } + + for arr_wire in array_wires { + self.wire_must_be_subtype(&self.wires[*arr_wire], arr_content); } } + RealWireDataSource::Select { root, path } => { + let root_wire = &self.wires[*root]; + let result_typ = self.check_wire_ref_bounds(&root_wire.typ, path); + assert_eq!(&w.typ, result_typ); + } _ => {} } } } + // This is unneeded for now. We already handle reporting subtypes by overwriting Multiplexer types + /*fn check_all_subtypes_in_submodules(&self) { + for (_, sm) in &self.submodules { + let Some(instance) = sm.instance.get() else { + continue; + }; + let sub_module = &self.linker.modules[sm.refers_to.id]; + + for (_port_id, concrete_port, source_code_port, connecting_wire) in + zip_eq3(&instance.interface_ports, &sub_module.ports, &sm.port_map) + { + let (Some(concrete_port), Some(connecting_wire)) = (concrete_port, connecting_wire) + else { + continue; + }; + + let connecting_wire = &self.wires[connecting_wire.maps_to_wire]; + + let err = if concrete_port.is_input { + self.must_be_subtype_of(&connecting_wire.typ, &concrete_port.typ, span) + } else { + self.must_be_subtype_of(&concrete_port.typ, &connecting_wire.typ, span) + }; + if let Some(err) = err { + err.info_obj_different_file(source_code_port, sub_module.link_info.file); + } + } + } + }*/ + pub fn check_subtypes(&self) { + self.check_all_subtypes_in_wires(); + } } diff --git a/src/instantiation/instantiation_cache.rs b/src/instantiation/instantiation_cache.rs index cba575e9..e14cd0f2 100644 --- a/src/instantiation/instantiation_cache.rs +++ b/src/instantiation/instantiation_cache.rs @@ -1,10 +1,8 @@ use std::cell::RefCell; use std::{collections::HashMap, rc::Rc}; -use crate::debug::SpanDebugger; use crate::errors::CompileError; -use crate::instantiation::unique_names::UniqueNames; -use crate::instantiation::{GenerationState, InstantiationContext, SubModuleOrWire}; +use crate::instantiation::perform_instantiation; use crate::typing::concrete_type::ConcreteGlobalReference; use crate::prelude::*; @@ -86,7 +84,7 @@ impl Instantiator { pub fn instantiate( &self, linker: &Linker, - object_id: Rc>, + object_id: ConcreteGlobalReference, ) -> Option> { let cache_borrow = self.cache.borrow_mut(); @@ -95,6 +93,7 @@ impl Instantiator { } else { std::mem::drop(cache_borrow); + let object_id = Rc::new(object_id); let result = perform_instantiation(linker, object_id.clone()); if crate::debug::is_enabled("dot-concrete-module") { @@ -123,86 +122,3 @@ impl Instantiator { self.cache.borrow_mut() } } - -fn perform_instantiation( - linker: &Linker, - working_on_global_ref: Rc>, -) -> InstantiatedModule { - let md = &linker.modules[working_on_global_ref.id]; - - let _panic_guard = SpanDebugger::new( - "instantiating", - &md.link_info.name, - &linker.files[md.link_info.file], - ); - - let mut context = InstantiationContext { - name: working_on_global_ref.pretty_print_concrete_instance(linker), - generation_state: GenerationState { - md, - generation_state: md - .link_info - .instructions - .map(|(_, _)| SubModuleOrWire::Unnasigned), - }, - type_substitutor: Default::default(), - condition_stack: Vec::new(), - wires: FlatAlloc::new(), - submodules: FlatAlloc::new(), - interface_ports: md.ports.map(|_| None), - errors: ErrorCollector::new_empty(md.link_info.file, &linker.files), - unique_name_producer: UniqueNames::new(), - working_on_global_ref, - md, - linker, - }; - - // Don't instantiate modules that already errored. Otherwise instantiator may crash - if md.link_info.errors.did_error { - println!( - "Not Instantiating {} due to flattening errors", - md.link_info.name - ); - context.errors.set_did_error(); - return context.extract(); - } - - println!("Instantiating {}", md.link_info.name); - - if let Err(e) = context.execute_module() { - context.errors.error(e.0, e.1); - - return context.extract(); - } - - if crate::debug::is_enabled("print-instantiated-modules-pre-concrete-typecheck") { - println!("[[Executed {}]]", &context.name); - for (id, w) in &context.wires { - println!("{id:?} -> {w:?}"); - } - for (id, sm) in &context.submodules { - println!("SubModule {id:?}: {sm:?}"); - } - } - - println!("Concrete Typechecking {}", md.link_info.name); - context.typecheck(); - - println!("Latency Counting {}", md.link_info.name); - context.compute_latencies(); - - println!("Checking array accesses {}", md.link_info.name); - context.check_array_accesses(); - - if crate::debug::is_enabled("print-instantiated-modules") { - println!("[[Instantiated {}]]", context.name); - for (id, w) in &context.wires { - println!("{id:?} -> {w:?}"); - } - for (id, sm) in &context.submodules { - println!("SubModule {id:?}: {sm:?}"); - } - } - - context.extract() -} diff --git a/src/instantiation/mod.rs b/src/instantiation/mod.rs index 25e0e170..6e413b34 100644 --- a/src/instantiation/mod.rs +++ b/src/instantiation/mod.rs @@ -6,13 +6,16 @@ mod unique_names; use unique_names::UniqueNames; +use crate::debug::SpanDebugger; +use crate::latency::CALCULATE_LATENCY_LATER; +use crate::linker::LinkInfo; use crate::prelude::*; -use crate::typing::type_inference::{TypeSubstitutor, TypeUnifier}; +use crate::typing::value_unifier::{UnifyableValue, ValueUnifierAlloc}; use std::cell::OnceCell; use std::rc::Rc; -use crate::flattening::{BinaryOperator, Module, UnaryOperator}; +use crate::flattening::{BinaryOperator, ExpressionOutput, Module, Port, UnaryOperator, WriteTo}; use crate::{errors::ErrorStore, value::Value}; use crate::typing::concrete_type::{ConcreteGlobalReference, ConcreteType}; @@ -25,6 +28,25 @@ pub enum RealWirePathElem { ArrayAccess { span: BracketSpan, idx_wire: WireID }, } +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub struct WriteReference { + /// The [crate::flattening::Instruction::Expression] that created this write + pub original_expression: FlatID, + /// Which write in a [crate::flattening::ExpressionOutput::MultiWrite] corresponds to [Self::to_path] + pub write_idx: usize, +} + +impl WriteReference { + pub fn get<'l>(&self, link_info: &'l LinkInfo) -> Option<&'l WriteTo> { + let expr = link_info.instructions[self.original_expression].unwrap_expression(); + if let ExpressionOutput::MultiWrite(writes) = &expr.output { + Some(&writes[self.write_idx]) + } else { + None + } + } +} + /// One arm of a multiplexer. Each arm has an attached condition that is also stored here. /// /// See [RealWireDataSource::Multiplexer] @@ -34,7 +56,7 @@ pub struct MultiplexerSource { pub num_regs: i64, pub from: WireID, pub condition: Box<[ConditionStackElem]>, - pub original_connection: FlatID, + pub wr_ref: WriteReference, } /// Where a [RealWire] gets its data, be it an operator, read-only value, constant, etc. @@ -49,12 +71,12 @@ pub enum RealWireDataSource { }, UnaryOp { op: UnaryOperator, - rank: usize, + rank: Vec, right: WireID, }, BinaryOp { op: BinaryOperator, - rank: usize, + rank: Vec, left: WireID, right: WireID, }, @@ -88,6 +110,11 @@ pub struct RealWire { /// The computed latencies after latency counting pub absolute_latency: i64, } +impl RealWire { + fn get_span(&self, link_info: &LinkInfo) -> Span { + link_info.instructions[self.original_instruction].get_span() + } +} /// See [SubModule] /// @@ -109,11 +136,18 @@ pub struct SubModulePort { pub struct SubModule { pub original_instruction: FlatID, pub instance: OnceCell>, - pub refers_to: Rc>, + pub refers_to: ConcreteGlobalReference, pub port_map: FlatAlloc, PortIDMarker>, pub interface_call_sites: FlatAlloc, InterfaceIDMarker>, pub name: String, } +impl SubModule { + fn get_span(&self, link_info: &LinkInfo) -> Span { + link_info.instructions[self.original_instruction] + .unwrap_submodule() + .get_most_relevant_span() + } +} /// Generated from [Module::ports] #[derive(Debug)] @@ -181,15 +215,6 @@ impl SubModuleOrWire { } } -/// Every [crate::flattening::Instruction] has an associated value (See [SubModuleOrWire]). -/// They are either what this local name is currently referencing (either a wire instance or a submodule instance). -/// Or in the case of Generative values, the current value in the generative variable. -#[derive(Debug)] -struct GenerationState<'fl> { - generation_state: FlatAlloc, - md: &'fl Module, -} - /// Runtime conditions applied to a [crate::flattening::Write] /// /// ```sus @@ -274,25 +299,89 @@ impl ForEachContainedWire for RealWireDataSource { } } -/// As with other contexts, this is the shared state we're lugging around while executing & typechecking a module. -pub struct InstantiationContext<'fl, 'l> { - pub name: String, - pub wires: FlatAlloc, - pub submodules: FlatAlloc, +struct Executed { + wires: FlatAlloc, + submodules: FlatAlloc, + type_var_alloc: ValueUnifierAlloc, + generation_state: FlatAlloc, + execution_status: Result<(), (Span, String)>, +} - pub type_substitutor: TypeUnifier>, +impl Executed { + fn make_interface( + &self, + ports: &FlatAlloc, + ) -> FlatAlloc, PortIDMarker> { + ports.map(|(_, port)| { + let port_decl_id = port.declaration_instruction; + if let SubModuleOrWire::Wire(wire_id) = &self.generation_state[port_decl_id] { + let wire = &self.wires[*wire_id]; + Some(InstantiatedPort { + wire: *wire_id, + is_input: port.is_input, + absolute_latency: CALCULATE_LATENCY_LATER, + typ: wire.typ.clone(), + domain: wire.domain, + }) + } else { + None + } + }) + } - /// Used for Execution - generation_state: GenerationState<'fl>, - unique_name_producer: UniqueNames, - condition_stack: Vec, + pub fn into_module_typing_context<'l>( + self, + linker: &'l Linker, + md: &'l Module, + global_ref: Rc>, + ) -> (ModuleTypingContext<'l>, ValueUnifierAlloc) { + let interface_ports = self.make_interface(&md.ports); + let errors = ErrorCollector::new_empty(md.link_info.file, &linker.files); + if let Err((position, reason)) = self.execution_status { + errors.error(position, reason); + } + let ctx = ModuleTypingContext { + global_ref, + wires: self.wires, + submodules: self.submodules, + generation_state: self.generation_state, + md, + link_info: &md.link_info, + linker, + errors, + interface_ports, + }; + (ctx, self.type_var_alloc) + } +} +pub struct ModuleTypingContext<'l> { + pub global_ref: Rc>, + pub wires: FlatAlloc, + pub submodules: FlatAlloc, + pub generation_state: FlatAlloc, pub interface_ports: FlatAlloc, PortIDMarker>, + pub link_info: &'l LinkInfo, + /// Yes I know it's redundant, but it's easier to both have link_info and md + pub linker: &'l Linker, + pub md: &'l Module, pub errors: ErrorCollector<'l>, +} - pub working_on_global_ref: Rc>, - pub md: &'fl Module, - pub linker: &'l Linker, +impl<'l> ModuleTypingContext<'l> { + fn into_instantiated_module(self, name: String) -> InstantiatedModule { + let mangled_name = mangle_name(&name); + InstantiatedModule { + global_ref: self.global_ref, + name, + mangled_name, + errors: self.errors.into_storage(), + interface_ports: self.interface_ports, + wires: self.wires, + submodules: self.submodules, + generation_state: self.generation_state, + } + } } /// Mangle the module name for use in code generation @@ -307,17 +396,72 @@ fn mangle_name(str: &str) -> String { result.trim_matches('_').to_owned() } -impl InstantiationContext<'_, '_> { - fn extract(self) -> InstantiatedModule { - InstantiatedModule { - global_ref: self.working_on_global_ref, - mangled_name: mangle_name(&self.name), - name: self.name, - wires: self.wires, - submodules: self.submodules, - interface_ports: self.interface_ports, - generation_state: self.generation_state.generation_state, - errors: self.errors.into_storage(), +fn perform_instantiation( + linker: &Linker, + global_ref: Rc>, +) -> InstantiatedModule { + let md = &linker.modules[global_ref.id]; + + let name = global_ref.display(linker, false).to_string(); + + let _panic_guard = SpanDebugger::new("instantiating", &name, &linker.files[md.link_info.file]); + + // Don't instantiate modules that already errored. Otherwise instantiator may crash + if md.link_info.errors.did_error { + println!("Not Instantiating {name} due to flattening errors"); + return InstantiatedModule { + global_ref, + mangled_name: mangle_name(&name), + name, + errors: ErrorStore::new_did_error(), + interface_ports: Default::default(), + wires: Default::default(), + submodules: Default::default(), + generation_state: md + .link_info + .instructions + .map(|_| SubModuleOrWire::Unnasigned), + }; + } + + println!("Instantiating {name}"); + let exec = execute::execute(&md.link_info, linker, &global_ref.template_args); + + let (mut typed, type_var_alloc) = exec.into_module_typing_context(linker, md, global_ref); + + if typed.errors.did_error() { + return typed.into_instantiated_module(name); + } + + if crate::debug::is_enabled("print-instantiated-modules-pre-concrete-typecheck") { + println!("[[Executed {name}]]"); + for (id, w) in &typed.wires { + println!("{id:?} -> {w:?}"); + } + for (id, sm) in &typed.submodules { + println!("SubModule {id:?}: {sm:?}"); + } + } + + println!("Concrete Typechecking {name}"); + typed.typecheck(type_var_alloc); + + if typed.errors.did_error() { + return typed.into_instantiated_module(name); + } + + println!("Checking array accesses {name}"); + typed.check_subtypes(); + + if crate::debug::is_enabled("print-instantiated-modules") { + println!("[[Instantiated {name}]]"); + for (id, w) in &typed.wires { + println!("{id:?} -> {w:?}"); + } + for (id, sm) in &typed.submodules { + println!("SubModule {id:?}: {sm:?}"); } } + + typed.into_instantiated_module(name) } diff --git a/src/latency/latency_algorithm.rs b/src/latency/latency_algorithm.rs index 9d204aed..91737185 100644 --- a/src/latency/latency_algorithm.rs +++ b/src/latency/latency_algorithm.rs @@ -42,23 +42,6 @@ impl SpecifiedLatency { list.iter() .find_map(|spec_lat| (spec_lat.node == node).then_some(spec_lat.latency)) } - fn get_latency(list: &[SpecifiedLatency], node: usize) -> Option { - for elem in list { - if elem.node == node { - return Some(elem.latency); - } - } - None - } - fn has_duplicates(mut list: &[SpecifiedLatency]) -> bool { - while let Some((fst, rest)) = list.split_first() { - if rest.iter().any(|e| e.node == fst.node) { - return true; - } - list = rest; - } - false - } } /// All the ways [solve_latencies] can go wrong @@ -163,7 +146,7 @@ impl SolutionMemory { &'s mut self, specified_latencies: &[SpecifiedLatency], ) -> Solution<'s> { - assert!(self.to_explore_queue.is_empty()); + self.to_explore_queue.clear(); self.solution.fill(UNSET); for spec in specified_latencies { let target_node = &mut self.solution[spec.node]; @@ -252,23 +235,13 @@ impl<'mem> Solution<'mem> { } } - fn get_minimal_node(&self) -> usize { - *self - .to_explore_queue - .iter() - .min_by_key(|n| self.solution[**n]) - .unwrap() - } - fn offset_to_pin_node_to(&mut self, spec_lat: SpecifiedLatency) { let existing_latency_of_node = self.solution[spec_lat.node]; assert!(is_valid(existing_latency_of_node)); - let offset = spec_lat.latency - existing_latency_of_node; if offset == 0 { return; // Early exit, no change needed } - for n in self.to_explore_queue.iter() { let lat = &mut self.solution[*n]; assert!(*lat != POISON); @@ -278,6 +251,44 @@ impl<'mem> Solution<'mem> { } } + fn merge_port_groups( + &mut self, + disjoint_groups: &mut Vec>, + ports: &LatencyCountingPorts, + bad_ports: &mut Vec<(usize, i64, i64)>, + ) { + disjoint_groups.retain_mut(|existing_set| { + if let Some(offset) = existing_set.iter().find_map(|v| { + is_valid(self.solution[v.node]).then(|| self.solution[v.node] - v.latency) + }) { + for v in existing_set { + let latency = v.latency + offset; + if self.solution[v.node] == UNSET { + self.solution[v.node] = latency; + } else if self.solution[v.node] != latency { + bad_ports.push((v.node, self.solution[v.node], latency)); + } else { + // The node's already in the set, and the latencies + offset are identical + } + } + false + } else { + true + } + }); + + let mut new_group = Vec::new(); + for n in &ports.port_nodes { + let latency = self.solution[*n]; + if is_valid(latency) { + new_group.push(SpecifiedLatency { node: *n, latency }); + } + } + if !new_group.is_empty() { + disjoint_groups.push(new_group); + } + } + fn copy_to(self, final_solution: &mut [i64]) { for n in self.to_explore_queue.drain(..) { assert!(final_solution[n] == UNSET); @@ -623,6 +634,7 @@ fn print_inference_test_case( println!("==== END INFERENCE TEST CASE ===="); } +/// Guarantees that if `specified_latencies` is non-empty, it'll be the first element in the result vector, fn solve_port_latencies( fanouts: &ListOfLists, ports: &LatencyCountingPorts, @@ -630,7 +642,14 @@ fn solve_port_latencies( ) -> Result>, LatencyCountingError> { let mut bad_ports: Vec<(usize, i64, i64)> = Vec::new(); - let port_groups_iter = ports.inputs().iter().map(|input_port| { + let mut port_groups = ports + .outputs() + .iter() + .copied() + .map(|node| vec![SpecifiedLatency { node, latency: 0 }]) + .collect(); + + for input_port in ports.inputs() { let start_node = SpecifiedLatency { node: *input_port, latency: 0, @@ -640,61 +659,15 @@ fn solve_port_latencies( solution_memory.make_solution_with_initial_values(&[start_node]); working_latencies.latency_count_bellman_ford(fanouts); - let result: Vec = std::iter::once(start_node) - .chain(ports.outputs().iter().filter_map(|output| { - let latency = working_latencies.solution[*output]; - is_valid(latency).then_some(SpecifiedLatency { - node: *output, - latency, - }) - })) - .collect(); - - debug_assert!(!SpecifiedLatency::has_duplicates(&result)); - - result - }); - - let mut port_groups = - merge_iter_into_disjoint_groups(port_groups_iter, |merge_to, merge_from| { - debug_assert!(!SpecifiedLatency::has_duplicates(merge_to)); - debug_assert!(!SpecifiedLatency::has_duplicates(merge_from)); - - let Some(offset) = merge_to.iter().find_map(|to| { - SpecifiedLatency::get_latency(merge_from, to.node) - .map(|from_latency| to.latency - from_latency) - }) else { - return false; - }; - - for from_node in merge_from { - from_node.latency += offset; - - if let Some(to_node_latency) = - SpecifiedLatency::get_latency(merge_to, from_node.node) - { - if to_node_latency != from_node.latency { - bad_ports.push((from_node.node, to_node_latency, from_node.latency)); - } - } else { - merge_to.push(*from_node); - } + // We have to now remove all other inputs from the solution + // (inputs that happened to be in the fanout of this input) + for input_to_remove in ports.inputs() { + if *input_to_remove != *input_port { + working_latencies.solution[*input_to_remove] = UNSET; } - - debug_assert!(!SpecifiedLatency::has_duplicates(merge_to)); - true - }); - - for output_port in ports.outputs() { - if !port_groups - .iter() - .any(|pg| SpecifiedLatency::get_latency(pg, *output_port).is_some()) - { - port_groups.push(vec![SpecifiedLatency { - node: *output_port, - latency: 0, - }]); } + + working_latencies.merge_port_groups(&mut port_groups, ports, &mut bad_ports); } if bad_ports.is_empty() { @@ -733,24 +706,25 @@ pub fn solve_latencies( debug_assert!(!has_poison_edge(&fanouts)); // Equivalent let mut mem = SolutionMemory::new(fanouts.len()); - let solution_seeds = solve_port_latencies(&fanouts, ports, &mut mem)?; + let mut solution_seeds = solve_port_latencies(&fanouts, ports, &mut mem)?; + + if !specified_latencies.is_empty() { + let mut working_latencies = mem.make_solution_with_initial_values(specified_latencies); + let mut no_bad_port_errors = Vec::new(); + working_latencies.merge_port_groups(&mut solution_seeds, ports, &mut no_bad_port_errors); + assert!(no_bad_port_errors.is_empty(), "Adding the specified latencies cannot create new bad port errors, because it only applies in the edge case that all specified ports are disjoint inputs, or outputs"); + } let mut final_solution = vec![UNSET; fanouts.len()]; let mut hit_and_not_hit: Vec<(usize, Vec)> = Vec::new(); - let mut seed_start: i64 = 0; - if !specified_latencies.is_empty() { - seed_start += SEPARATE_SEED_OFFSET; - } - fn get_reference_node(seed_start: &mut i64, solution: &mut Solution) -> SpecifiedLatency { - let latency = *seed_start; - *seed_start += SEPARATE_SEED_OFFSET; - let node = solution.get_minimal_node(); - SpecifiedLatency { node, latency } - } - - for seed in &solution_seeds { + let mut seed_start: i64 = if specified_latencies.is_empty() { + 0 + } else { + SEPARATE_SEED_OFFSET + }; + for mut seed in solution_seeds { let num_seed_nodes_already_present = seed .iter() .filter(|s| final_solution[s.node] != UNSET) @@ -760,7 +734,13 @@ pub fn solve_latencies( continue; // Skip this seed, as it's because of an earlier error, so we don't conflict on specified latencies } - let mut solution = mem.make_solution_with_initial_values(seed); + let offset = seed_start - seed[0].latency; + for s in &mut seed { + s.latency += offset; + } + seed_start += SEPARATE_SEED_OFFSET; + + let mut solution = mem.make_solution_with_initial_values(&seed); ports_per_domain.retain_mut(|cur_node_set| { let num_hit = cur_node_set.partition_point(|n| solution.solution[*n] != i64::MIN); @@ -774,14 +754,13 @@ pub fn solve_latencies( solution.explore_all_connected_nodes(&fanins, &fanouts); - let specified_node = specified_latencies - .first() - .and_then(|first_spec| { - (solution.solution[first_spec.node] != UNSET).then_some(*first_spec) - }) - .unwrap_or_else(|| get_reference_node(&mut seed_start, &mut solution)); - - solution.offset_to_pin_node_to(specified_node); + // Of course, all other specified latencies are in the exact same solution + if let Some(representative) = specified_latencies.first() { + if is_valid(solution.solution[representative.node]) { + solution.offset_to_pin_node_to(*representative); + seed_start -= SEPARATE_SEED_OFFSET; + } + } solution.copy_to(&mut final_solution); } @@ -794,12 +773,11 @@ pub fn solve_latencies( if final_solution[potential_start] == UNSET { let seed = SpecifiedLatency { node: potential_start, - latency: 0, + latency: seed_start, }; + seed_start += SEPARATE_SEED_OFFSET; let mut solution = mem.make_solution_with_initial_values(&[seed]); solution.explore_all_connected_nodes(&fanins, &fanouts); - let spec = get_reference_node(&mut seed_start, &mut solution); - solution.offset_to_pin_node_to(spec); solution.copy_to(&mut final_solution); } } @@ -807,21 +785,6 @@ pub fn solve_latencies( Ok(final_solution) } -/// [try_merge] should return true if the second argument was merged into the first argument. -fn merge_iter_into_disjoint_groups( - iter: impl Iterator, - mut try_merge: impl FnMut(&mut T, &mut T) -> bool, -) -> Vec { - let mut result = Vec::new(); - - for mut new_node in iter { - result.retain_mut(|existing_elem| !try_merge(&mut new_node, existing_elem)); - result.push(new_node); - } - - result -} - /// A candidate for latency inference. Passed to [try_infer_value_for] as a list of possibilities. /// /// When performing said inference, we return the smallest valid candidate. All candidates _must_ try to provide a value. @@ -1091,7 +1054,7 @@ mod tests { normalize_specified_latency_lists(left); normalize_specified_latency_lists(right); - assert!(left == right); + assert_eq!(left, right); } #[test] diff --git a/src/latency/mod.rs b/src/latency/mod.rs index 75a2fd21..d29e352a 100644 --- a/src/latency/mod.rs +++ b/src/latency/mod.rs @@ -5,15 +5,15 @@ pub mod port_latency_inference; use std::{cmp::max, iter::zip}; -use crate::alloc::zip_eq; use crate::dev_aid::dot_graphs::display_latency_count_graph; use crate::errors::ErrorInfoObject; use crate::prelude::*; +use crate::typing::value_unifier::ValueUnifierStore; +use crate::{alloc::zip_eq, typing::value_unifier::ValueUnifier}; -use crate::typing::concrete_type::ConcreteType; -use crate::typing::type_inference::{DelayedConstraintStatus, Substitutor}; use crate::value::Value; +use ibig::IBig; use latency_algorithm::{ add_cycle_to_extra_fanin, infer_unknown_latency_edges, is_valid, solve_latencies, FanInOut, LatencyCountingError, LatencyCountingPorts, LatencyInferenceCandidate, SpecifiedLatency, @@ -95,7 +95,7 @@ pub struct LatencyCountingProblem { } impl LatencyCountingProblem { - fn new(ctx: &InstantiationContext) -> Self { + fn new(ctx: &ModuleTypingContext, unifier: &ValueUnifierStore) -> Self { let mut map_latency_node_to_wire = Vec::new(); let mut specified_latencies = Vec::new(); @@ -147,7 +147,7 @@ impl LatencyCountingProblem { let local_inference_edges = sm.get_interface_relative_latencies( ctx.linker, sm_id, - &ctx.type_substitutor, + unifier, &mut inference_variables, ); @@ -173,7 +173,7 @@ impl LatencyCountingProblem { } } - fn make_ports_per_domain(&self, ctx: &InstantiationContext) -> Vec> { + fn make_ports_per_domain(&self, ctx: &ModuleTypingContext) -> Vec> { let mut ports_per_domain_flat = ctx.md.domains.map(|_| Vec::new()); for (_id, port) in ctx.interface_ports.iter_valids() { ports_per_domain_flat[port.domain].push(self.map_wire_to_latency_node[port.wire]); @@ -196,7 +196,7 @@ impl LatencyCountingProblem { fn debug( &self, - ctx: &InstantiationContext, + ctx: &ModuleTypingContext, solution: Option<&[i64]>, debug_flag: &'static str, file_name: &str, @@ -266,10 +266,10 @@ impl InstantiatedModule { } } -impl InstantiationContext<'_, '_> { +impl ModuleTypingContext<'_> { // Returns a proper interface if all ports involved did not produce an error. If a port did produce an error then returns None. // Computes all latencies involved - pub fn compute_latencies(&mut self) { + pub fn compute_latencies(&mut self, unifier: &ValueUnifierStore) { let mut any_invalid_port = false; for (port_id, p) in self.interface_ports.iter_valids() { if !p.is_input { @@ -292,7 +292,7 @@ impl InstantiationContext<'_, '_> { return; // Early exit so we don't flood WIP modules with "Node not reached by Latency Counting" errors } - let mut problem = LatencyCountingProblem::new(self); + let mut problem = LatencyCountingProblem::new(self, unifier); // Remove all poisoned edges as solve_latencies doesn't deal with them problem.remove_poison_edges(); @@ -323,8 +323,10 @@ impl InstantiationContext<'_, '_> { if is_valid(*lat) { wire.absolute_latency = *lat; } else { - let source_location = - self.md.get_instruction_span(wire.original_instruction); + let source_location = self + .md + .link_info + .get_instruction_span(wire.original_instruction); self.errors.error( source_location, "Latency Counting couldn't reach this node".to_string(), @@ -344,8 +346,8 @@ impl InstantiationContext<'_, '_> { } } - pub fn infer_parameters_for_latencies(&mut self) -> DelayedConstraintStatus { - let mut problem = LatencyCountingProblem::new(self); + pub fn infer_parameters_for_latencies<'inst>(&'inst self, unifier: &mut ValueUnifier<'inst>) { + let mut problem = LatencyCountingProblem::new(self, &unifier.store); let fanins = problem.make_fanins(); problem.debug( @@ -364,28 +366,18 @@ impl InstantiationContext<'_, '_> { &mut problem.inference_variables, ); - let mut any_new_values = false; - let mut all_new_values = true; for (_, var) in problem.inference_variables.into_iter() { if let Some(inferred_value) = var.get() { let (submod_id, arg_id) = var.back_reference; - self.type_substitutor.unify_must_succeed( - &self.submodules[submod_id].refers_to.template_args[arg_id], - &ConcreteType::Value(Value::Integer(inferred_value.into())), - ); - - any_new_values = true; - } else { - all_new_values = false; + assert!(unifier + .set( + self.submodules[submod_id].refers_to.template_args[arg_id].unwrap_value(), + Value::Integer(IBig::from(inferred_value)), + ) + .is_ok()); } } - - match (any_new_values, all_new_values) { - (_, true) => DelayedConstraintStatus::Resolved, - (true, false) => DelayedConstraintStatus::Progress, - (false, false) => DelayedConstraintStatus::NoProgress, - } } fn gather_all_mux_inputs( diff --git a/src/latency/port_latency_inference.rs b/src/latency/port_latency_inference.rs index 86f89050..4d481fed 100644 --- a/src/latency/port_latency_inference.rs +++ b/src/latency/port_latency_inference.rs @@ -5,9 +5,8 @@ use crate::{ prelude::*, typing::{ abstract_type::PeanoType, - concrete_type::ConcreteType, - template::TVec, - type_inference::{Substitutor, TypeSubstitutor, TypeUnifier}, + template::{TVec, TemplateKind}, + value_unifier::ValueUnifierStore, }, value::Value, }; @@ -108,7 +107,7 @@ fn recurse_down_expression( num_template_args: usize, ) -> Option { let expr = instructions[cur_instr].unwrap_subexpression(); - if !expr.typ.domain.is_generative() { + if !expr.domain.is_generative() { return None; // Early exit, the user can create an invalid interface, we just don't handle it } match &expr.source { @@ -185,7 +184,9 @@ fn recurse_down_expression( arg_linear_factor: TVec::with_size(num_template_args, 0), }), ExpressionSource::WireRef(WireReference { - root: WireReferenceRoot::LocalDecl(decl_id, _span), + root: WireReferenceRoot::LocalDecl(decl_id), + root_typ: _, + root_span: _, path, }) => { if !path.is_empty() { @@ -367,7 +368,7 @@ impl SubModule { &self, linker: &Linker, sm_id: SubModuleID, - type_substitutor: &TypeUnifier>, + unifier: &ValueUnifierStore, latency_inference_variables: &mut FlatAlloc< ValueToInfer<(SubModuleID, TemplateID)>, InferenceVarIDMarker, @@ -401,10 +402,12 @@ impl SubModule { InferenceEdgesForDomain { edges } } else { - let known_template_args = self.refers_to.template_args.map(|(_, t)| { - let mut t_copy = t.clone(); - type_substitutor.fully_substitute(&mut t_copy); - if let ConcreteType::Value(Value::Integer(num)) = &t_copy { + let known_template_args = self.refers_to.template_args.map(|(_, arg)| { + let TemplateKind::Value(v) = arg else { + return None; + }; + + if let Some(Value::Integer(num)) = unifier.get_substitution(v) { i64::try_from(num).ok() } else { None @@ -667,7 +670,7 @@ mod tests { .unwrap(); assert_eq!( - values_to_infer.map_to_array(|_, v| v.get()), + values_to_infer.cast_to_array().map(|v| v.get()), [Some(6), Some(1), Some(9)] // C 3 smaller due to offset on port 4 ); } diff --git a/src/linker/mod.rs b/src/linker/mod.rs index d9e5e66e..c94ca573 100644 --- a/src/linker/mod.rs +++ b/src/linker/mod.rs @@ -4,7 +4,7 @@ use crate::{ prelude::*, typing::{ abstract_type::DomainType, - template::{GenerativeParameterKind, Parameter, ParameterKind, TVec, TypeParameterKind}, + template::{GenerativeParameterKind, Parameter, TVec, TemplateKind, TypeParameterKind}, type_inference::{AbstractTypeSubstitutor, TypeSubstitutor}, }, }; @@ -120,7 +120,9 @@ pub struct LinkInfo { impl LinkInfo { pub fn get_full_name(&self) -> String { - format!("::{}", self.name) + // Feelin iffy about namespaces, so just return self.name + self.name.clone() + // format!("::{}", self.name) } pub fn get_span_file(&self) -> SpanFile { (self.name_span, self.file) @@ -129,8 +131,8 @@ impl LinkInfo { let mut template_args: Vec<&str> = Vec::new(); for (_id, t) in &self.template_parameters { match &t.kind { - ParameterKind::Type(TypeParameterKind {}) => template_args.push(&t.name), - ParameterKind::Generative(GenerativeParameterKind { + TemplateKind::Type(TypeParameterKind {}) => template_args.push(&t.name), + TemplateKind::Value(GenerativeParameterKind { decl_span, declaration_instruction: _, }) => template_args.push(&file_text[*decl_span]), diff --git a/src/main.rs b/src/main.rs index 0c793d67..7e9ae6be 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,7 @@ #![doc = include_str!("../README.md")] mod alloc; +mod append_only_vec; mod block_vector; mod config; diff --git a/src/prelude.rs b/src/prelude.rs index 1ea83211..e2d169a6 100644 --- a/src/prelude.rs +++ b/src/prelude.rs @@ -8,6 +8,13 @@ pub use crate::errors::ErrorCollector; pub use crate::file_position::{BracketSpan, Span, SpanFile}; pub use crate::linker::Linker; +#[allow(unused_imports)] +pub use crate::__debug_span; +#[allow(unused_imports)] +pub use crate::let_unwrap; +#[allow(unused_imports)] +pub use sus_proc_macro::__debug_breakpoint; + // private imports, for the IDs use crate::alloc::{UUIDMarker, UUIDRange, UUID}; diff --git a/src/to_string.rs b/src/to_string.rs index ee9c1d22..7b3b5147 100644 --- a/src/to_string.rs +++ b/src/to_string.rs @@ -1,12 +1,15 @@ +use crate::alloc::{zip_eq, ArenaAllocator}; use crate::prelude::*; use crate::typing::abstract_type::{AbstractInnerType, PeanoType}; -use crate::typing::template::{Parameter, TVec}; +use crate::typing::concrete_type::{ConcreteGlobalReference, ConcreteTemplateArg}; +use crate::typing::set_unifier::Unifyable; +use crate::typing::template::{Parameter, TVec, TemplateKind}; use crate::typing::written_type::WrittenType; use crate::{file_position::FileText, pretty_print_many_spans, value::Value}; use crate::flattening::{DomainInfo, Interface, InterfaceToDomainMap, Module, StructType}; -use crate::linker::FileData; +use crate::linker::{FileData, GlobalUUID, LinkInfo}; use crate::typing::{ abstract_type::{AbstractRankedType, DomainType}, concrete_type::ConcreteType, @@ -40,7 +43,6 @@ impl TemplateNameGetter for TVec { } } -#[derive(Debug)] pub struct WrittenTypeDisplay< 'a, TypVec: Index, @@ -56,7 +58,7 @@ impl, TemplateVec: TemplateNameGett { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { match self.inner { - WrittenType::Error(_) => f.write_str("{error"), + WrittenType::Error(_) => f.write_str("{error}"), WrittenType::TemplateVariable(_, id) => { f.write_str(self.template_names.get_template_name(*id)) } @@ -90,7 +92,6 @@ impl WrittenType { } } -#[derive(Debug)] pub struct AbstractRankedTypeDisplay<'a, TypVec, TemplateVec: TemplateNameGetter> { typ: &'a AbstractRankedType, linker_types: &'a TypVec, @@ -147,29 +148,30 @@ impl Display for PeanoType { } } -#[derive(Debug)] pub struct ConcreteTypeDisplay<'a, T: Index> { inner: &'a ConcreteType, linker_types: &'a T, + use_newlines: bool, } impl> Display for ConcreteTypeDisplay<'_, T> { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { match self.inner { - ConcreteType::Named(name) => { - f.write_str(&self.linker_types[name.id].link_info.get_full_name()) + ConcreteType::Named(global_ref) => ConcreteGlobalReferenceDisplay { + target_link_info: &self.linker_types[global_ref.id].link_info, + template_args: &global_ref.template_args, + linker_types: self.linker_types, + use_newlines: self.use_newlines, } + .fmt(f), ConcreteType::Array(arr_box) => { let (elem_typ, arr_size) = arr_box.deref(); write!( f, - "{}[{}]", - elem_typ.display(self.linker_types), - arr_size.display(self.linker_types) + "{}[{arr_size}]", + elem_typ.display(self.linker_types, self.use_newlines) ) } - ConcreteType::Value(v) => write!(f, "{v}"), - ConcreteType::Unknown(u) => write!(f, "{{{u:?}}}"), } } } @@ -178,10 +180,12 @@ impl ConcreteType { pub fn display<'a>( &'a self, linker_types: &'a impl Index, + use_newlines: bool, ) -> impl Display + 'a { ConcreteTypeDisplay { inner: self, linker_types, + use_newlines, } } } @@ -258,22 +262,21 @@ impl Module { pub fn make_all_ports_info_string( &self, file_text: &FileText, - local_domains: Option, + local_domains_used_in_parent_module: Option, ) -> String { let full_name_with_args = self.link_info.get_full_name_and_template_args(file_text); let mut result = format!("module {full_name_with_args}:\n"); for (domain_id, domain) in &self.domains { - if let Some(domain_map) = &local_domains { - writeln!( - result, - "domain {}: {{{}}}", - &domain.name, - domain_map.local_domain_to_global_domain(domain_id).name - ) - .unwrap(); + let name = &domain.name; + if let Some(domain_map) = &local_domains_used_in_parent_module { + let submod_name = &self.link_info.name; + let domain_id_in_parent = domain_map.local_domain_map[domain_id].unwrap_physical(); + let name_in_parent = + DomainType::physical_to_string(domain_id_in_parent, domain_map.domains); + writeln!(result, "domain {submod_name}.{name} = {name_in_parent}").unwrap(); } else { - writeln!(result, "domain {}:", &domain.name).unwrap(); + writeln!(result, "domain {name}:").unwrap(); } // TODO interfaces @@ -301,9 +304,77 @@ impl Module { let mut spans_print = Vec::new(); for (id, inst) in &self.link_info.instructions { println!(" {id:?}: {inst:?}"); - let span = self.get_instruction_span(id); + let span = self.link_info.get_instruction_span(id); spans_print.push((format!("{id:?}"), span.as_range())); } pretty_print_many_spans(file_data, &spans_print); } } + +pub struct ConcreteGlobalReferenceDisplay<'a, T: Index> { + template_args: &'a TVec, + target_link_info: &'a LinkInfo, + linker_types: &'a T, + /// If there should be newlines: "\n", otherwise "" + use_newlines: bool, +} + +impl<'a, T: Index> Display + for ConcreteGlobalReferenceDisplay<'a, T> +{ + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + let nl = if self.use_newlines { "\n " } else { "" }; + assert!(self.template_args.len() == self.target_link_info.template_parameters.len()); + let object_full_name = self.target_link_info.get_full_name(); + f.write_str(&object_full_name)?; + if self.template_args.is_empty() { + //return f.write_str(" #()"); + return Ok(()); + } else { + f.write_str(" #(")?; + } + + let mut is_first = true; + for (_id, arg, arg_in_target) in zip_eq( + self.template_args, + &self.target_link_info.template_parameters, + ) { + if !is_first { + f.write_str(", ")?; + } + is_first = false; + f.write_fmt(format_args!("{nl}{}: ", arg_in_target.name))?; + match arg { + TemplateKind::Type(typ_arg) => { + f.write_fmt(format_args!( + "type {}", + typ_arg.display(self.linker_types, self.use_newlines) + ))?; + } + TemplateKind::Value(v) => match v { + Unifyable::Set(value) => f.write_fmt(format_args!("{value}"))?, + Unifyable::Unknown(_) => f.write_str("/* Could not infer */")?, + }, + } + } + if self.use_newlines { + f.write_str("\n")?; + } + f.write_char(')') + } +} +impl + Copy> ConcreteGlobalReference { + pub fn display<'v>( + &'v self, + linker: &'v Linker, + use_newlines: bool, + ) -> ConcreteGlobalReferenceDisplay<'v, ArenaAllocator> { + let target_link_info = linker.get_link_info(self.id.into()); + ConcreteGlobalReferenceDisplay { + template_args: &self.template_args, + target_link_info, + linker_types: &linker.types, + use_newlines, + } + } +} diff --git a/src/typing/abstract_type.rs b/src/typing/abstract_type.rs index 568facaa..ed6ab434 100644 --- a/src/typing/abstract_type.rs +++ b/src/typing/abstract_type.rs @@ -1,18 +1,13 @@ use sus_proc_macro::get_builtin_type; -use crate::alloc::ArenaAllocator; use crate::prelude::*; -use crate::value::Value; -use std::ops::Deref; -use super::template::{GlobalReference, Parameter, TVec}; +use super::template::{Parameter, TVec}; use super::type_inference::{ AbstractTypeSubstitutor, DomainVariableID, InnerTypeVariableID, PeanoVariableID, Substitutor, TypeSubstitutor, TypeUnifier, UnifyErrorReport, }; -use crate::flattening::{ - BinaryOperator, StructType, UnaryOperator, WireReference, WireReferenceRoot, -}; +use crate::flattening::{BinaryOperator, UnaryOperator}; use crate::to_string::map_to_type_names; /// This contains only the information that can be type-checked before template instantiation. @@ -30,7 +25,7 @@ use crate::to_string::map_to_type_names; /// /// [AbstractType]s don't actually get converted to [crate::typing::concrete_type::ConcreteType]s. /// Instead [crate::typing::concrete_type::ConcreteType] gets created from [WrittenType] directly. -#[derive(Debug, Clone)] +#[derive(Debug, Clone, PartialEq, Eq)] pub enum AbstractInnerType { Template(TemplateID), Named(TypeUUID), @@ -53,7 +48,7 @@ impl AbstractInnerType { } } -#[derive(Debug, Clone)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct AbstractRankedType { pub inner: AbstractInnerType, pub rank: PeanoType, @@ -74,7 +69,7 @@ impl AbstractRankedType { } } -#[derive(Debug, Clone)] +#[derive(Debug, Clone, PartialEq, Eq)] pub enum PeanoType { Zero, Succ(Box), @@ -89,12 +84,6 @@ impl PeanoType { PeanoType::Unknown(_) => None, } } - pub fn count_unwrap(&self) -> usize { - let Some(cnt) = self.count() else { - panic!("Peano Number {self:?} still contains Unknown!"); - }; - cnt - } } pub const BOOL_TYPE: AbstractInnerType = AbstractInnerType::Named(get_builtin_type!("bool")); @@ -182,63 +171,16 @@ impl FullTypeUnifier { } } - /// TODO make WrittenValue compared to Value to encode Spans - pub fn unify_with_constant( - &mut self, - typ: &AbstractRankedType, - value: &Value, - value_span: Span, - ) { - match value { - Value::Bool(_) => { - self.abstract_type_substitutor.unify_report_error( - typ, - &BOOL_TYPE.scalar(), - value_span, - "bool constant", - ); - } - Value::Integer(_big_int) => { - self.abstract_type_substitutor.unify_report_error( - typ, - &INT_TYPE.scalar(), - value_span, - "int constant", - ); - } - Value::Array(arr) => { - let arr_content_variable = self.abstract_type_substitutor.alloc_unknown(); - - for v in arr.deref() { - self.unify_with_constant(&arr_content_variable, v, value_span); - } + pub fn unify_must_succeed(&mut self, ta: &FullType, tb: &FullType) { + self.abstract_type_substitutor + .unify_must_succeed(&ta.typ, &tb.typ); - self.abstract_type_substitutor.unify_report_error( - typ, - &arr_content_variable, - value_span, - "array literal", - ); - } - Value::Unset => {} // Already an error, don't unify + if !ta.domain.is_generative() && !tb.domain.is_generative() { + self.domain_substitutor + .unify_must_succeed(&ta.domain, &tb.domain); } } - // Unifies arr_type with output_typ[] - pub fn unify_with_array_of( - &mut self, - arr_type: &AbstractRankedType, - output_typ: AbstractRankedType, - arr_span: Span, - ) { - self.abstract_type_substitutor.unify_report_error( - arr_type, - &output_typ.rank_up(), - arr_span, - "array access", - ); - } - pub fn typecheck_unary_operator_abstr( &mut self, op: UnaryOperator, @@ -289,7 +231,16 @@ impl FullTypeUnifier { span, "array reduction", ); - self.unify_with_array_of(input_typ, output_typ.clone(), span); + { + let this = &mut *self; + let output_typ = output_typ.clone(); + this.abstract_type_substitutor.unify_report_error( + input_typ, + &output_typ.rank_up(), + span, + "array access", + ); + }; } } @@ -361,7 +312,7 @@ impl FullTypeUnifier { } } - pub fn typecheck_write_to_abstract( + pub fn unify_write_to_abstract( &mut self, found: &AbstractRankedType, expected: &AbstractRankedType, @@ -372,72 +323,15 @@ impl FullTypeUnifier { .unify_report_error(found, expected, span, context); } - pub fn typecheck_write_to( + pub fn unify_write_to( &mut self, - found: &FullType, + found_typ: &AbstractRankedType, + found_domain: &DomainType, expected: &FullType, span: Span, context: Context, ) { - self.typecheck_write_to_abstract(&found.typ, &expected.typ, span, context.clone()); - self.unify_domains(&found.domain, &expected.domain, span, context); - } - - pub fn finalize_domain_type(&self, typ_domain: &mut DomainType) { - assert!(self.domain_substitutor.fully_substitute(typ_domain)); - } - - pub fn finalize_abstract_type( - &self, - linker_types: &ArenaAllocator, - typ: &mut AbstractRankedType, - span: Span, - errors: &ErrorCollector, - ) { - if !self.abstract_type_substitutor.fully_substitute(typ) { - let typ_as_string = typ.display(linker_types, &self.template_type_names); - errors.error( - span, - format!("Could not fully figure out the type of this object. {typ_as_string}"), - ); - - if crate::debug::is_enabled("TEST") { - println!("COULD_NOT_FULLY_FIGURE_OUT") - } - } - } - - pub fn finalize_type( - &mut self, - linker_types: &ArenaAllocator, - typ: &mut FullType, - span: Span, - errors: &ErrorCollector, - ) { - self.finalize_domain_type(&mut typ.domain); - self.finalize_abstract_type(linker_types, &mut typ.typ, span, errors); - } - - pub fn finalize_global_ref( - &mut self, - linker_types: &ArenaAllocator, - global_ref: &mut GlobalReference, - errors: &ErrorCollector, - ) { - let global_ref_span = global_ref.get_total_span(); - for (_template_id, template_type) in &mut global_ref.template_arg_types { - self.finalize_abstract_type(linker_types, template_type, global_ref_span, errors); - } - } - - pub fn finalize_wire_ref( - &mut self, - linker_types: &ArenaAllocator, - wire_ref: &mut WireReference, - errors: &ErrorCollector, - ) { - if let WireReferenceRoot::NamedConstant(cst) = &mut wire_ref.root { - self.finalize_global_ref(linker_types, cst, errors); - } + self.unify_write_to_abstract(found_typ, &expected.typ, span, context.clone()); + self.unify_domains(found_domain, &expected.domain, span, context); } } diff --git a/src/typing/concrete_type.rs b/src/typing/concrete_type.rs index 4905289f..74c14e7a 100644 --- a/src/typing/concrete_type.rs +++ b/src/typing/concrete_type.rs @@ -1,31 +1,36 @@ +use ibig::ibig; +use ibig::ops::Abs; use ibig::IBig; +use ibig::UBig; use sus_proc_macro::get_builtin_type; -use crate::alloc::zip_eq; -use crate::linker::GlobalUUID; +use crate::instantiation::RealWirePathElem; use crate::prelude::*; +use crate::util::all_equal; use std::ops::Deref; use crate::value::Value; use super::template::TVec; -use super::type_inference::ConcreteTypeVariableID; +use super::template::TemplateKind; +use super::value_unifier::UnifyableValue; -pub const BOOL_CONCRETE_TYPE: ConcreteType = ConcreteType::Named(ConcreteGlobalReference { - id: get_builtin_type!("bool"), - template_args: FlatAlloc::new(), -}); - -pub const INT_CONCRETE_TYPE: ConcreteType = ConcreteType::Named(ConcreteGlobalReference { - id: get_builtin_type!("int"), - template_args: FlatAlloc::new(), -}); +pub type ConcreteTemplateArg = TemplateKind; #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct ConcreteGlobalReference { pub id: ID, - pub template_args: TVec, + pub template_args: TVec, +} + +impl ConcreteTemplateArg { + pub fn contains_unknown(&self) -> bool { + match self { + TemplateKind::Type(t) => t.contains_unknown(), + TemplateKind::Value(v) => v.is_unknown(), + } + } } impl ConcreteGlobalReference { @@ -35,37 +40,6 @@ impl ConcreteGlobalReference { pub fn is_final(&self) -> bool { !self.template_args.iter().any(|(_, v)| v.contains_unknown()) } - pub fn pretty_print_concrete_instance(&self, linker: &Linker) -> String - where - ID: Into + Copy, - { - let target_link_info = linker.get_link_info(self.id.into()); - assert!(self.template_args.len() == target_link_info.template_parameters.len()); - let object_full_name = target_link_info.get_full_name(); - if self.template_args.is_empty() { - return format!("{object_full_name} #()"); - } - use std::fmt::Write; - let mut result = format!("{object_full_name} #(\n"); - for (_id, arg, arg_in_target) in - zip_eq(&self.template_args, &target_link_info.template_parameters) - { - write!(result, " {}: ", arg_in_target.name).unwrap(); - match arg { - ConcreteType::Named(_) | ConcreteType::Array(_) => { - writeln!(result, "type {},", arg.display(&linker.types)).unwrap(); - } - ConcreteType::Value(value) => { - writeln!(result, "{value},").unwrap(); - } - ConcreteType::Unknown(_) => { - writeln!(result, "/* Could not infer */").unwrap(); - } - } - } - result.push(')'); - result - } } /// A post-instantiation type. These fully define what wires should be generated for a given object. @@ -78,36 +52,97 @@ impl ConcreteGlobalReference { #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum ConcreteType { Named(ConcreteGlobalReference), - Value(Value), - Array(Box<(ConcreteType, ConcreteType)>), - /// Referencing [ConcreteType::Unknown] is a strong code smell. - /// It is likely you should use [crate::typing::type_inference::TypeSubstitutor::unify_must_succeed] - /// or [crate::typing::type_inference::TypeSubstitutor::unify_report_error] instead - /// - /// It should only occur in creation `ConcreteType::Unknown(self.type_substitutor.alloc())` - Unknown(ConcreteTypeVariableID), + Array(Box<(ConcreteType, UnifyableValue)>), } impl ConcreteType { + pub fn stack_arrays_usize(self, tensor_sizes: &[usize]) -> Self { + let mut result = self; + for s in tensor_sizes.iter().rev() { + result = ConcreteType::Array(Box::new((result, Value::Integer(IBig::from(*s)).into()))); + } + result + } + pub fn stack_arrays(self, tensor_sizes: &[UnifyableValue]) -> Self { + let mut result = self; + for s in tensor_sizes.iter().rev() { + result = ConcreteType::Array(Box::new((result, s.clone()))); + } + result + } #[track_caller] - pub fn unwrap_value(&self) -> &Value { - let ConcreteType::Value(v) = self else { - unreachable!("unwrap_value on {self:?}") + pub fn unwrap_named(&self) -> &ConcreteGlobalReference { + let ConcreteType::Named(v) = self else { + unreachable!("unwrap_named") }; v } + #[track_caller] + pub fn unwrap_array(&self) -> &(ConcreteType, UnifyableValue) { + let ConcreteType::Array(arr_box) = self else { + unreachable!("unwrap_array") + }; + arr_box + } + #[track_caller] + pub fn unwrap_integer_bounds(&self) -> (&IBig, &IBig) { + let ConcreteType::Named(v) = self else { + unreachable!("unwrap_integer_bounds") + }; + assert_eq!(v.id, get_builtin_type!("int")); + let [min, max] = v.template_args.cast_to_int_array(); + (min, max) + } + pub fn down_array(&self) -> &ConcreteType { + let ConcreteType::Array(arr_box) = self else { + unreachable!("Must be an array!") + }; + let (sub, _sz) = arr_box.deref(); + sub + } pub fn contains_unknown(&self) -> bool { match self { ConcreteType::Named(global_ref) => global_ref .template_args .iter() .any(|concrete_template_arg| concrete_template_arg.1.contains_unknown()), - ConcreteType::Value(_) => false, ConcreteType::Array(arr_box) => { let (arr_arr, arr_size) = arr_box.deref(); - arr_arr.contains_unknown() || arr_size.contains_unknown() + arr_arr.contains_unknown() || arr_size.is_unknown() } - ConcreteType::Unknown(_) => true, + } + } + /// Requires all parameters to be known and already substituted! + /// + /// a return value of true means that `self` can be assigned to `other` + pub fn is_subtype_of(&self, other: &Self) -> bool { + match (self, other) { + (ConcreteType::Named(a), ConcreteType::Named(b)) => { + assert_eq!(a.id, b.id); + match all_equal([a.id, b.id]) { + get_builtin_type!("int") => { + let [a_min, a_max] = a.template_args.cast_to_int_array(); + let [b_min, b_max] = b.template_args.cast_to_int_array(); + + (a_min >= b_min) && (a_max <= b_max) + } + _ => { + crate::alloc::zip_eq(&a.template_args, &b.template_args).all(|(_, a, b)| { + match a.and_by_ref(b) { + TemplateKind::Type((a, b)) => a.is_subtype_of(b), + TemplateKind::Value((a, b)) => a.unwrap_set() == b.unwrap_set(), + } + }) + } + } + } + (ConcreteType::Array(arr_a), ConcreteType::Array(arr_b)) => { + let (a, sz_a) = arr_a.deref(); + let (b, sz_b) = arr_b.deref(); + + a.is_subtype_of(b) && (sz_a.unwrap_integer() == sz_b.unwrap_integer()) + } + _ => unreachable!(), } } /// Returns the size of this type in *wires*. So int #(MAX: 255) would return '8' @@ -116,31 +151,113 @@ impl ConcreteType { pub fn sizeof(&self) -> Option { match self { ConcreteType::Named(reference) => Some(Self::sizeof_named(reference).into()), - ConcreteType::Value(_value) => unreachable!("Root of ConcreteType cannot be a value"), ConcreteType::Array(arr_box) => { let (typ, size) = arr_box.deref(); let mut typ_sz = typ.sizeof()?; - let ConcreteType::Value(arr_sz) = size else { - return None; - }; - - typ_sz *= arr_sz.unwrap_integer(); + typ_sz *= size.unwrap_integer(); Some(typ_sz) } - ConcreteType::Unknown(_uuid) => None, } } - /// TODO #50 Ranged Int work should be integrated pub fn sizeof_named(type_ref: &ConcreteGlobalReference) -> u64 { match type_ref.id { - get_builtin_type!("int") => 32, // TODO concrete int sizes + get_builtin_type!("int") => { + let [min, max] = type_ref.template_args.cast_to_int_array(); + bound_to_bits(min, &(max - 1)) + } get_builtin_type!("bool") => 1, get_builtin_type!("float") => 32, _other => todo!("Other Named Structs are not implemented yet"), } } + + pub fn walk_rank(&self, rank: usize) -> &ConcreteType { + let mut typ = self; + for _ in 0..rank { + typ = &typ.unwrap_array().0; + } + typ + } + pub fn walk_path(&self, path: &[RealWirePathElem]) -> &ConcreteType { + let mut cur_typ = self; + for p in path { + match p { + RealWirePathElem::ArrayAccess { .. } => { + cur_typ = &cur_typ.unwrap_array().0; + } + } + } + + cur_typ + } +} + +fn bits_negative(value: &IBig) -> u64 { + (UBig::try_from(value.abs() - 1).unwrap().bit_len() + 1) + .try_into() + .unwrap() +} + +fn bits_positive(value: &IBig) -> u64 { + (UBig::try_from(value).unwrap().bit_len() + 1) + .try_into() + .unwrap() +} + +fn bound_to_bits(min: &IBig, max: &IBig) -> u64 { + [min, max] + .iter() + .map(|&num| { + if num >= &ibig!(0) { + bits_positive(num) + } else { + bits_negative(num) + } + }) + .max() + .unwrap() +} + +#[cfg(test)] +mod tests { + use super::*; + #[test] + fn test_bits_negative() { + assert_eq!(bits_negative(&ibig!(-1)), 1); + assert_eq!(bits_negative(&ibig!(-2)), 2); + assert_eq!(bits_negative(&ibig!(-3)), 3); + assert_eq!(bits_negative(&ibig!(-4)), 3); + assert_eq!(bits_negative(&ibig!(-5)), 4); + assert_eq!(bits_negative(&ibig!(-8)), 4); + assert_eq!(bits_negative(&ibig!(-9)), 5); + assert_eq!(bits_negative(&ibig!(-16)), 5); + } + #[test] + fn test_bits_positive() { + assert_eq!(bits_positive(&ibig!(0)), 1); + assert_eq!(bits_positive(&ibig!(1)), 2); + assert_eq!(bits_positive(&ibig!(2)), 3); + assert_eq!(bits_positive(&ibig!(3)), 3); + assert_eq!(bits_positive(&ibig!(4)), 4); + assert_eq!(bits_positive(&ibig!(7)), 4); + assert_eq!(bits_positive(&ibig!(8)), 5); + assert_eq!(bits_positive(&ibig!(15)), 5); + assert_eq!(bits_positive(&ibig!(16)), 6); + assert_eq!(bits_positive(&ibig!(31)), 6); + } + #[test] + fn test_bound_to_bits() { + assert_eq!(bound_to_bits(&ibig!(-1), &ibig!(0)), 1); + assert_eq!(bound_to_bits(&ibig!(-2), &ibig!(0)), 2); + assert_eq!(bound_to_bits(&ibig!(-1), &ibig!(1)), 2); + assert_eq!(bound_to_bits(&ibig!(-2), &ibig!(2)), 3); + assert_eq!(bound_to_bits(&ibig!(2), &ibig!(8)), 5); + assert_eq!(bound_to_bits(&ibig!(-1000), &ibig!(0)), 11); + assert_eq!(bound_to_bits(&ibig!(-2000), &ibig!(-1000)), 12); + assert_eq!(bound_to_bits(&ibig!(-256), &ibig!(255)), 9); + } } diff --git a/src/typing/mod.rs b/src/typing/mod.rs index 70f2f3eb..357ff58c 100644 --- a/src/typing/mod.rs +++ b/src/typing/mod.rs @@ -1,5 +1,7 @@ pub mod abstract_type; pub mod concrete_type; +pub mod set_unifier; pub mod template; pub mod type_inference; +pub mod value_unifier; pub mod written_type; diff --git a/src/typing/set_unifier.rs b/src/typing/set_unifier.rs new file mode 100644 index 00000000..44384234 --- /dev/null +++ b/src/typing/set_unifier.rs @@ -0,0 +1,446 @@ +#![allow(clippy::type_complexity)] + +use std::fmt::{Debug, Display, Formatter}; +use std::marker::PhantomData; +use std::ops::Deref; + +use crate::alloc::{ArenaAllocator, UUIDAllocator, UUIDMarker, UUID}; +use crate::append_only_vec::AppendOnlyVec; +use crate::prelude::*; + +use crate::util::merge_vec_into; + +#[derive(Debug)] +enum KnownValue { + Unknown { + backrefs: Vec, + used_in: Vec>, + }, + Known(T), +} + +struct Constraint<'inst, T: Eq + Clone, IDMarker> { + num_unknown_dependencies: usize, + constraint: Box) + 'inst>, +} +pub struct ConstraintReservation(UUID, usize); + +struct KnownIDMarker; +impl UUIDMarker for KnownIDMarker { + const DISPLAY_NAME: &'static str = "known_"; +} +struct ConstraintIDMarker; +impl UUIDMarker for ConstraintIDMarker { + const DISPLAY_NAME: &'static str = "constraint_"; +} + +/// Referencing [Unifyable::Unknown] is a strong code smell. +/// It is likely you should use [crate::typing::type_inference::TypeSubstitutor::unify_must_succeed] +/// or [crate::typing::type_inference::TypeSubstitutor::unify_report_error] instead +/// +/// It should only occur in creation `Unifyable::Unknown(self.type_substitutor.alloc())` +pub enum Unifyable { + Set(T), + Unknown(UUID), +} + +impl Unifyable { + pub fn is_unknown(&self) -> bool { + match self { + Unifyable::Set(_) => false, + Unifyable::Unknown(_) => true, + } + } + pub fn unwrap_set(&self) -> &T { + match self { + Unifyable::Set(s) => s, + Unifyable::Unknown(_) => panic!("unwrap_set not allowed to be Unknown"), + } + } +} + +impl Deref for Unifyable { + type Target = T; + + #[track_caller] + fn deref(&self) -> &T { + let Self::Set(v) = self else { + unreachable!("Attempting to Deref a not-Set Unifyable!") + }; + v + } +} + +impl Display for Unifyable { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + match self { + Unifyable::Set(v) => v.fmt(f), + Unifyable::Unknown(id) => f.write_fmt(format_args!("{id:?}")), + } + } +} + +impl Debug for Unifyable { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + match self { + Unifyable::Set(v) => v.fmt(f), + Unifyable::Unknown(id) => f.write_fmt(format_args!("{id:?}")), + } + } +} + +impl Clone for Unifyable { + fn clone(&self) -> Self { + match self { + Self::Set(arg0) => Self::Set(arg0.clone()), + Self::Unknown(arg0) => Self::Unknown(*arg0), + } + } +} +impl PartialEq for Unifyable { + fn eq(&self, other: &Self) -> bool { + let_unwrap!(Self::Set(a), self); + let_unwrap!(Self::Set(b), other); + a.eq(b) + } +} +impl Eq for Unifyable {} +impl std::hash::Hash for Unifyable { + fn hash(&self, state: &mut H) { + let_unwrap!(Self::Set(a), self); + a.hash(state); + } +} + +pub struct UnifyableAlloc { + ptrs: UUIDAllocator, + _ph: PhantomData, +} + +impl Default for UnifyableAlloc { + fn default() -> Self { + Self { + ptrs: Default::default(), + _ph: Default::default(), + } + } +} + +impl UnifyableAlloc { + pub fn alloc_unknown(&mut self) -> Unifyable { + Unifyable::Unknown(self.ptrs.alloc()) + } +} + +pub struct SetUnifierStore { + ptrs: FlatAlloc, IDMarker>, + known_values: ArenaAllocator>, KnownIDMarker>, +} + +impl SetUnifierStore { + pub fn get_substitution<'v>(&'v self, val: &'v Unifyable) -> Option<&'v T> { + match val { + Unifyable::Set(v) => Some(v), + Unifyable::Unknown(id) => match &self.known_values[self.ptrs[*id]] { + KnownValue::Unknown { .. } => None, + KnownValue::Known(new_v) => Some(new_v), + }, + } + } +} + +pub struct SetUnifier<'inst, T: Eq + Clone, IDMarker> { + pub store: SetUnifierStore, + constraints: ArenaAllocator, ConstraintIDMarker>, + constraints_ready_for_unification: Vec) + 'inst>>, +} +impl<'inst, T: Eq + Clone + Debug, IDMarker: UUIDMarker> SetUnifier<'inst, T, IDMarker> { + pub fn from_alloc(alloc: UnifyableAlloc) -> Self { + let mut known_values = ArenaAllocator::new(); + let ptrs = alloc.ptrs.as_range().map(|id| { + known_values.alloc(KnownValue::Unknown { + backrefs: vec![id], + used_in: Vec::new(), + }) + }); + SetUnifier { + store: SetUnifierStore { ptrs, known_values }, + constraints: ArenaAllocator::new(), + constraints_ready_for_unification: Vec::new(), + } + } + /// Executes all constraints (that become ready). Returns `false` if no constraints were ready + pub fn execute_ready_constraints(&mut self) -> bool { + let at_least_one = !self.constraints_ready_for_unification.is_empty(); + while let Some(cstr) = self.constraints_ready_for_unification.pop() { + cstr(self); + } + at_least_one + } + + pub fn decomission(self) -> SetUnifierStore { + self.store + } + + fn notify_constraints( + constraints: &mut ArenaAllocator, ConstraintIDMarker>, + constraints_ready_for_unification: &mut Vec< + Box) + 'inst>, + >, + used_in: Vec>, + ) { + for u in &*used_in { + constraints[*u].num_unknown_dependencies -= 1; + if constraints[*u].num_unknown_dependencies == 0 { + constraints_ready_for_unification.push(constraints.free(*u).constraint); + } + } + } + + pub fn unify(&mut self, a: &Unifyable, b: &Unifyable) -> bool { + match (a, b) { + (Unifyable::Set(a), Unifyable::Set(b)) => a == b, + (Unifyable::Set(v), Unifyable::Unknown(var)) + | (Unifyable::Unknown(var), Unifyable::Set(v)) => { + let k = &mut self.store.known_values[self.store.ptrs[*var]]; + match k { + KnownValue::Unknown { + backrefs: _, + used_in, + } => { + let used_in = std::mem::take(used_in); + *k = KnownValue::Known(v.clone()); + Self::notify_constraints( + &mut self.constraints, + &mut self.constraints_ready_for_unification, + used_in, + ); + true + } + KnownValue::Known(k) => k == v, + } + } + (Unifyable::Unknown(idx_a), Unifyable::Unknown(idx_b)) => { + let idx_a = self.store.ptrs[*idx_a]; + let idx_b = self.store.ptrs[*idx_b]; + match self.store.known_values.get2_mut(idx_a, idx_b) { + Some(( + KnownValue::Unknown { + backrefs: backrefs_a, + used_in: used_in_a, + }, + KnownValue::Unknown { + backrefs: backrefs_b, + used_in: used_in_b, + }, + )) => { + if backrefs_a.len() > backrefs_b.len() { + // Merge into a + merge_vec_into(used_in_a, std::mem::take(used_in_b)); + for v in &*backrefs_b { + self.store.ptrs[*v] = idx_a; + } + backrefs_a.extend_from_slice(backrefs_b); + self.store.known_values.free(idx_b); + } else { + // Merge into b + merge_vec_into(used_in_b, std::mem::take(used_in_a)); + for v in &*backrefs_a { + self.store.ptrs[*v] = idx_b; + } + backrefs_b.extend_from_slice(backrefs_a); + self.store.known_values.free(idx_a); + } + true + } + Some((KnownValue::Unknown { backrefs, used_in }, KnownValue::Known(_))) => { + // Resolve references to a to point to b + for v in &*backrefs { + self.store.ptrs[*v] = idx_b; + } + let used_in = std::mem::take(used_in); + Self::notify_constraints( + &mut self.constraints, + &mut self.constraints_ready_for_unification, + used_in, + ); + self.store.known_values.free(idx_a); + true + } + Some((KnownValue::Known(_), KnownValue::Unknown { backrefs, used_in })) => { + // Resolve references to b to point to a + for v in &*backrefs { + self.store.ptrs[*v] = idx_a; + } + let used_in = std::mem::take(used_in); + Self::notify_constraints( + &mut self.constraints, + &mut self.constraints_ready_for_unification, + used_in, + ); + self.store.known_values.free(idx_b); + true + } + Some((KnownValue::Known(x), KnownValue::Known(y))) => x == y, + None => true, + } + } + } + } + + /// If unification is with an incompatible target, then + pub fn set(&mut self, a: &Unifyable, v: T) -> Result<(), T> { + match a { + Unifyable::Set(k) => { + if k == &v { + Ok(()) + } else { + Err(k.clone()) + } + } + Unifyable::Unknown(var) => { + let k = &mut self.store.known_values[self.store.ptrs[*var]]; + match k { + KnownValue::Unknown { + backrefs: _, + used_in, + } => { + let used_in = std::mem::take(used_in); + *k = KnownValue::Known(v.clone()); + Self::notify_constraints( + &mut self.constraints, + &mut self.constraints_ready_for_unification, + used_in, + ); + Ok(()) + } + KnownValue::Known(k) => { + if k == &v { + Ok(()) + } else { + Err(k.clone()) + } + } + } + } + } + } + + /// The parameters given to this can be safely unwrapped in [Self::unwrap_known] + pub fn add_constraint<'a>( + &mut self, + dependencies: impl IntoIterator>, + f: impl FnOnce(&mut SetUnifier<'_, T, IDMarker>) + 'inst, + ) where + T: 'a, + IDMarker: 'a, + { + let reservation = self.reserve_constraint(dependencies); + self.place_reserved_constraint(reservation, f); + } + + /// This function and [Self::place_reserved_constraint] are used in tandem to split up the dependency on `dependencies` in [Self::add_constraint]. (The passed function will probably want ownership) For small lists this is no issue, but for bigger lists it would require a large clone. + pub fn reserve_constraint<'a>( + &mut self, + dependencies: impl IntoIterator>, + ) -> ConstraintReservation + where + T: 'a, + IDMarker: 'a, + { + let constr_id = self.constraints.reserve(); + let mut num_unknown_dependencies = 0; + for d in dependencies { + if let Unifyable::Unknown(var_id) = d { + if let KnownValue::Unknown { used_in, .. } = + &mut self.store.known_values[self.store.ptrs[*var_id]] + { + num_unknown_dependencies += 1; + used_in.push(constr_id); + } + } + } + ConstraintReservation(constr_id, num_unknown_dependencies) + } + /// This function and [Self::reserve_constraint] are used in tandem to split up the dependency on `dependencies` in [Self::add_constraint]. (The passed function will probably want ownership) For small lists this is no issue, but for bigger lists it would require a large clone. + pub fn place_reserved_constraint<'a>( + &mut self, + ConstraintReservation(constr_id, num_unknown_dependencies): ConstraintReservation, + f: impl FnOnce(&mut SetUnifier) + 'inst, + ) where + T: 'a, + IDMarker: 'a, + { + if num_unknown_dependencies > 0 { + self.constraints.alloc_reservation( + constr_id, + Constraint { + num_unknown_dependencies, + constraint: Box::new(f), + }, + ); + } else { + self.constraints.free_reservation(constr_id); + f(self); + } + } + /// To be used by [Self::add_constraint] + pub fn unwrap_known<'v>(&'v self, val: &'v Unifyable) -> &'v T { + self.store.get_substitution(val).unwrap() + } +} + +pub trait FullySubstitutable { + fn gather_all_substitutables<'slf>( + &'slf self, + gather_here: &mut Vec<&'slf Unifyable>, + ); + fn fully_substitute(&mut self, substitutor: &SetUnifierStore) -> bool; +} + +impl FullySubstitutable for Unifyable { + fn gather_all_substitutables<'slf>( + &'slf self, + gather_here: &mut Vec<&'slf Unifyable>, + ) { + gather_here.push(self); + } + fn fully_substitute(&mut self, substitutor: &SetUnifierStore) -> bool { + match self { + Unifyable::Set(_) => true, + Unifyable::Unknown(id) => match &substitutor.known_values[substitutor.ptrs[*id]] { + KnownValue::Unknown { .. } => false, + KnownValue::Known(new_v) => { + *self = Unifyable::Set(new_v.clone()); + true + } + }, + } + } +} + +pub struct DelayedErrorCollector<'inst, T: Clone, IDMarker> { + failures: AppendOnlyVec) + 'inst>>, +} + +impl<'inst, T: Clone, IDMarker> Default for DelayedErrorCollector<'inst, T, IDMarker> { + fn default() -> Self { + Self { + failures: Default::default(), + } + } +} + +impl<'inst, T: Clone, IDMarker> DelayedErrorCollector<'inst, T, IDMarker> { + pub fn new() -> Self { + Self::default() + } + pub fn report(self, store: &SetUnifierStore) { + for f in self.failures { + f(store) + } + } + pub fn error(&self, f: impl FnOnce(&SetUnifierStore) + 'inst) { + self.failures.push(Box::new(f)); + } +} diff --git a/src/typing/template.rs b/src/typing/template.rs index c790f94b..ecf55363 100644 --- a/src/typing/template.rs +++ b/src/typing/template.rs @@ -1,5 +1,75 @@ -use super::{abstract_type::AbstractRankedType, written_type::WrittenType}; -use crate::prelude::*; +use ibig::IBig; + +use super::{ + abstract_type::AbstractRankedType, concrete_type::ConcreteTemplateArg, + value_unifier::UnifyableValue, written_type::WrittenType, +}; +use crate::{prelude::*, typing::set_unifier::Unifyable, value::Value}; + +/// See [TVec]. All circumstances handling Templates need to handle both Types and Values. +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum TemplateKind { + Type(T), + Value(V), +} + +impl TemplateKind { + #[track_caller] + pub fn unwrap_type(&self) -> &T { + let_unwrap!(Self::Type(t), self); + t + } + #[track_caller] + pub fn unwrap_value(&self) -> &V { + let_unwrap!(Self::Value(t), self); + t + } +} +impl TemplateKind { + pub fn as_ref(&self) -> TemplateKind<&T, &V> { + match self { + TemplateKind::Type(t) => TemplateKind::Type(t), + TemplateKind::Value(v) => TemplateKind::Value(v), + } + } + pub fn as_mut(&mut self) -> TemplateKind<&mut T, &mut V> { + match self { + TemplateKind::Type(t) => TemplateKind::Type(t), + TemplateKind::Value(v) => TemplateKind::Value(v), + } + } + pub fn and(self, other: TemplateKind) -> TemplateKind<(T, T2), (V, V2)> { + match (self, other) { + (TemplateKind::Type(t1), TemplateKind::Type(t2)) => TemplateKind::Type((t1, t2)), + (TemplateKind::Value(v1), TemplateKind::Value(v2)) => TemplateKind::Value((v1, v2)), + (TemplateKind::Type(_), TemplateKind::Value(_)) + | (TemplateKind::Value(_), TemplateKind::Type(_)) => { + unreachable!("Cannot combine Type and Value template args!") + } + } + } + pub fn and_by_ref<'s, T2, V2>( + &'s self, + other: &'s TemplateKind, + ) -> TemplateKind<(&'s T, &'s T2), (&'s V, &'s V2)> { + match (self, other) { + (TemplateKind::Type(t1), TemplateKind::Type(t2)) => TemplateKind::Type((t1, t2)), + (TemplateKind::Value(v1), TemplateKind::Value(v2)) => TemplateKind::Value((v1, v2)), + (TemplateKind::Type(_), TemplateKind::Value(_)) + | (TemplateKind::Value(_), TemplateKind::Type(_)) => { + unreachable!("Cannot combine Type and Value template args!") + } + } + } +} + +impl TemplateKind { + pub fn unwrap_identical(self) -> T { + match self { + TemplateKind::Type(t) | TemplateKind::Value(t) => t, + } + } +} /// References any [crate::flattening::Module], [crate::flattening::StructType], or [crate::flattening::NamedConstant], /// and includes any template arguments. @@ -12,8 +82,7 @@ use crate::prelude::*; pub struct GlobalReference { pub name_span: Span, pub id: ID, - pub template_args: TVec>, - pub template_arg_types: TVec, + pub template_args: TVec, pub template_span: Option, } @@ -27,6 +96,29 @@ impl GlobalReference { } } +pub type AbstractTemplateArg = TemplateKind, TemplateArg>; + +impl AbstractTemplateArg { + pub fn map_is_provided(&self) -> Option<(Span, Span, TemplateKind<&WrittenType, &FlatID>)> { + match self { + TemplateKind::Type(TemplateArg::Provided { + name_span, + value_span, + arg, + .. + }) => Some((*name_span, *value_span, TemplateKind::Type(arg))), + TemplateKind::Value(TemplateArg::Provided { + name_span, + value_span, + arg, + .. + }) => Some((*name_span, *value_span, TemplateKind::Value(arg))), + TemplateKind::Type(TemplateArg::NotProvided { .. }) => None, + TemplateKind::Value(TemplateArg::NotProvided { .. }) => None, + } + } +} + /// The template parameters of an object ([crate::flattening::Module], [crate::flattening::StructType], or [crate::flattening::NamedConstant]) /// /// See [crate::linker::LinkInfo] @@ -36,7 +128,7 @@ impl GlobalReference { pub struct Parameter { pub name: String, pub name_span: Span, - pub kind: ParameterKind, + pub kind: TemplateKind, } /// See [Parameter] @@ -51,32 +143,6 @@ pub struct GenerativeParameterKind { #[derive(Debug)] pub struct TypeParameterKind {} -/// See [Parameter] -/// -/// Must match the [TemplateArgKind] that is passed -#[derive(Debug)] -pub enum ParameterKind { - Type(TypeParameterKind), - Generative(GenerativeParameterKind), -} - -impl ParameterKind { - #[track_caller] - pub fn unwrap_type(&self) -> &TypeParameterKind { - let Self::Type(t) = self else { - unreachable!("ParameterKind::unwrap_type on {self:?}") - }; - t - } - #[track_caller] - pub fn unwrap_value(&self) -> &GenerativeParameterKind { - let Self::Generative(v) = self else { - unreachable!("ParameterKind::unwrap_value on {self:?}") - }; - v - } -} - /// An argument passed to a template parameter. /// /// See [GlobalReference] @@ -85,35 +151,28 @@ impl ParameterKind { /// /// When instantiated, this becomes a [ConcreteTemplateArg] #[derive(Debug)] -pub struct TemplateArg { - pub name_span: Span, - pub value_span: Span, - pub kind: TemplateArgKind, -} - -/// See [TemplateArg] -/// -/// The argument kind passed to [ParameterKind], which it must match -#[derive(Debug)] -pub enum TemplateArgKind { - Type(WrittenType), - Value(FlatID), +pub enum TemplateArg { + Provided { + name_span: Span, + value_span: Span, + arg: T, + abs_typ: AbstractRankedType, + }, + NotProvided { + abs_typ: AbstractRankedType, + }, } -impl TemplateArgKind { - #[track_caller] - pub fn unwrap_type(&self) -> &WrittenType { - let Self::Type(t) = self else { - unreachable!("TemplateArgKind::unwrap_type on {self:?}") - }; - t +impl TemplateArg { + pub fn get_abstract_typ(&self) -> &AbstractRankedType { + match self { + TemplateArg::Provided { abs_typ, .. } | TemplateArg::NotProvided { abs_typ } => abs_typ, + } } - #[track_caller] - pub fn unwrap_value(&self) -> FlatID { - let Self::Value(v) = self else { - unreachable!("TemplateArgKind::unwrap_value on {self:?}") - }; - *v + pub fn get_abstract_typ_mut(&mut self) -> &mut AbstractRankedType { + match self { + TemplateArg::Provided { abs_typ, .. } | TemplateArg::NotProvided { abs_typ } => abs_typ, + } } } @@ -121,13 +180,35 @@ impl TemplateArgKind { pub type TVec = FlatAlloc; pub fn for_each_generative_input_in_template_args( - template_args: &TVec>, + template_args: &TVec, f: &mut impl FnMut(FlatID), ) { - for (_id, t_arg) in template_args.iter_valids() { - match &t_arg.kind { - TemplateArgKind::Type(typ) => typ.for_each_generative_input(f), - TemplateArgKind::Value(val) => f(*val), + for (_id, t_arg) in template_args { + match t_arg { + TemplateKind::Type(TemplateArg::Provided { arg: wr_typ, .. }) => { + wr_typ.for_each_generative_input(f) + } + TemplateKind::Value(TemplateArg::Provided { arg: val, .. }) => f(*val), + TemplateKind::Type(TemplateArg::NotProvided { .. }) + | TemplateKind::Value(TemplateArg::NotProvided { .. }) => {} } } } + +impl TVec { + pub fn cast_to_unifyable_array(&self) -> [&UnifyableValue; N] { + self.cast_to_array().map(|v| v.unwrap_value()) + } + pub fn cast_to_int_array(&self) -> [&IBig; N] { + self.cast_to_array().map(|v| { + let_unwrap!(TemplateKind::Value(Unifyable::Set(Value::Integer(i))), v); + i + }) + } + pub fn cast_to_int_array_mut(&mut self) -> [&mut IBig; N] { + self.cast_to_array_mut().map(|v| { + let_unwrap!(TemplateKind::Value(Unifyable::Set(Value::Integer(i))), v); + i + }) + } +} diff --git a/src/typing/type_inference.rs b/src/typing/type_inference.rs index 1a841ad1..205af5dc 100644 --- a/src/typing/type_inference.rs +++ b/src/typing/type_inference.rs @@ -2,17 +2,15 @@ use std::cell::OnceCell; use std::fmt::Debug; -use std::ops::{BitAnd, Deref, DerefMut}; +use std::ops::{BitAnd, BitAndAssign, Deref, DerefMut}; use crate::errors::ErrorInfo; use crate::prelude::*; use crate::alloc::{UUIDMarker, UUID}; -use crate::value::Value; -use super::abstract_type::{AbstractInnerType, DomainType}; -use super::abstract_type::{AbstractRankedType, PeanoType}; -use super::concrete_type::ConcreteType; +use super::abstract_type::{AbstractInnerType, PeanoType}; +use super::abstract_type::{AbstractRankedType, DomainType}; pub struct InnerTypeVariableIDMarker; impl UUIDMarker for InnerTypeVariableIDMarker { @@ -36,17 +34,9 @@ pub struct ConcreteTypeVariableIDMarker; impl UUIDMarker for ConcreteTypeVariableIDMarker { const DISPLAY_NAME: &'static str = "concrete_type_variable_"; } +#[allow(unused)] pub type ConcreteTypeVariableID = UUID; -#[derive(Debug)] -pub struct FailedUnification { - pub found: MyType, - pub expected: MyType, - pub span: Span, - pub context: String, - pub infos: Vec, -} - /// Implements Hindley-Milner type inference /// /// It actually already does eager inference where possible (through [Self::unify]) @@ -87,6 +77,13 @@ impl BitAnd for UnifyResult { } } } +impl BitAndAssign for UnifyResult { + fn bitand_assign(&mut self, rhs: Self) { + if *self == UnifyResult::Success { + *self = rhs; + } + } +} impl TypeSubstitutor { fn does_typ_reference_var_recurse_with_substitution( @@ -425,137 +422,28 @@ impl HindleyMilner for DomainType { } } -/// [HindleyMilnerInfo] `TypeFuncIdent` for [ConcreteType] -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum ConcreteTypeHMInfo<'slf> { - Named(TypeUUID), - Value(&'slf Value), - Array, -} - -impl HindleyMilner for ConcreteType { - type TypeFuncIdent<'slf> = ConcreteTypeHMInfo<'slf>; - type VariableIDMarker = ConcreteTypeVariableIDMarker; - - fn get_hm_info(&self) -> HindleyMilnerInfo { - match self { - ConcreteType::Unknown(var_id) => HindleyMilnerInfo::TypeVar(*var_id), - ConcreteType::Named(named_id) => { - HindleyMilnerInfo::TypeFunc(ConcreteTypeHMInfo::Named(named_id.id)) - } - ConcreteType::Value(v) => HindleyMilnerInfo::TypeFunc(ConcreteTypeHMInfo::Value(v)), - ConcreteType::Array(_) => HindleyMilnerInfo::TypeFunc(ConcreteTypeHMInfo::Array), - } - } - - fn unify_all_args UnifyResult>( - left: &Self, - right: &Self, - unify: &mut F, - ) -> UnifyResult { - match (left, right) { - (ConcreteType::Named(na), ConcreteType::Named(nb)) => { - assert!(*na == *nb); - UnifyResult::Success - } // Already covered by get_hm_info - (ConcreteType::Value(v_1), ConcreteType::Value(v_2)) => { - assert!(*v_1 == *v_2); - UnifyResult::Success - } // Already covered by get_hm_info - (ConcreteType::Array(arr_typ_1), ConcreteType::Array(arr_typ_2)) => { - let (arr_typ_1_arr, arr_typ_1_sz) = arr_typ_1.deref(); - let (arr_typ_2_arr, arr_typ_2_sz) = arr_typ_2.deref(); - unify(arr_typ_1_arr, arr_typ_2_arr) & unify(arr_typ_1_sz, arr_typ_2_sz) - } - (_, _) => unreachable!("All others should have been eliminated by get_hm_info check"), - } - } - - fn for_each_unknown(&self, f: &mut impl FnMut(ConcreteTypeVariableID)) { - match self { - ConcreteType::Named(_) | ConcreteType::Value(_) => {} - ConcreteType::Unknown(uuid) => f(*uuid), - ConcreteType::Array(arr_typ) => { - let (arr_typ, arr_sz) = arr_typ.deref(); - arr_typ.for_each_unknown(f); - arr_sz.for_each_unknown(f); - } - } - } -} - pub trait Substitutor { - type MyType: Clone; + type MyType: Clone + Debug; fn unify_total(&mut self, from: &Self::MyType, to: &Self::MyType) -> UnifyResult; fn unify_must_succeed(&mut self, a: &Self::MyType, b: &Self::MyType) { assert!( self.unify_total(a, b) == UnifyResult::Success, - "This unification cannot fail. Usually because we're unifying with a Written Type" + "This unification cannot fail. Usually because we're unifying with a Written Type: {a:?} <-> {b:?}" ); } - - /// Has to be implemented separately per type - /// - /// Returns true when no Unknowns remain - fn fully_substitute(&self, typ: &mut Self::MyType) -> bool; - - fn alloc_unknown(&mut self) -> Self::MyType; -} - -impl Substitutor for TypeSubstitutor { - type MyType = ConcreteType; - - fn fully_substitute(&self, typ: &mut ConcreteType) -> bool { - match typ { - ConcreteType::Named(_) | ConcreteType::Value(_) => true, // Don't need to do anything, this is already final - ConcreteType::Array(arr_typ) => { - let (arr_typ, arr_sz) = arr_typ.deref_mut(); - self.fully_substitute(arr_typ) && self.fully_substitute(arr_sz) - } - ConcreteType::Unknown(var) => { - let Some(replacement) = self[*var].get() else { - return false; - }; - *typ = replacement.clone(); - self.fully_substitute(typ) - } - } - } - - fn unify_total(&mut self, from: &ConcreteType, to: &ConcreteType) -> UnifyResult { - self.unify(from, to) - } - - fn alloc_unknown(&mut self) -> ConcreteType { - ConcreteType::Unknown(self.alloc(OnceCell::new())) - } -} - -impl TypeSubstitutor { - pub fn make_array_of(&mut self, content_typ: ConcreteType) -> ConcreteType { - ConcreteType::Array(Box::new((content_typ, self.alloc_unknown()))) - } } impl Substitutor for TypeSubstitutor { type MyType = DomainType; - fn fully_substitute(&self, typ: &mut DomainType) -> bool { - match typ { - DomainType::Generative | DomainType::Physical(_) => true, // Do nothing, These are done already - DomainType::Unknown(var) => { - *typ = *self[*var].get().expect("It's impossible for domain variables to remain, as any unset domain variable would have been replaced with a new physical domain"); - self.fully_substitute(typ) - } - } - } - fn unify_total(&mut self, from: &DomainType, to: &DomainType) -> UnifyResult { self.unify(from, to) } +} - fn alloc_unknown(&mut self) -> DomainType { +impl TypeSubstitutor { + pub fn alloc_unknown(&mut self) -> DomainType { DomainType::Unknown(self.alloc(OnceCell::new())) } } @@ -572,58 +460,86 @@ impl Substitutor for TypeSubstitutor { fn unify_total(&mut self, from: &PeanoType, to: &PeanoType) -> UnifyResult { self.unify(from, to) } +} +impl TypeSubstitutor { + pub fn alloc_unknown(&mut self) -> PeanoType { + PeanoType::Unknown(self.alloc(OnceCell::new())) + } +} + +impl Substitutor for AbstractTypeSubstitutor { + type MyType = AbstractRankedType; - fn fully_substitute(&self, typ: &mut PeanoType) -> bool { - match typ { - PeanoType::Succ(t) => self.fully_substitute(t), + fn unify_total(&mut self, from: &AbstractRankedType, to: &AbstractRankedType) -> UnifyResult { + self.inner_substitutor.unify(&from.inner, &to.inner) + & self.rank_substitutor.unify(&from.rank, &to.rank) + } +} + +impl AbstractTypeSubstitutor { + pub fn alloc_unknown(&mut self) -> AbstractRankedType { + AbstractRankedType { + inner: AbstractInnerType::Unknown(self.inner_substitutor.alloc(OnceCell::new())), + rank: PeanoType::Unknown(self.rank_substitutor.alloc(OnceCell::new())), + } + } +} + +impl DomainType { + pub fn fully_substitute(&mut self, substitutor: &TypeSubstitutor) -> bool { + match self { + DomainType::Generative | DomainType::Physical(_) => true, // Do nothing, These are done already + DomainType::Unknown(var) => { + *self = *substitutor[*var].get().expect("It's impossible for domain variables to remain, as any unset domain variable would have been replaced with a new physical domain"); + self.fully_substitute(substitutor) + } + } + } +} + +impl PeanoType { + pub fn fully_substitute(&mut self, substitutor: &TypeSubstitutor) -> bool { + match self { + PeanoType::Succ(t) => t.fully_substitute(substitutor), PeanoType::Zero => true, PeanoType::Unknown(var) => { - let Some(replacement) = self[*var].get() else { + let Some(replacement) = substitutor[*var].get() else { return false; }; - assert!(!std::ptr::eq(typ, replacement)); - *typ = replacement.clone(); - self.fully_substitute(typ) + assert!(!std::ptr::eq(self, replacement)); + *self = replacement.clone(); + self.fully_substitute(substitutor) } } } - - fn alloc_unknown(&mut self) -> PeanoType { - PeanoType::Unknown(self.alloc(OnceCell::new())) - } } -impl Substitutor for AbstractTypeSubstitutor { - type MyType = AbstractRankedType; - - fn fully_substitute(&self, typ: &mut AbstractRankedType) -> bool { - let inner_success = match &mut typ.inner { +impl AbstractRankedType { + pub fn fully_substitute(&mut self, substitutor: &AbstractTypeSubstitutor) -> bool { + let inner_success = match &mut self.inner { AbstractInnerType::Named(_) | AbstractInnerType::Template(_) => true, // Template Name & Name is included in get_hm_info AbstractInnerType::Unknown(var) => { - if let Some(replacement) = self.inner_substitutor[*var].get() { - assert!(!std::ptr::eq(&typ.inner, replacement)); - typ.inner = replacement.clone(); - self.fully_substitute(typ) + if let Some(replacement) = substitutor.inner_substitutor[*var].get() { + assert!(!std::ptr::eq(&self.inner, replacement)); + self.inner = replacement.clone(); + self.fully_substitute(substitutor) } else { false } } }; - let rank_success = self.rank_substitutor.fully_substitute(&mut typ.rank); + let rank_success = self.rank.fully_substitute(&substitutor.rank_substitutor); inner_success & rank_success } +} - fn unify_total(&mut self, from: &AbstractRankedType, to: &AbstractRankedType) -> UnifyResult { - self.inner_substitutor.unify(&from.inner, &to.inner) - & self.rank_substitutor.unify(&from.rank, &to.rank) - } - - fn alloc_unknown(&mut self) -> AbstractRankedType { - AbstractRankedType { - inner: AbstractInnerType::Unknown(self.inner_substitutor.alloc(OnceCell::new())), - rank: PeanoType::Unknown(self.rank_substitutor.alloc(OnceCell::new())), - } - } +#[derive(Debug)] +pub struct FailedUnification { + pub found: MyType, + pub expected: MyType, + pub span: Span, + pub context: String, + pub infos: Vec, } pub struct TypeUnifier { @@ -703,80 +619,3 @@ impl Drop for TypeUnifier { } } } - -/// See [DelayedConstraintsList::resolve_delayed_constraints] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum DelayedConstraintStatus { - /// The constraint can be removed - Resolved, - /// Progress was made, (potentially enabling other parts to continue), but the constraint cannot be removed - #[allow(unused)] - Progress, - /// No progress was made, if all constraints return [DelayedConstraintStatus::NoProgress] then type resolution deadlocked and cannot finish. - NoProgress, -} - -/// Implement this for any typing constraints that can't be resolved immediately. -/// -/// See [DelayedConstraintsList] -pub trait DelayedConstraint { - fn try_apply(&mut self, shared_object: &mut T) -> DelayedConstraintStatus; - fn report_could_not_resolve_error(&self, shared_object: &T); -} - -/// This is for unification of constraints that may not be resolveable right away -/// -/// Such as struct field access. vec.x cannot resolve the type of x before the type of vec has been resolved -/// -/// The given function should only make changes when it can be successfully resolved -/// -/// When the constraint has been resolved, it should return 'true' -/// -/// For convenience, a &mut T is provided such that a shared mutable object can be used -pub struct DelayedConstraintsList(Vec>>); - -impl DelayedConstraintsList { - pub fn new() -> Self { - Self(Vec::new()) - } - - /// Add a constraint - pub fn push + 'static>(&mut self, constraint: C) { - self.0.push(Box::new(constraint)); - } - - /// Will keep looping over the list of constraints, and try to apply them. - /// - /// Calls [DelayedConstraint::report_could_not_resolve_error] on all constraints that weren't resolved - pub fn resolve_delayed_constraints(mut self, shared_object: &mut T) { - while !self.0.is_empty() { - let mut progress_made = false; - self.0 - .retain_mut(|constraint| match constraint.try_apply(shared_object) { - DelayedConstraintStatus::Resolved => { - progress_made = true; - false - } - DelayedConstraintStatus::Progress => { - progress_made = true; - true - } - DelayedConstraintStatus::NoProgress => true, - }); - if !progress_made { - for constraint in std::mem::take(&mut self.0) { - constraint.report_could_not_resolve_error(shared_object); - } - return; // Exit - } - } - } -} - -impl Drop for DelayedConstraintsList { - fn drop(&mut self) { - if !std::thread::panicking() { - assert_eq!(self.0.len(), 0, "DelayedConstraintsList was not resolved."); - } - } -} diff --git a/src/typing/value_unifier.rs b/src/typing/value_unifier.rs new file mode 100644 index 00000000..14f06c88 --- /dev/null +++ b/src/typing/value_unifier.rs @@ -0,0 +1,432 @@ +use std::{ + collections::HashMap, + ops::{Deref, DerefMut}, +}; + +use ibig::IBig; +use sus_proc_macro::get_builtin_type; + +use crate::{ + let_unwrap, + prelude::*, + typing::{abstract_type::AbstractInnerType, template::TVec}, + util::all_equal, + value::Value, +}; + +use super::{ + abstract_type::AbstractRankedType, + concrete_type::{ConcreteGlobalReference, ConcreteTemplateArg, ConcreteType}, + set_unifier::{ + DelayedErrorCollector, FullySubstitutable, SetUnifier, SetUnifierStore, Unifyable, + UnifyableAlloc, + }, + template::TemplateKind, + type_inference::ConcreteTypeVariableIDMarker, +}; + +pub type UnifyableValue = Unifyable; +pub type ValueUnifierAlloc = UnifyableAlloc; +pub type ValueUnifierStore = SetUnifierStore; +pub type ValueUnifier<'inst> = SetUnifier<'inst, Value, ConcreteTypeVariableIDMarker>; +pub type ValueErrorReporter<'inst> = + DelayedErrorCollector<'inst, Value, ConcreteTypeVariableIDMarker>; + +impl From for UnifyableValue { + fn from(val: Value) -> Self { + assert!( + !matches!(val, Value::Unset), + "Compiletime Value MUST be set before use in Type Unification" + ); + Unifyable::Set(val) + } +} + +impl<'inst> ValueUnifier<'inst> { + /// Unifies all [UnifyableValue] parameters contained in the [ConcreteType]s that are not used in subtyping relations. + /// Parameters that are involved in subtyping relations (like int::MIN & int::MAX) are ignored. Retrieve these with + /// [ConcreteType::retreive_unifyable_parameters] + pub fn unify_concrete( + &mut self, + from: &ConcreteType, + to: &ConcreteType, + ) -> bool { + match (from, to) { + (ConcreteType::Named(a), ConcreteType::Named(b)) => { + assert_eq!(a.id, b.id); + if !UNIFY_EVERYTHING && a.id == get_builtin_type!("int") { + // Int args are part of subtyping. + return true; + } + let mut success = true; + for (_, a, b) in crate::alloc::zip_eq(&a.template_args, &b.template_args) { + success &= match a.and_by_ref(b) { + TemplateKind::Type((a, b)) => self.unify_concrete::(a, b), + TemplateKind::Value((a, b)) => self.unify(a, b), + }; + } + success + } + (ConcreteType::Array(a), ConcreteType::Array(b)) => { + let (a_content, a_sz) = a.deref(); + let (b_content, b_sz) = b.deref(); + + self.unify_concrete::(a_content, b_content) + & self.unify(a_sz, b_sz) + } + (ConcreteType::Named(_), ConcreteType::Array(_)) + | (ConcreteType::Array(_), ConcreteType::Named(_)) => { + unreachable!("Caught by abstract typecheck") + } + } + } + + /// Gathers values for subtype relations for a's parameters + fn unify_gather_subtype_relations<'a>( + &mut self, + a: &'a ConcreteType, + b: &'a ConcreteType, + source_gather: &mut SubTypeSourceGatherer<'_, 'a>, + ) -> bool { + let mut unify_success = true; + match (a, b) { + (ConcreteType::Named(global_ref_a), ConcreteType::Named(global_ref_b)) => { + match all_equal([global_ref_a.id, global_ref_b.id]) { + get_builtin_type!("int") => { + let [min_a, max_a] = global_ref_a.template_args.cast_to_unifyable_array(); + let [min_b, max_b] = global_ref_b.template_args.cast_to_unifyable_array(); + source_gather.add_relation(ValueUnificationRelation::Min, min_a, min_b); + source_gather.add_relation(ValueUnificationRelation::Max, max_a, max_b); + } + _ => { + for (_, arg_a, arg_b) in crate::alloc::zip_eq( + &global_ref_a.template_args, + &global_ref_b.template_args, + ) { + unify_success &= match arg_a.and_by_ref(arg_b) { + TemplateKind::Type((t_a, t_b)) => { + self.unify_gather_subtype_relations(t_a, t_b, source_gather) + } + TemplateKind::Value((v_a, v_b)) => self.unify(v_a, v_b), + } + } + } + } + } + (ConcreteType::Array(arr_box_a), ConcreteType::Array(arr_box_b)) => { + let (content_a, sz_a) = arr_box_a.deref(); + let (content_b, sz_b) = arr_box_b.deref(); + unify_success &= self.unify(sz_a, sz_b); + self.unify_gather_subtype_relations(content_a, content_b, source_gather); + } + _ => unreachable!("Caught by typecheck"), + } + unify_success + } + + /// In type_iter: The first type represents the target, the second type represents the source + pub fn create_subtype_constraint( + &mut self, + type_iter: impl IntoIterator, + ) { + let type_iter = type_iter.into_iter(); + let expected_num_targets = type_iter.size_hint().0; + + let mut source_gather_hashmap = + HashMap::<*const UnifyableValue, CommonSubtypeRelation<'inst>>::new(); + + for (to_typ, from_typ) in type_iter { + let mut source_gather = SubTypeSourceGatherer { + source_gather: &mut source_gather_hashmap, + expected_num_targets, + }; + // Errors are reported by final_checks + let _ = self.unify_gather_subtype_relations(to_typ, from_typ, &mut source_gather); + } + + for var_sources in source_gather_hashmap.into_values() { + match var_sources.target { + // Set means that it's specified! Because it was placed there directly by execute. Known values due to unifying are [Unifyable::Unknown] pointing to [KnownValue::Known] + // Errors are reported by final_checks + Unifyable::Set(_) => {} + Unifyable::Unknown(_) => { + let reservation = self.reserve_constraint(var_sources.sources.iter().copied()); + self.place_reserved_constraint(reservation, move |unifier| { + let source_iter = var_sources + .sources + .into_iter() + .map(|src| unifier.unwrap_known(src).unwrap_integer()); + + let common_subtype = match var_sources.relation { + ValueUnificationRelation::Min => source_iter.min(), + ValueUnificationRelation::Max => source_iter.max(), + }; + // We can simply unwrap, because a source only appears in the HashMap if it's actually encountered, and thus at least one other var matches with it! + let common_subtype = common_subtype.unwrap().clone(); + + // Values used in subtyping relations are always resolved in a forward direction (so a value b that depends on value a only gets resolved after a is resolved) + // That's why we can safely call unwrap() + unifier + .set(var_sources.target, Value::Integer(common_subtype)) + .unwrap(); + }); + } + } + } + } +} + +pub struct CommonSubtypeRelation<'t> { + pub target: &'t UnifyableValue, + pub relation: ValueUnificationRelation, + pub sources: Vec<&'t UnifyableValue>, +} + +impl ValueUnifierAlloc { + pub fn make_array_of(&mut self, content_typ: ConcreteType) -> ConcreteType { + ConcreteType::Array(Box::new((content_typ, self.alloc_unknown()))) + } + fn mk_int_maybe(&mut self, v: Option) -> TemplateKind { + TemplateKind::Value(match v { + Some(v) => Value::Integer(v).into(), + None => self.alloc_unknown(), + }) + } + /// Creates a new `int #(int MIN, int MAX)`. The resulting int can have a value from `MIN` to `MAX-1` + pub fn new_int_type(&mut self, min: Option, max: Option) -> ConcreteType { + let template_args = + FlatAlloc::from_vec(vec![self.mk_int_maybe(min), self.mk_int_maybe(max)]); + + ConcreteType::Named(ConcreteGlobalReference { + id: get_builtin_type!("int"), + template_args, + }) + } +} + +impl Value { + /// Returns None for Unset + pub fn get_type_id(&self) -> TypeUUID { + match self { + Value::Bool(_) => get_builtin_type!("bool"), + Value::Integer(_) => get_builtin_type!("int"), + Value::Array(_) => unreachable!("Value::get_type_abs is only ever used for terminal Values, because any array instantiations would be Expression::ArrayConstruct"), + Value::Unset => unreachable!(), + } + } + + /// Traverses the Value, to create a [ConcreteType] for it, guided by the abstract type given. + /// So '1' becomes `ConcreteType::Named(ConcreteGlobalReference{id: get_builtin_type!("int"), ...}})`, + /// but `Value::Array([])` becomes `ConcreteType::Array((ConcreteType::Unknown, 0))` + /// + /// Panics when arrays contain mutually incompatible types + pub fn concretize_type( + &self, + linker: &Linker, + abs_typ: &AbstractRankedType, + template_args: &TVec, + value_alloc: &mut ValueUnifierAlloc, + ) -> Result { + let array_depth = abs_typ.rank.count().unwrap(); + let mut tensor_sizes = Vec::with_capacity(array_depth); + + let content_typ = match &abs_typ.inner { + AbstractInnerType::Template(template_id) => { + self.get_tensor_size_recursive(0, array_depth, &mut tensor_sizes, &mut |_| Ok(()))?; + template_args[*template_id].unwrap_type().clone() + } + AbstractInnerType::Named(content_typ_id) => { + let mut result_args: Option> = None; + + self.get_tensor_size_recursive(0, array_depth, &mut tensor_sizes, &mut |v| { + match v { + Value::Bool(_) => { + assert_eq!(*content_typ_id, get_builtin_type!("bool")); + } + Value::Integer(v) => { + assert_eq!(*content_typ_id, get_builtin_type!("int")); + if let Some(args) = &mut result_args { + let [min, max] = args.cast_to_int_array_mut(); + if v < min { + *min = v.clone(); + } + if v > max { + *max = v.clone(); + } + } else { + result_args = Some(TVec::from_vec(vec![ + TemplateKind::Value(Value::Integer(v.clone()).into()), + TemplateKind::Value(Value::Integer(v.clone()).into()), + ])) + } + } + Value::Array(_) => { + unreachable!("All arrays handled by get_tensor_size_recursive") + } + Value::Unset => { + return Err("This compile-time constant contains Unset".into()); + } + } + Ok(()) + })?; + + ConcreteType::Named(ConcreteGlobalReference { + id: *content_typ_id, + template_args: match result_args { + Some(args) => args, + None => linker.types[*content_typ_id].link_info.template_parameters.map(|(_, param)| match ¶m.kind { + TemplateKind::Type(_) => todo!("Should extract type info from AbstractRankedType with specified args instead!"), + TemplateKind::Value(_) => TemplateKind::Value(value_alloc.alloc_unknown()) + }), + }, + }) + } + AbstractInnerType::Unknown(_) => unreachable!("Caught by typecheck"), + }; + + Ok(content_typ.stack_arrays_usize(&tensor_sizes)) + } + fn get_tensor_size_recursive( + &self, + depth: usize, + max_depth: usize, + tensor_sizes: &mut Vec, + elem_fn: &mut impl FnMut(&Value) -> Result<(), String>, + ) -> Result<(), String> { + if depth == max_depth { + elem_fn(self) + } else { + let Value::Array(values) = self else { + unreachable!() + }; + if let Some(sz) = tensor_sizes.get(depth) { + if *sz != values.len() { + return Err("Value is a Jagged Tensor. This is not allowed!".into()); + } + } else { + assert!(tensor_sizes.len() == depth); + tensor_sizes.push(values.len()); + } + for v in values { + v.get_tensor_size_recursive(depth + 1, max_depth, tensor_sizes, elem_fn)?; + } + Ok(()) + } + } +} + +impl FullySubstitutable for ConcreteType { + fn gather_all_substitutables<'slf>(&'slf self, gather_here: &mut Vec<&'slf UnifyableValue>) { + match self { + ConcreteType::Named(global_ref) => global_ref + .template_args + .gather_all_substitutables(gather_here), + ConcreteType::Array(arr) => { + let (content, sz) = arr.deref(); + gather_here.push(sz); + content.gather_all_substitutables(gather_here); + } + } + } + fn fully_substitute(&mut self, substitutor: &ValueUnifierStore) -> bool { + match self { + ConcreteType::Named(global_ref) => { + global_ref.template_args.fully_substitute(substitutor) + } + ConcreteType::Array(arr) => { + let (content, sz) = arr.deref_mut(); + content.fully_substitute(substitutor) & sz.fully_substitute(substitutor) + } + } + } +} + +impl FullySubstitutable for TVec { + fn gather_all_substitutables<'slf>(&'slf self, gather_here: &mut Vec<&'slf UnifyableValue>) { + for (_, arg) in self { + match arg { + TemplateKind::Type(t) => t.gather_all_substitutables(gather_here), + TemplateKind::Value(v) => gather_here.push(v), + } + } + } + fn fully_substitute(&mut self, substitutor: &ValueUnifierStore) -> bool { + self.iter_mut().all(|(_, arg)| match arg { + TemplateKind::Type(t) => t.fully_substitute(substitutor), + TemplateKind::Value(v) => v.fully_substitute(substitutor), + }) + } +} + +impl ConcreteType { + pub fn get_value_args(&self, expected: TypeUUID) -> [&UnifyableValue; N] { + let_unwrap!(ConcreteType::Named(typ), &self); + assert_eq!(typ.id, expected); + typ.template_args + .cast_to_array::() + .map(|v| v.unwrap_value()) + } + pub fn set_named_template_args( + &self, + expected: TypeUUID, + unifier: &mut ValueUnifier<'_>, + args: [impl Into; N], + ) -> bool { + let_unwrap!(ConcreteType::Named(typ), &self); + assert_eq!(typ.id, expected); + crate::util::zip_eq(typ.template_args.iter(), args) + .all(|((_, to_unify), arg)| unifier.set(to_unify.unwrap_value(), arg.into()).is_ok()) + } + pub fn new_named_with_args( + id: TypeUUID, + args: [impl Into; N], + ) -> Self { + ConcreteType::Named(ConcreteGlobalReference { + id, + template_args: FlatAlloc::from_vec(args.map(|a| a.into()).to_vec()), + }) + } + + pub fn display_substitute(&self, linker: &Linker, substitutor: &ValueUnifierStore) -> String { + let mut typ_copy = self.clone(); + typ_copy.fully_substitute(substitutor); + let as_display = typ_copy.display(&linker.types, true); + as_display.to_string() + } +} + +struct SubTypeSourceGatherer<'hm, 'a> { + source_gather: &'hm mut HashMap<*const UnifyableValue, CommonSubtypeRelation<'a>>, + expected_num_targets: usize, +} + +impl<'hm, 'inst> SubTypeSourceGatherer<'hm, 'inst> { + fn add_relation( + &mut self, + relation: ValueUnificationRelation, + target: &'inst UnifyableValue, + value: &'inst UnifyableValue, + ) { + let list = match self.source_gather.entry(target) { + std::collections::hash_map::Entry::Occupied(occupied_entry) => { + let occ = occupied_entry.into_mut(); + assert!(occ.relation == relation); + occ + } + std::collections::hash_map::Entry::Vacant(vacant_entry) => { + vacant_entry.insert(CommonSubtypeRelation { + target, + relation, + sources: Vec::with_capacity(self.expected_num_targets), + }) + } + }; + list.sources.push(value); + } +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum ValueUnificationRelation { + Min, + Max, +} diff --git a/src/typing/written_type.rs b/src/typing/written_type.rs index 259c5740..cf38e97f 100644 --- a/src/typing/written_type.rs +++ b/src/typing/written_type.rs @@ -1,18 +1,13 @@ use std::ops::Deref; -use crate::{ - flattening::{DeclarationKind, ExpressionSource, WireReferenceRoot}, - linker::LinkInfo, - prelude::*, -}; +use crate::prelude::*; use super::{ abstract_type::{AbstractInnerType, AbstractRankedType}, - concrete_type::{ConcreteGlobalReference, ConcreteType}, template::{ - for_each_generative_input_in_template_args, GlobalReference, TVec, TemplateArgKind, + for_each_generative_input_in_template_args, AbstractTemplateArg, GlobalReference, TVec, }, - type_inference::{AbstractTypeSubstitutor, Substitutor, TypeSubstitutor}, + type_inference::AbstractTypeSubstitutor, }; /// The textual representation of a type expression in the source code. @@ -85,13 +80,14 @@ impl AbstractTypeSubstitutor { pub fn written_to_abstract_type_substitute_templates( &mut self, wr_typ: &WrittenType, - template_type_args: &TVec, + template_args: &TVec, ) -> AbstractRankedType { match wr_typ { WrittenType::Error(_span) => self.alloc_unknown(), - WrittenType::TemplateVariable(_span, argument_id) => { - template_type_args[*argument_id].clone() - } + WrittenType::TemplateVariable(_span, argument_id) => template_args[*argument_id] + .unwrap_type() + .get_abstract_typ() + .clone(), WrittenType::Named(global_reference) => { AbstractInnerType::Named(global_reference.id).scalar() } @@ -99,107 +95,11 @@ impl AbstractTypeSubstitutor { let (arr_content_type, _size_flat, _array_bracket_span) = array_content_and_size.deref(); - let content_typ = self.written_to_abstract_type_substitute_templates( - arr_content_type, - template_type_args, - ); + let content_typ = self + .written_to_abstract_type_substitute_templates(arr_content_type, template_args); content_typ.rank_up() } } } } - -impl TypeSubstitutor { - pub fn concretize_written_type_with_possible_template_args( - &mut self, - written_typ: &WrittenType, - template_args: &TVec, - link_info: &LinkInfo, - ) -> ConcreteType { - match written_typ { - WrittenType::Error(_span) => self.alloc_unknown(), - WrittenType::TemplateVariable(_span, uuid) => template_args[*uuid].clone(), - WrittenType::Named(global_reference) => { - let object_template_args: TVec = - global_reference - .template_args - .map(|(_arg_id, arg)| -> ConcreteType { - if let Some(arg) = arg { - match &arg.kind { - TemplateArgKind::Type(arg_wr_typ) => self - .concretize_written_type_with_possible_template_args( - arg_wr_typ, - template_args, - link_info, - ), - TemplateArgKind::Value(uuid) => { - if let Some(found_template_arg) = - can_expression_be_value_inferred(link_info, *uuid) - { - template_args[found_template_arg].clone() - } else { - self.alloc_unknown() - } - } - } - } else { - self.alloc_unknown() - } - }); - - ConcreteType::Named(ConcreteGlobalReference { - id: global_reference.id, - template_args: object_template_args, - }) - } - WrittenType::Array(_span, arr_box) => { - let (arr_content_wr, arr_idx_id, _arr_brackets) = arr_box.deref(); - - let arr_content_concrete = self - .concretize_written_type_with_possible_template_args( - arr_content_wr, - template_args, - link_info, - ); - let arr_idx_concrete = if let Some(found_template_arg) = - can_expression_be_value_inferred(link_info, *arr_idx_id) - { - template_args[found_template_arg].clone() - } else { - self.alloc_unknown() - }; - - ConcreteType::Array(Box::new((arr_content_concrete, arr_idx_concrete))) - } - } - } -} - -/// Part of Template Value Inference. -/// -/// Specifically, for code like this: -/// -/// ```sus -/// module add_all #(int Size) { -/// input int[Size] arr // We're targeting the 'Size' within the array size -/// output int total -/// } -/// ``` -fn can_expression_be_value_inferred(link_info: &LinkInfo, expr_id: FlatID) -> Option { - let expr = link_info.instructions[expr_id].unwrap_expression(); - let ExpressionSource::WireRef(wr) = &expr.source else { - return None; - }; - if !wr.path.is_empty() { - return None; - } // Must be a plain, no fuss reference to a de - let WireReferenceRoot::LocalDecl(wire_declaration, _span) = &wr.root else { - return None; - }; - let template_arg_decl = link_info.instructions[*wire_declaration].unwrap_declaration(); - let DeclarationKind::GenerativeInput(template_id) = &template_arg_decl.decl_kind else { - return None; - }; - Some(*template_id) -} diff --git a/src/util.rs b/src/util.rs index 0b10ef28..2b54d5fa 100644 --- a/src/util.rs +++ b/src/util.rs @@ -1,14 +1,22 @@ -#[allow(unused)] -pub fn all_equal( - iter: impl IntoIterator, - mut f: impl FnMut(T) -> O, -) -> Option { +use std::fmt::Debug; + +/*pub fn all_equal_in_iter(iter: impl IntoIterator) -> Option { let mut iter = iter.into_iter(); - let first = f(iter.next()?); + let first = iter.next()?; for v in iter { - assert_eq!(first, f(v)); + assert_eq!(first, v); } Some(first) +}*/ + +pub fn all_equal(vs: [T; N]) -> T { + // const _: () = const { assert!(N > 0) }; + let mut iter = vs.into_iter(); + let first = iter.next().unwrap(); + for v in iter { + assert_eq!(first, v); + } + first } #[track_caller] @@ -29,6 +37,14 @@ pub fn zip_eq( } } +/// Merges a and b, order is unimportant +pub fn merge_vec_into(a: &mut Vec, mut b: Vec) { + if a.len() < b.len() { + std::mem::swap(a, &mut b); + } + a.append(&mut b); +} + #[derive(Debug)] pub struct ZippedIterator, IterB: Iterator> { iter_a: IterA, diff --git a/src/value.rs b/src/value.rs index f5d13266..1b123e99 100644 --- a/src/value.rs +++ b/src/value.rs @@ -1,11 +1,12 @@ use std::ops::Deref; use ibig::IBig; +use sus_proc_macro::get_builtin_type; use crate::flattening::{BinaryOperator, UnaryOperator}; -use crate::typing::concrete_type::{ConcreteType, BOOL_CONCRETE_TYPE, INT_CONCRETE_TYPE}; -use crate::typing::type_inference::{Substitutor, TypeSubstitutor}; +use crate::typing::concrete_type::{ConcreteTemplateArg, ConcreteType}; +use crate::typing::set_unifier::Unifyable; /// Top type for any kind of compiletime value while executing. /// @@ -18,60 +19,75 @@ pub enum Value { /// The initial [Value] a variable has, before it's been set. (translates to `'x` don't care) Unset, } - -impl ConcreteType { +/*impl ConcreteType { + fn update_smallest_common_supertype(&mut self, other: &Self) -> Option<()> { + match (self, other) { + (_, ConcreteType::Unknown(_)) | (ConcreteType::Unknown(_), _) => None, + (ConcreteType::Named(left), ConcreteType::Named(right)) => { + assert_eq!(left.id, right.id); + if left.id == get_builtin_type!("int") { + if let ( + [TemplateKind::Value(ConcreteType::Value(Value::Integer(left_min))), TemplateKind::Value(ConcreteType::Value(Value::Integer(left_max)))], + [TemplateKind::Value(ConcreteType::Value(Value::Integer(right_min))), TemplateKind::Value(ConcreteType::Value(Value::Integer(right_max)))], + ) = ( + left.template_args.cast_to_array_mut(), + right.template_args.cast_to_array(), + ) { + if right_min < left_min { + *left_min = right_min.clone(); + } + if right_max > left_max { + *left_max = right_max.clone(); + } + Some(()) + } else { + None + } + } else { + for (_, left_arg, right_arg) in + zip_eq(left.template_args.iter_mut(), right.template_args.iter()) + { + left_arg.update_smallest_common_supertype(right_arg)?; + } + Some(()) + } + } + (ConcreteType::Array(left), ConcreteType::Array(right)) => { + let (left_content, left_size) = left.deref_mut(); + let (right_content, right_size) = right.deref(); + left_size.update_smallest_common_supertype(right_size)?; + left_content.update_smallest_common_supertype(right_content) + } + (ConcreteType::Value(left), ConcreteType::Value(right)) => { + (left == right).then_some(()) + } + _ => unreachable!("Caught by typecheck"), + } + } /// On the road to implementing subtyping. Takes in a list of types, /// and computes the smallest supertype that all list elements can coerce to. /// TODO integrate into Hindley-Milner more closely fn get_smallest_common_supertype( - list: &[Self], + mut iter: impl Iterator, type_substitutor: &mut TypeSubstitutor, ) -> Option { - let mut iter = list.iter(); - - let first = iter.next()?.clone(); + let mut first = iter.next()?; + let _ = type_substitutor.fully_substitute(&mut first); - for elem in iter { - type_substitutor.unify_must_succeed(&first, elem); + for mut elem in iter { + let _ = type_substitutor.fully_substitute(&mut elem); + first.update_smallest_common_supertype(&elem)?; } Some(first) } -} +}*/ impl Value { - /// Traverses the Value, to create a best-effort [ConcreteType] for it. - /// So '1' becomes [INT_CONCRETE_TYPE], - /// but `Value::Array([])` becomes `ConcreteType::Array((ConcreteType::Unknown, 0))` - /// - /// Panics when arrays contain mutually incompatible types - pub fn get_type(&self, type_substitutor: &mut TypeSubstitutor) -> ConcreteType { - match self { - Value::Bool(_) => BOOL_CONCRETE_TYPE, - Value::Integer(_) => INT_CONCRETE_TYPE, - Value::Array(arr) => { - let typs_arr: Vec = arr - .iter() - .map(|elem| elem.get_type(type_substitutor)) - .collect(); - - let shared_supertype = - ConcreteType::get_smallest_common_supertype(&typs_arr, type_substitutor) - .unwrap_or_else(|| type_substitutor.alloc_unknown()); - - ConcreteType::Array(Box::new(( - shared_supertype, - ConcreteType::Value(Value::Integer(arr.len().into())), - ))) - } - Value::Unset => type_substitutor.alloc_unknown(), - } - } - - pub fn contains_errors_or_unsets(&self) -> bool { + pub fn contains_unset(&self) -> bool { match self { Value::Bool(_) | Value::Integer(_) => false, - Value::Array(values) => values.iter().any(|v| v.contains_errors_or_unsets()), + Value::Array(values) => values.iter().any(|v| v.contains_unset()), Value::Unset => true, } } @@ -106,6 +122,25 @@ impl Value { }; arr } + + /// Requires `typ` to be fully substituted + /// + /// Allows the existense of [Value::Unset] + pub fn is_of_type(&self, typ: &ConcreteType) -> bool { + match self { + Value::Bool(_) => typ.unwrap_named().id == get_builtin_type!("bool"), + Value::Integer(v) => { + let (min, max) = typ.unwrap_integer_bounds(); + min <= v && max >= v + } + Value::Array(values) => { + let (content, sz) = typ.unwrap_array(); + values.len() == sz.unwrap_int::() + && values.iter().all(|v| v.is_of_type(content)) + } + Value::Unset => true, + } + } } pub fn compute_unary_op(op: UnaryOperator, v: &Value) -> Value { @@ -165,7 +200,7 @@ impl ConcreteType { ConcreteType::Named(_name) => Value::Unset, ConcreteType::Array(arr) => { let (arr_typ, arr_size) = arr.deref(); - let arr_size: usize = arr_size.unwrap_value().unwrap_int(); + let arr_size: usize = arr_size.unwrap_int(); let mut arr = Vec::new(); if arr_size > 0 { let content_typ = arr_typ.get_initial_val(); @@ -173,7 +208,42 @@ impl ConcreteType { } Value::Array(arr) } - ConcreteType::Value(_) | ConcreteType::Unknown(_) => unreachable!(), } } } + +impl From for Value { + fn from(value: IBig) -> Self { + Value::Integer(value) + } +} + +impl From for Value { + fn from(value: bool) -> Self { + Value::Bool(value) + } +} + +impl From> for Value { + fn from(value: Vec) -> Self { + Value::Array(value) + } +} + +impl From for ConcreteTemplateArg { + fn from(value: IBig) -> Self { + ConcreteTemplateArg::Value(Unifyable::Set(Value::Integer(value))) + } +} + +impl From for ConcreteTemplateArg { + fn from(value: bool) -> Self { + ConcreteTemplateArg::Value(Unifyable::Set(Value::Bool(value))) + } +} + +impl From> for ConcreteTemplateArg { + fn from(value: Vec) -> Self { + ConcreteTemplateArg::Value(Unifyable::Set(Value::Array(value))) + } +} diff --git a/std/core.sus b/std/core.sus index a17a3e91..595224b5 100644 --- a/std/core.sus +++ b/std/core.sus @@ -14,14 +14,20 @@ __builtin__ module CrossDomain #(T) { interface out_domain : -> T out'0 } -/// Convert an `int` to a 2s complement bit vector __builtin__ module IntToBits #(int NUM_BITS) { - interface IntToBits : int value'0 -> bool[NUM_BITS] bits'0 + interface IntToBits : int #(MIN: -pow2 #(E: NUM_BITS - 1), MAX: pow2 #(E: NUM_BITS - 1) - 1) value'0 -> bool[NUM_BITS] bits'0 } -/// Convert a 2s complement bit vector to an `int` __builtin__ module BitsToInt #(int NUM_BITS) { - interface BitsToInt : bool[NUM_BITS] bits'0 -> int value'0 + interface IntToBits : bool[NUM_BITS] bits'0 -> int #(MIN: -pow2 #(E: NUM_BITS - 1), MAX: pow2 #(E: NUM_BITS - 1) - 1) value'0 +} + +__builtin__ module UIntToBits #(int NUM_BITS) { + interface UIntToBits : int #(MIN: 0, MAX: pow2 #(E: NUM_BITS) - 1) value'0 -> bool[NUM_BITS] bits'0 +} + +__builtin__ module BitsToUInt #(int NUM_BITS) { + interface BitsToUInt : bool[NUM_BITS] bits'0 -> int #(MIN: 0, MAX: pow2 #(E: NUM_BITS) - 1) value'0 } // For now these builtin declarations must be in this order, because they're constants in the code. @@ -29,8 +35,8 @@ __builtin__ module BitsToInt #(int NUM_BITS) { /// The decider of truth and falsity __builtin__ struct bool {} -/// An integer of variable size. Right now it's not implemented yet, so this is just a 32-bit int. -__builtin__ struct int {} +// An integer of variable size. +__builtin__ struct int #(int MIN, int MAX) {} /// Single precision IEEE 32-bit float. Operators are definted externally, but it's defined here for convenience. __builtin__ struct float {} diff --git a/std/util.sus b/std/util.sus index d9051cb3..b1160d9f 100644 --- a/std/util.sus +++ b/std/util.sus @@ -1,19 +1,19 @@ -module DualPortMem #(T, int SIZE) { +module DualPortMem #(T, int MAX) { - state T[SIZE] mem + state T[MAX+1] mem domain write_clk - interface write : bool write'0, int addr'0, T data'0 + interface write : bool write'0, int#(MIN: 0, MAX) addr'0, T data'0 when write { mem[addr] = data } domain read_clk - interface read : int read_addr'0 -> T read_data'0 + interface read : int#(MIN: 0, MAX) read_addr'0 -> T read_data'0 - CrossDomain #(T: type T[SIZE]) cross_mem + CrossDomain #(T: type T[MAX+1]) cross_mem cross_mem.in = mem read_data = cross_mem.out[read_addr] @@ -26,8 +26,8 @@ module FIFO #( int READY_SLACK ) { state T[DEPTH] mem - state int read_addr - state int write_addr + state int#(MIN: 0, MAX: DEPTH - 1) read_addr + state int#(MIN: 0, MAX: DEPTH - 1) write_addr initial read_addr = 0 initial write_addr = 0 @@ -72,15 +72,18 @@ module FIFO #( module JoinDomains #(T1, T2, int OFFSET) { interface identity1 : T1 i1'0 -> T1 o1'0 interface identity2 : T2 i2'OFFSET -> T2 o2'OFFSET + + o1 = i1 + o2 = i2 } -module Iterator { +module Iterator #(int MAX) { // action - interface start : bool start, int up_to + interface start : bool start, int #(MIN: 0, MAX) up_to // trigger - interface iter : -> bool valid, state int value + interface iter : -> bool valid, state int #(MIN: 0, MAX) value - state int current_limit + state int #(MIN: 0, MAX) current_limit valid = value != current_limit @@ -88,12 +91,12 @@ module Iterator { current_limit = up_to value = 0 } else when valid { - value = value + 1 + value = (value + 1) % MAX } } -module FixedSizeIterator #(int UP_TO) { - interface iter : -> bool valid, state int value +module FixedSizeIterator #(int MAX) { + interface iter : -> bool valid, state int#(MIN: 0, MAX) value output bool last @@ -101,8 +104,8 @@ module FixedSizeIterator #(int UP_TO) { interface start : bool start - last = value == UP_TO - 1 - valid = value != UP_TO + last = value == MAX - 1 + valid = value != MAX when start { value = 0 @@ -136,8 +139,8 @@ module SplitAt #(T, int SIZE, int SPLIT_POINT) { } } -module Abs { - interface Abs : int a -> int o +module Abs #(int MAX) { + interface Abs : int #(MIN: -MAX, MAX) a -> int #(MIN: 0, MAX) o when a < 0 { o = -a @@ -169,7 +172,7 @@ module PopCount #(int WIDTH) { // Should be chosen based on what's most efficient for the target architecture gen int BASE_CASE_SIZE = 5 - interface PopCount : bool[WIDTH] bits -> int popcount + interface PopCount : bool[WIDTH] bits -> int#(MIN: 0, MAX: WIDTH) popcount if WIDTH <= BASE_CASE_SIZE { @@ -194,8 +197,8 @@ module PopCount #(int WIDTH) { // Recursive Tree Add module recurses smaller copies of itself. -module TreeAdd #(int WIDTH) { - interface TreeAdd : int[WIDTH] values'0 -> int total +module TreeAdd #(int WIDTH, int MIN, int MAX) { + interface TreeAdd : int#(MIN, MAX)[WIDTH] values'0 -> int#(MIN: MIN*WIDTH, MAX: MAX*WIDTH) total if WIDTH == 0 { // Have to explicitly give zero a latency count. diff --git a/sus-proc-macro/src/lib.rs b/sus-proc-macro/src/lib.rs index 3a4a5270..b3fc9741 100644 --- a/sus-proc-macro/src/lib.rs +++ b/sus-proc-macro/src/lib.rs @@ -124,3 +124,31 @@ pub fn get_builtin_const(token_stream: TokenStream) -> TokenStream { ) .into() } + +#[proc_macro] +pub fn __debug_breakpoint(_input: TokenStream) -> TokenStream { + let expanded = quote! { + if crate::debug::debugging_enabled() { + #[cfg(all(target_arch = "x86_64", target_os = "linux"))] + unsafe { + core::arch::asm!("int3"); + } + + #[cfg(all(target_arch = "x86_64", target_os = "windows"))] + unsafe { + core::arch::asm!("int3"); + } + + #[cfg(all(target_arch = "aarch64", target_os = "linux"))] + unsafe { + core::arch::asm!("brk #0"); + } + + #[cfg(all(target_arch = "aarch64", target_os = "windows"))] + unsafe { + core::arch::asm!("brk #0"); + } + } + }; + TokenStream::from(expanded) +} diff --git a/test.sus b/test.sus index ab6d0fcb..9d398dce 100644 --- a/test.sus +++ b/test.sus @@ -1,7 +1,7 @@ module example_md { - interface example_md : int[4] factors, - int add_to -> + interface example_md : int#(MIN: 0, MAX: 100)[4] factors, + int#(MIN: 0, MAX: 100) add_to -> int product, int total @@ -15,7 +15,7 @@ module example_md { // (a*b) + c module multiply_add { - interface multiply_add : int a, int b, int c -> int total + interface multiply_add : int#(MIN: 0, MAX: 100) a, int#(MIN: 0, MAX: 100) b, int#(MIN: 0, MAX: 100) c -> int total reg int tmp = a * b total = tmp + c @@ -27,7 +27,7 @@ module test_pow17 { } module pow17 { - interface pow17 : int i -> int o + interface pow17 : int#(MIN: 0, MAX: 100) i -> int o int i2 = i * i reg int i4 = i2 * i2 int i8 = i4 * i4 @@ -38,22 +38,22 @@ module pow17 { module fibonnaci { interface fibonnaci : -> int num - state int cur = 1 - state int prev = 0 + state int #(MIN: 0, MAX: 100) cur = 1 + state int #(MIN: 0, MAX: 100) prev = 0 - num = cur + prev + num = (cur + prev) % 100 prev = cur cur = num } module blur2 { - interface blur2 : int data, bool first -> int blurred + interface blur2 : int#(MIN: 0, MAX: 100) data, bool first -> int blurred state int prev when !first { - blurred = data + prev + blurred = (data + prev) % 100 } prev = data @@ -71,18 +71,18 @@ module blur2 { module Tree_Multiply { - interface Tree_Multiply : int[4] values -> int total + interface Tree_Multiply : int#(MIN: 0, MAX: 100)[4] values -> int total reg int a = values[0] * values[1] reg int b = values[2] * values[3] reg total = a * b } module Accumulator { - interface Accumulator : int term, bool done -> int total + interface Accumulator : int#(MIN: 0, MAX: 100) term, bool done -> int total state int tot initial tot = 0 - int new_tot = tot + term + int new_tot = (tot + term) % 100 when done { reg total = new_tot tot = 0 @@ -94,7 +94,7 @@ module Accumulator { //timeline (a, true -> /) | (a, false -> /) .. (a, false -> r)* .. (a, true -> r) module blur { - interface blur : int a, bool done -> int result + interface blur : int#(MIN: 0, MAX: 100) a, bool done -> int result state bool working initial working = false state int prev @@ -110,7 +110,7 @@ module blur { //timeline (X -> X) .. (/ -> X) .. (/ -> X) .. (/ -> X) module Unpack4 { - interface Unpack4 : int[4] packed -> int out_stream + interface Unpack4 : int#(MIN: 0, MAX: 100)[4] packed -> int out_stream gen int INITIAL = 0 gen int A = 1 @@ -139,7 +139,7 @@ module Unpack4 { } module generative { - interface generative : int i -> int o, int o2 + interface generative : int#(MIN: 0, MAX: 100) i -> int o, int o2 gen int x = 5 gen int[x] ys @@ -163,7 +163,7 @@ module generative { } module add_indices_to_array { - interface add_indices_to_array : int[10] values -> int[10] added_values + interface add_indices_to_array : int#(MIN: 0, MAX: 100)[10] values -> int[10] added_values for int i in 0..10 { int t = values[i] @@ -215,7 +215,7 @@ module first_bit_idx_6 { } module multiply_add_with_latencies { - interface multiply_add_with_latencies : int a'0, int b'0, int c'0 -> int r'0 + interface multiply_add_with_latencies : int#(MIN: 0, MAX: 100) a'0, int#(MIN: 0, MAX: 100) b'0, int#(MIN: 0, MAX: 100) c'0 -> int r'0 int tmp'1 = multiply(a, b) reg r = tmp + c } @@ -238,7 +238,7 @@ module first_bit_idx_24 { } module permute { - interface permute : bool[128] mbf, int selected_permutation -> bool[128] permuted_mbf + interface permute : bool[128] mbf, int#(MIN: 0, MAX: 100) selected_permutation -> bool[128] permuted_mbf // cvt_to_double permuted_mbf = mbf } @@ -270,18 +270,18 @@ module permute24 { module test_single_wire { - interface test_single_wire : int a -> int o + interface test_single_wire : int#(MIN: 0, MAX: 100) a -> int o o = a } module disjoint_ports { - interface disjoint_ports : int a, int b, int c -> int result + interface disjoint_ports : int#(MIN: 0, MAX: 100) a, int#(MIN: 0, MAX: 100) b, int#(MIN: 0, MAX: 100) c -> int result reg result = a + b // don't touch c } module undeteriminable_input_latency { - interface undeteriminable_input_latency : int a, int b -> int x, int y + interface undeteriminable_input_latency : int#(MIN: 0, MAX: 100) a, int#(MIN: 0, MAX: 100) b -> int x, int y reg int a_d = a int t = a_d + b reg reg reg int a_dd = a @@ -291,7 +291,7 @@ module undeteriminable_input_latency { } module specified_input_latency { - interface specified_input_latency : int a'0, int b'1 -> int x, int y + interface specified_input_latency : int#(MIN: 0, MAX: 100) a'0, int#(MIN: 0, MAX: 100) b'1 -> int x, int y reg int a_d = a int t = a_d + b reg reg reg int a_dd = a @@ -301,7 +301,7 @@ module specified_input_latency { } module determinable_input_latency { - interface determinable_input_latency : int a, int b -> int x, int y + interface determinable_input_latency : int#(MIN: 0, MAX: 100) a, int#(MIN: 0, MAX: 100) b -> int x, int y reg int a_d = a int t = a_d + b reg reg int a_dd = a @@ -312,7 +312,7 @@ module determinable_input_latency { // This module is a copy of ::undeteriminable_input_latency, but it doesn't have an error, because we just assume the latency of the inner nodes to be the earliest possible. module determinable_because_no_input_output_ports { - interface determinable_because_no_input_output_ports : int a -> int x + interface determinable_because_no_input_output_ports : int#(MIN: 0, MAX: 100) a -> int x reg int a_d = a int t = a_d reg reg reg int a_dd = a @@ -322,13 +322,13 @@ module determinable_because_no_input_output_ports { // This module is a copy of ::undeteriminable_input_latency, but it doesn't have an error, because we just assume the latency of the inner nodes to be the earliest possible. module conflicting_latency_declarations { - interface conflicting_latency_declarations : int a'0 -> int x'1 + interface conflicting_latency_declarations : int#(MIN: 0, MAX: 100) a'0 -> int x'1 reg int nio = a reg x = nio } module bad_cycle { - interface bad_cycle : int a -> int r + interface bad_cycle : int#(MIN: 0, MAX: 100) a -> int r state int state_reg initial state_reg = 0 @@ -338,13 +338,13 @@ module bad_cycle { } module module_taking_time { - interface module_taking_time : int i'0 -> int o'5 + interface module_taking_time : int#(MIN: 0, MAX: 100) i'0 -> int o'5 o = i } module matrix_vector_mul { interface matrix_vector_mul : - int[30][20] mat, int[20] vec -> int[30] result + int#(MIN: 0, MAX: 100)[30][20] mat, int#(MIN: 0, MAX: 100)[20] vec -> int[30] result for int row in 0..30 { int[20] row_products @@ -356,8 +356,8 @@ module matrix_vector_mul { } module bad_cycle2 { - interface bad_cycle2 : int a -> int r - state int test + interface bad_cycle2 : int#(MIN: 0, MAX: 100) a -> int r + state int#(MIN: 0, MAX: 7) test initial test = 0 test = module_taking_time(test+a) @@ -366,56 +366,56 @@ module bad_cycle2 { } module module_taking_a_lot_of_time { - interface module_taking_a_lot_of_time : int data_in'0 -> int data_out'200 + interface module_taking_a_lot_of_time : int#(MIN: 0, MAX: 100) data_in'0 -> int data_out'200 data_out = data_in } -/*extern*/ module offset_latency { - interface offset_latency : int i'0 -> int o'-5 +/*extern*/ module offset_latency #(T) { + interface offset_latency : T i'0 -> T o'-5 } module good_cycle { - interface good_cycle : int a -> int r - state int test - initial test = 0 + interface good_cycle : bool a -> bool r + state bool test + initial test = false - int new_test = test + a + bool new_test = test ^ a test = new_test r = new_test } module input_only { - interface input_only : int i - state int loop - initial loop = 0 - loop = loop + i + interface input_only : bool i + state bool loop + initial loop = false + loop = loop ^ i } module multiple_inputs_only { - interface multiple_inputs_only : int i, int i2 - state int loop - initial loop = 0 - loop = loop + i + i2 + interface multiple_inputs_only : bool i'0, bool i2'0 + state bool loop + initial loop = false + loop = loop ^ i ^ i2 } module output_only { - interface output_only : -> int o - state int loop - initial loop = 0 - loop = loop + 1 + interface output_only : -> bool o + state bool loop + initial loop = false + loop = !loop reg o = loop } module multiple_outputs_only { - interface multiple_outputs_only : -> int o, int o2 - state int loop - initial loop = 0 - loop = loop + 1 + interface multiple_outputs_only : -> bool o'0, bool o2'0 + state bool loop + initial loop = false + loop = !loop reg o = loop reg reg o2 = loop } @@ -423,7 +423,7 @@ module multiple_outputs_only { // Test submodule comment module submodule { - interface submodule : int a, int b -> int r + interface submodule : int#(MIN: 0, MAX: 100) a, int#(MIN: 0, MAX: 100) b -> int r r = a * b } @@ -439,7 +439,7 @@ comment */ module contains_submodule_submodule { - interface contains_submodule_submodule : int a, int b, int c -> int r + interface contains_submodule_submodule : int#(MIN: 0, MAX: 100) a, int#(MIN: 0, MAX: 100) b, int#(MIN: 0, MAX: 100) c -> int r // Temp val int tmp = submodule(a, b) doNothing() @@ -463,7 +463,7 @@ module use_xor { } module fizz_buzz { - interface fizz_buzz : int v -> int fb + interface fizz_buzz : int#(MIN: 0, MAX: 99) v -> int fb gen int FIZZ = 888 gen int BUZZ = 555 gen int FIZZ_BUZZ = 888555 @@ -482,12 +482,12 @@ module fizz_buzz { } } -module fizz_buzz_gen { - interface fizz_buzz_gen : int v -> int fb +module fizz_buzz_gen #(int TABLE_SIZE) { + interface fizz_buzz_gen : int#(MIN: 0, MAX: TABLE_SIZE) v -> int fb gen int FIZZ = 888 gen int BUZZ = 555 gen int FIZZ_BUZZ = 888555 - gen int TABLE_SIZE = 256 + gen int[TABLE_SIZE] lut @@ -560,7 +560,7 @@ module monotonize_down { } module my_mod { - interface my_mod : int i -> bool a, bool b + interface my_mod : int#(MIN: 0, MAX: 100) i -> bool a, bool b a = i == 3 b = i == 5 } @@ -574,14 +574,14 @@ module use_my_mod { // Main module documentation module submodule_named_ports { - interface submodule_named_ports : int port_a, int port_b -> int port_c + interface submodule_named_ports : int#(MIN: 0, MAX: 100) port_a, int#(MIN: 0, MAX: 100) port_b -> int port_c port_c = port_a + port_b } module use_submodule_named_ports { - interface use_submodule_named_ports : int i -> int o + interface use_submodule_named_ports : int#(MIN: 0, MAX: 100) i -> int o // Test submodule documentation submodule_named_ports sm @@ -595,7 +595,7 @@ module use_submodule_named_ports { } module contains_submodule_submodule { - interface contains_submodule_submodule : int a, int b, int c -> int r + interface contains_submodule_submodule : int#(MIN: 0, MAX: 100) a, int#(MIN: 0, MAX: 100) b, int#(MIN: 0, MAX: 100) c -> int r // Temp val int tmp = submodule(a, b) doNothing() @@ -610,7 +610,7 @@ module cross_bool { o = true } module cross_int { - interface in : int i'0 + interface in : int#(MIN: 0, MAX: 100) i'0 interface out : -> int o'0 o = 1 } @@ -629,9 +629,9 @@ module offset_backwards { module dual_port_mem { state bool[20][512] mem - interface write : bool write, bool[20] wr_data, int wr_addr + interface write : bool write, bool[20] wr_data, int#(MIN:0, MAX: 511) wr_addr - interface read : bool read, int rd_addr -> bool[20] rd_data + interface read : bool read, int#(MIN:0, MAX: 511) rd_addr -> bool[20] rd_data when write { mem[wr_addr] = wr_data @@ -656,18 +656,18 @@ module use_fifo { } module test_separated_domain { - interface test_separated_domain : int main - int domain2 + interface test_separated_domain : bool main + bool domain2 - int domain3 + bool domain3 - int domain4 + bool domain4 - cross_int ci + cross_bool ci ci.i = domain3 domain4 = ci.o - int domain5 + bool domain5 int #(MIN: 0, MAX: 199) my_int } @@ -683,7 +683,7 @@ module use_no_input_module { module mod_with_unused_interface { if false { - interface v : int a -> int b + interface v : int#(MIN: 0, MAX: 100) a -> int b } } @@ -720,7 +720,7 @@ module use_bad_interface { module sequenceDownFrom { //interface sequence : -> - interface start : bool start'0, int upTo'0 + interface start : bool start'0, int#(MIN: 0, MAX: 100) upTo'0 output bool ready'0 @@ -1038,7 +1038,7 @@ module UseDualPortMem { bool[500] data'0 -> bool[500] read_data'0 - DualPortMem #(SIZE: 128, T: type bool[500]) mem + DualPortMem #(MAX: 128, T: type bool[500]) mem mem.write(do_write, addr, data) @@ -1363,3 +1363,15 @@ module use_ranks { wire_v = wire_v + vv } + +module testInts { + + int[5] vs = [1, 2, 3, 4, 5] + +} + +module use_FIFO { + FIFO #(DEPTH: 53, READY_SLACK: 3) f + + f.push(true, 3) +} diff --git a/test.sus_errors.txt b/test.sus_errors.txt index f0c9f8a7..038bbe09 100644 --- a/test.sus_errors.txt +++ b/test.sus_errors.txt @@ -1,16 +1,15 @@ -Warning: Unused Variable: This variable does not affect the output ports of this module - ╭─[ util.sus:73:27 ] - │ - 73 │ interface identity1 : T1 i1'0 -> T1 o1'0 - │ ─┬ - │ ╰── Unused Variable: This variable does not affect the output ports of this module -────╯ -Warning: Unused Variable: This variable does not affect the output ports of this module - ╭─[ util.sus:74:27 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:26:2 ] │ - 74 │ interface identity2 : T2 i2'OFFSET -> T2 o2'OFFSET - │ ─┬ - │ ╰── Unused Variable: This variable does not affect the output ports of this module + 26 │ int a = pow17(2) + │ ──┬── + │ ╰──── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ────╯ Warning: Unused Variable: This variable does not affect the output ports of this module ╭─[ test.sus:26:6 ] @@ -19,6 +18,19 @@ Warning: Unused Variable: This variable does not affect the output ports of this │ ┬ │ ╰── Unused Variable: This variable does not affect the output ports of this module ────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:26:10 ] + │ + 26 │ int a = pow17(2) + │ ──┬── + │ ╰──── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +────╯ Warning: Unused Variable: This variable does not affect the output ports of this module ╭─[ test.sus:60:10 ] │ @@ -40,6 +52,71 @@ Warning: Unused Variable: This variable does not affect the output ports of this │ ─┬ │ ╰── Unused Variable: This variable does not affect the output ports of this module ────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:81:71 ] + │ + 81 │ interface Accumulator : int#(MIN: 0, MAX: 100) term, bool done -> int total + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:82:11 ] + │ + 82 │ state int tot + │ ───┬─── + │ ╰───── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:85:5 ] + │ + 85 │ int new_tot = (tot + term) % 100 + │ ─────┬───── + │ ╰─────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:85:19 ] + │ + 85 │ int new_tot = (tot + term) % 100 + │ ─────────┬──────── + │ ╰────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:85:20 ] + │ + 85 │ int new_tot = (tot + term) % 100 + │ ─────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +────╯ Warning: Unused Variable: This variable does not affect the output ports of this module ╭─[ test.sus:115:10 ] │ @@ -71,43 +148,52 @@ Warning: Unused Variable: This variable does not affect the output ports of this Error: 'i' is read-only ╭─[ test.sus:159:11 ] │ - 142 │ interface generative : int i -> int o, int o2 - │ ┬ - │ ╰── 'i' declared here + 142 │ interface generative : int#(MIN: 0, MAX: 100) i -> int o, int o2 + │ ┬ + │ ╰── 'i' declared here │ 159 │ if test {i = 5} │ ┬ │ ╰── 'i' is read-only ─────╯ -Error: This port is not strongly connected to the strongly connected port cluster 'v'. -An input and output port are strongly connected if there is a direct dependency path from the input port to the output port. -Strongly connected ports are also transitive. -If you do not wish to change your design, then 'virtually' connect this port to the strongly connected cluster by explicitly annotating its absolute latency. - ╭─[ test.sus:175:53 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:175:40 ] │ 175 │ interface assignment_producer : -> int v'0, int o'0, bool j'0 } - │ ┬ ┬ - │ ╰─────────── 'v' declared here - │ │ - │ ╰── This port is not strongly connected to the strongly connected port cluster 'v'. -An input and output port are strongly connected if there is a direct dependency path from the input port to the output port. -Strongly connected ports are also transitive. -If you do not wish to change your design, then 'virtually' connect this port to the strongly connected cluster by explicitly annotating its absolute latency. + │ ───┬─── + │ ╰───── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ─────╯ -Error: This port is not strongly connected to the strongly connected port cluster 'v'. -An input and output port are strongly connected if there is a direct dependency path from the input port to the output port. -Strongly connected ports are also transitive. -If you do not wish to change your design, then 'virtually' connect this port to the strongly connected cluster by explicitly annotating its absolute latency. - ╭─[ test.sus:175:63 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:175:49 ] │ 175 │ interface assignment_producer : -> int v'0, int o'0, bool j'0 } - │ ┬ ┬ - │ ╰───────────────────── 'v' declared here - │ │ - │ ╰── This port is not strongly connected to the strongly connected port cluster 'v'. -An input and output port are strongly connected if there is a direct dependency path from the input port to the output port. -Strongly connected ports are also transitive. -If you do not wish to change your design, then 'virtually' connect this port to the strongly connected cluster by explicitly annotating its absolute latency. + │ ───┬─── + │ ╰───── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[3] + ╭─[ test.sus:178:8 ] + │ + 178 │ state int[3] st + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[3] ─────╯ Warning: Unused Variable: This variable does not affect the output ports of this module ╭─[ test.sus:178:15 ] @@ -123,6 +209,19 @@ Warning: Unused Variable: This variable does not affect the output ports of this │ ┬ │ ╰── Unused Variable: This variable does not affect the output ports of this module ─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:180:6 ] + │ + 180 │ reg int a, st[2], reg reg b = assignment_producer() + │ ──┬── + │ ╰──── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ Warning: Unused Variable: This variable does not affect the output ports of this module ╭─[ test.sus:180:10 ] │ @@ -130,6 +229,32 @@ Warning: Unused Variable: This variable does not affect the output ports of this │ ┬ │ ╰── Unused Variable: This variable does not affect the output ports of this module ─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:180:32 ] + │ + 180 │ reg int a, st[2], reg reg b = assignment_producer() + │ ─────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:180:32 ] + │ + 180 │ reg int a, st[2], reg reg b = assignment_producer() + │ ─────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ Error: Error instantiating submodule ╭─[ test.sus:180:32 ] │ @@ -138,18 +263,18 @@ Error: Error instantiating submodule │ ╰─────────── Error instantiating submodule ─────╯ Warning: Unused Variable: This variable does not affect the output ports of this module - ╭─[ test.sus:218:49 ] + ╭─[ test.sus:218:68 ] │ - 218 │ interface multiply_add_with_latencies : int a'0, int b'0, int c'0 -> int r'0 - │ ┬ - │ ╰── Unused Variable: This variable does not affect the output ports of this module + 218 │ interface multiply_add_with_latencies : int#(MIN: 0, MAX: 100) a'0, int#(MIN: 0, MAX: 100) b'0, int#(MIN: 0, MAX: 100) c'0 -> int r'0 + │ ┬ + │ ╰── Unused Variable: This variable does not affect the output ports of this module ─────╯ Warning: Unused Variable: This variable does not affect the output ports of this module - ╭─[ test.sus:218:58 ] + ╭─[ test.sus:218:96 ] │ - 218 │ interface multiply_add_with_latencies : int a'0, int b'0, int c'0 -> int r'0 - │ ┬ - │ ╰── Unused Variable: This variable does not affect the output ports of this module + 218 │ interface multiply_add_with_latencies : int#(MIN: 0, MAX: 100) a'0, int#(MIN: 0, MAX: 100) b'0, int#(MIN: 0, MAX: 100) c'0 -> int r'0 + │ ┬ + │ ╰── Unused Variable: This variable does not affect the output ports of this module ─────╯ Error: No Global of the name 'multiply' was found. Did you forget to import it? ╭─[ test.sus:219:17 ] @@ -165,6 +290,19 @@ Warning: Unused Variable: This variable does not affect the output ports of this │ ──┬─ │ ╰─── Unused Variable: This variable does not affect the output ports of this module ─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:224:51 ] + │ + 224 │ interface first_bit_idx_24 : bool[24] bits -> int first + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ Error: Pre-emptive error because latency-unspecified 'first' is never written to. (This is because work-in-progress code would get a lot of latency counting errors while unfinished) ╭─[ test.sus:224:55 ] @@ -174,6 +312,19 @@ Error: Pre-emptive error because latency-unspecified 'first' is never written to │ ╰──── Pre-emptive error because latency-unspecified 'first' is never written to. (This is because work-in-progress code would get a lot of latency counting errors while unfinished) ─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[4] + ╭─[ test.sus:225:2 ] + │ + 225 │ int[4] offsets + │ ───────┬────── + │ ╰──────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[4] +─────╯ Warning: Unused Variable: This variable does not affect the output ports of this module ╭─[ test.sus:225:9 ] │ @@ -209,6 +360,58 @@ Warning: Unused Variable: This variable does not affect the output ports of this │ ┬ │ ╰── Unused Variable: This variable does not affect the output ports of this module ─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:234:3 ] + │ + 234 │ int offset, bool was_nonzero = first_bit_idx_6(these_bits) + │ ─────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:234:3 ] + │ + 234 │ int offset, bool was_nonzero = first_bit_idx_6(these_bits) + │ ─────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:234:3 ] + │ + 234 │ int offset, bool was_nonzero = first_bit_idx_6(these_bits) + │ ─────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:234:3 ] + │ + 234 │ int offset, bool was_nonzero = first_bit_idx_6(these_bits) + │ ─────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ Warning: Unused Variable: This variable does not affect the output ports of this module ╭─[ test.sus:234:7 ] │ @@ -223,39 +426,91 @@ Warning: Unused Variable: This variable does not affect the output ports of this │ ─────┬───── │ ╰─────── Unused Variable: This variable does not affect the output ports of this module ─────╯ -Warning: Unused Variable: This variable does not affect the output ports of this module - ╭─[ test.sus:241:44 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:234:34 ] + │ + 234 │ int offset, bool was_nonzero = first_bit_idx_6(these_bits) + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:234:34 ] + │ + 234 │ int offset, bool was_nonzero = first_bit_idx_6(these_bits) + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:234:34 ] + │ + 234 │ int offset, bool was_nonzero = first_bit_idx_6(these_bits) + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:234:34 ] │ - 241 │ interface permute : bool[128] mbf, int selected_permutation -> bool[128] permuted_mbf - │ ──────────┬───────── - │ ╰─────────── Unused Variable: This variable does not affect the output ports of this module + 234 │ int offset, bool was_nonzero = first_bit_idx_6(these_bits) + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ─────╯ Error: This port is not strongly connected to the strongly connected port cluster 'mbf'. An input and output port are strongly connected if there is a direct dependency path from the input port to the output port. Strongly connected ports are also transitive. If you do not wish to change your design, then 'virtually' connect this port to the strongly connected cluster by explicitly annotating its absolute latency. - ╭─[ test.sus:241:44 ] + ╭─[ test.sus:241:63 ] │ - 241 │ interface permute : bool[128] mbf, int selected_permutation -> bool[128] permuted_mbf - │ ─┬─ ──────────┬───────── - │ ╰───────────────────────────── 'mbf' declared here - │ │ - │ ╰─────────── This port is not strongly connected to the strongly connected port cluster 'mbf'. + 241 │ interface permute : bool[128] mbf, int#(MIN: 0, MAX: 100) selected_permutation -> bool[128] permuted_mbf + │ ─┬─ ──────────┬───────── + │ ╰──────────────────────────────────────────────── 'mbf' declared here + │ │ + │ ╰─────────── This port is not strongly connected to the strongly connected port cluster 'mbf'. An input and output port are strongly connected if there is a direct dependency path from the input port to the output port. Strongly connected ports are also transitive. If you do not wish to change your design, then 'virtually' connect this port to the strongly connected cluster by explicitly annotating its absolute latency. ─────╯ +Warning: Unused Variable: This variable does not affect the output ports of this module + ╭─[ test.sus:241:63 ] + │ + 241 │ interface permute : bool[128] mbf, int#(MIN: 0, MAX: 100) selected_permutation -> bool[128] permuted_mbf + │ ──────────┬───────── + │ ╰─────────── Unused Variable: This variable does not affect the output ports of this module +─────╯ Error: This port is not strongly connected to the strongly connected port cluster 'mbf'. An input and output port are strongly connected if there is a direct dependency path from the input port to the output port. Strongly connected ports are also transitive. If you do not wish to change your design, then 'virtually' connect this port to the strongly connected cluster by explicitly annotating its absolute latency. - ╭─[ test.sus:241:78 ] + ╭─[ test.sus:241:97 ] │ - 241 │ interface permute : bool[128] mbf, int selected_permutation -> bool[128] permuted_mbf - │ ─┬─ ──────┬───── - │ ╰─────────────────────────────────────────────────────── 'mbf' declared here - │ │ - │ ╰─────── This port is not strongly connected to the strongly connected port cluster 'mbf'. + 241 │ interface permute : bool[128] mbf, int#(MIN: 0, MAX: 100) selected_permutation -> bool[128] permuted_mbf + │ ─┬─ ──────┬───── + │ ╰────────────────────────────────────────────────────────────────────────── 'mbf' declared here + │ │ + │ ╰─────── This port is not strongly connected to the strongly connected port cluster 'mbf'. An input and output port are strongly connected if there is a direct dependency path from the input port to the output port. Strongly connected ports are also transitive. If you do not wish to change your design, then 'virtually' connect this port to the strongly connected cluster by explicitly annotating its absolute latency. @@ -281,12 +536,12 @@ Warning: Unused Variable: This variable does not affect the output ports of this │ ──┬── │ ╰──── Unused Variable: This variable does not affect the output ports of this module ─────╯ -Error: Typing Error: variable reference expects a ::bool[] but was given a ::int - ╭─[ test.sus:250:2 ] +Error: Typing Error: Constant expects a int but was given a bool[] + ╭─[ test.sus:250:41 ] │ 250 │ state bool[24] stored_valid_permutes = 000000000000000000000000 - │ ──────────────────┬───────────────── - │ ╰─────────────────── Typing Error: variable reference expects a ::bool[] but was given a ::int + │ ────────────┬─────────── + │ ╰───────────── Typing Error: Constant expects a int but was given a bool[] ─────╯ Warning: Unused Variable: This variable does not affect the output ports of this module ╭─[ test.sus:252:10 ] @@ -295,6 +550,20 @@ Warning: Unused Variable: This variable does not affect the output ports of this │ ──┬── │ ╰──── Unused Variable: This variable does not affect the output ports of this module ─────╯ +Error: Could not fully figure out the type of this object. type_variable_30[...peano_variable_38] + ╭─[ test.sus:267:2 ] + │ + 267 │ aaaaa() + │ ───┬─── + │ ╰───── Could not fully figure out the type of this object. type_variable_30[...peano_variable_38] +─────╯ +Error: Could not fully figure out the type of this object. type_variable_30[...peano_variable_38] + ╭─[ test.sus:267:2 ] + │ + 267 │ aaaaa() + │ ───┬─── + │ ╰───── Could not fully figure out the type of this object. type_variable_30[...peano_variable_38] +─────╯ Error: Function call syntax is only possible on modules or interfaces of modules ╭─[ test.sus:267:2 ] │ @@ -302,54 +571,61 @@ Error: Function call syntax is only possible on modules or interfaces of modules │ ──┬── │ ╰──── Function call syntax is only possible on modules or interfaces of modules ─────╯ -Warning: Unused Variable: This variable does not affect the output ports of this module - ╭─[ test.sus:278:50 ] +Warning: The result of this expression is not used. Only function calls can return nothing. + ╭─[ test.sus:267:2 ] │ - 278 │ interface disjoint_ports : int a, int b, int c -> int result - │ ┬ - │ ╰── Unused Variable: This variable does not affect the output ports of this module + 267 │ aaaaa() + │ ───┬─── + │ ╰───── The result of this expression is not used. Only function calls can return nothing. ─────╯ Error: This port is not strongly connected to the strongly connected port cluster 'a', 'b'. An input and output port are strongly connected if there is a direct dependency path from the input port to the output port. Strongly connected ports are also transitive. If you do not wish to change your design, then 'virtually' connect this port to the strongly connected cluster by explicitly annotating its absolute latency. - ╭─[ test.sus:278:50 ] - │ - 278 │ interface disjoint_ports : int a, int b, int c -> int result - │ ┬ ┬ ┬ - │ ╰──────────────── 'a' declared here - │ │ │ - │ ╰───────── 'b' declared here - │ │ - │ ╰── This port is not strongly connected to the strongly connected port cluster 'a', 'b'. + ╭─[ test.sus:278:107 ] + │ + 278 │ interface disjoint_ports : int#(MIN: 0, MAX: 100) a, int#(MIN: 0, MAX: 100) b, int#(MIN: 0, MAX: 100) c -> int result + │ ┬ ┬ ┬ + │ ╰────────────────────────────────────────────────────── 'a' declared here + │ │ │ + │ ╰──────────────────────────── 'b' declared here + │ │ + │ ╰── This port is not strongly connected to the strongly connected port cluster 'a', 'b'. An input and output port are strongly connected if there is a direct dependency path from the input port to the output port. Strongly connected ports are also transitive. If you do not wish to change your design, then 'virtually' connect this port to the strongly connected cluster by explicitly annotating its absolute latency. ─────╯ +Warning: Unused Variable: This variable does not affect the output ports of this module + ╭─[ test.sus:278:107 ] + │ + 278 │ interface disjoint_ports : int#(MIN: 0, MAX: 100) a, int#(MIN: 0, MAX: 100) b, int#(MIN: 0, MAX: 100) c -> int result + │ ┬ + │ ╰── Unused Variable: This variable does not affect the output ports of this module +─────╯ Error: This port is not strongly connected to the strongly connected port cluster 'a', 'b'. An input and output port are strongly connected if there is a direct dependency path from the input port to the output port. Strongly connected ports are also transitive. If you do not wish to change your design, then 'virtually' connect this port to the strongly connected cluster by explicitly annotating its absolute latency. - ╭─[ test.sus:278:59 ] - │ - 278 │ interface disjoint_ports : int a, int b, int c -> int result - │ ┬ ┬ ───┬── - │ ╰────────────────────────────── 'a' declared here - │ │ │ - │ ╰─────────────────────── 'b' declared here - │ │ - │ ╰──── This port is not strongly connected to the strongly connected port cluster 'a', 'b'. + ╭─[ test.sus:278:116 ] + │ + 278 │ interface disjoint_ports : int#(MIN: 0, MAX: 100) a, int#(MIN: 0, MAX: 100) b, int#(MIN: 0, MAX: 100) c -> int result + │ ┬ ┬ ───┬── + │ ╰──────────────────────────────────────────────────────────────────── 'a' declared here + │ │ │ + │ ╰────────────────────────────────────────── 'b' declared here + │ │ + │ ╰──── This port is not strongly connected to the strongly connected port cluster 'a', 'b'. An input and output port are strongly connected if there is a direct dependency path from the input port to the output port. Strongly connected ports are also transitive. If you do not wish to change your design, then 'virtually' connect this port to the strongly connected cluster by explicitly annotating its absolute latency. ─────╯ Error: Cannot determine port latency. Options are 0 and -1 Try specifying an explicit latency or rework the module to remove this ambiguity - ╭─[ test.sus:284:74 ] + ╭─[ test.sus:284:112 ] │ - 284 │ interface undeteriminable_input_latency : int a, int b -> int x, int y - │ ┬ - │ ╰── Cannot determine port latency. Options are 0 and -1 + 284 │ interface undeteriminable_input_latency : int#(MIN: 0, MAX: 100) a, int#(MIN: 0, MAX: 100) b -> int x, int y + │ ┬ + │ ╰── Cannot determine port latency. Options are 0 and -1 Try specifying an explicit latency or rework the module to remove this ambiguity ─────╯ Error: Conflicting specified latency @@ -359,13 +635,13 @@ a'0 -> x'2 (+1) But this was specified as x'1 - ╭─[ test.sus:325:67 ] + ╭─[ test.sus:325:86 ] │ - 325 │ interface conflicting_latency_declarations : int a'0 -> int x'1 - │ ┬ ┬ - │ ╰─────────────── 'a' declared here - │ │ - │ ╰── Conflicting specified latency + 325 │ interface conflicting_latency_declarations : int#(MIN: 0, MAX: 100) a'0 -> int x'1 + │ ┬ ┬ + │ ╰─────────────── 'a' declared here + │ │ + │ ╰── Conflicting specified latency a'0 -> nio'1 (+1) @@ -373,6 +649,32 @@ a'0 But this was specified as x'1 ─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:331:55 ] + │ + 331 │ interface bad_cycle : int#(MIN: 0, MAX: 100) a -> int r + │ ──┬── + │ ╰──── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:332:8 ] + │ + 332 │ state int state_reg + │ ──────┬────── + │ ╰──────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ Error: This instruction is part of a net-positive latency cycle of +1 state_reg'1 @@ -390,1405 +692,1418 @@ state_reg'1 Which conflicts with the starting latency ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 20. +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:337:18 ] + │ + 337 │ reg state_reg = state_reg + a + │ ──────┬────── + │ ╰──────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Out of bounds! The array is of size 20, but the index has bounds 20..20 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 20. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 20..20 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 20. +Error: Out of bounds! The array is of size 20, but the index has bounds 20..20 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 20. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 20..20 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 20. +Error: Out of bounds! The array is of size 20, but the index has bounds 20..20 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 20. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 20..20 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 20. +Error: Out of bounds! The array is of size 20, but the index has bounds 20..20 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 20. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 20..20 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 20. +Error: Out of bounds! The array is of size 20, but the index has bounds 20..20 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 20. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 20..20 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 20. +Error: Out of bounds! The array is of size 20, but the index has bounds 20..20 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 20. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 20..20 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 20. +Error: Out of bounds! The array is of size 20, but the index has bounds 20..20 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 20. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 20..20 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 20. +Error: Out of bounds! The array is of size 20, but the index has bounds 20..20 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 20. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 20..20 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 20. +Error: Out of bounds! The array is of size 20, but the index has bounds 20..20 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 20. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 20..20 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 20. +Error: Out of bounds! The array is of size 20, but the index has bounds 20..20 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 20. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 20..20 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 20. +Error: Out of bounds! The array is of size 20, but the index has bounds 20..20 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 20. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 20..20 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 20. +Error: Out of bounds! The array is of size 20, but the index has bounds 20..20 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 20. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 20..20 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 20. +Error: Out of bounds! The array is of size 20, but the index has bounds 20..20 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 20. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 20..20 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 20. +Error: Out of bounds! The array is of size 20, but the index has bounds 20..20 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 20. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 20..20 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 20. +Error: Out of bounds! The array is of size 20, but the index has bounds 20..20 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 20. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 20..20 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 20. +Error: Out of bounds! The array is of size 20, but the index has bounds 20..20 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 20. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 20..20 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 20. +Error: Out of bounds! The array is of size 20, but the index has bounds 20..20 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 20. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 20..20 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 20. +Error: Out of bounds! The array is of size 20, but the index has bounds 20..20 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 20. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 20..20 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 20. +Error: Out of bounds! The array is of size 20, but the index has bounds 20..20 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 20. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 20..20 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 20. +Error: Out of bounds! The array is of size 20, but the index has bounds 20..20 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 20. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 20..20 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 21. +Error: Out of bounds! The array is of size 20, but the index has bounds 21..21 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 21. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 21..21 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 21. +Error: Out of bounds! The array is of size 20, but the index has bounds 21..21 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 21. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 21..21 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 21. +Error: Out of bounds! The array is of size 20, but the index has bounds 21..21 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 21. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 21..21 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 21. +Error: Out of bounds! The array is of size 20, but the index has bounds 21..21 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 21. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 21..21 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 21. +Error: Out of bounds! The array is of size 20, but the index has bounds 21..21 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 21. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 21..21 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 21. +Error: Out of bounds! The array is of size 20, but the index has bounds 21..21 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 21. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 21..21 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 21. +Error: Out of bounds! The array is of size 20, but the index has bounds 21..21 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 21. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 21..21 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 21. +Error: Out of bounds! The array is of size 20, but the index has bounds 21..21 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 21. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 21..21 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 21. +Error: Out of bounds! The array is of size 20, but the index has bounds 21..21 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 21. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 21..21 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 21. +Error: Out of bounds! The array is of size 20, but the index has bounds 21..21 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 21. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 21..21 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 21. +Error: Out of bounds! The array is of size 20, but the index has bounds 21..21 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 21. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 21..21 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 21. +Error: Out of bounds! The array is of size 20, but the index has bounds 21..21 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 21. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 21..21 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 21. +Error: Out of bounds! The array is of size 20, but the index has bounds 21..21 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 21. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 21..21 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 21. +Error: Out of bounds! The array is of size 20, but the index has bounds 21..21 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 21. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 21..21 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 21. +Error: Out of bounds! The array is of size 20, but the index has bounds 21..21 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 21. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 21..21 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 21. +Error: Out of bounds! The array is of size 20, but the index has bounds 21..21 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 21. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 21..21 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 21. +Error: Out of bounds! The array is of size 20, but the index has bounds 21..21 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 21. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 21..21 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 21. +Error: Out of bounds! The array is of size 20, but the index has bounds 21..21 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 21. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 21..21 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 21. +Error: Out of bounds! The array is of size 20, but the index has bounds 21..21 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 21. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 21..21 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 21. +Error: Out of bounds! The array is of size 20, but the index has bounds 21..21 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 21. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 21..21 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 22. +Error: Out of bounds! The array is of size 20, but the index has bounds 22..22 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 22. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 22..22 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 22. +Error: Out of bounds! The array is of size 20, but the index has bounds 22..22 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 22. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 22..22 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 22. +Error: Out of bounds! The array is of size 20, but the index has bounds 22..22 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 22. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 22..22 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 22. +Error: Out of bounds! The array is of size 20, but the index has bounds 22..22 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 22. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 22..22 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 22. +Error: Out of bounds! The array is of size 20, but the index has bounds 22..22 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 22. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 22..22 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 22. +Error: Out of bounds! The array is of size 20, but the index has bounds 22..22 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 22. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 22..22 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 22. +Error: Out of bounds! The array is of size 20, but the index has bounds 22..22 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 22. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 22..22 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 22. +Error: Out of bounds! The array is of size 20, but the index has bounds 22..22 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 22. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 22..22 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 22. +Error: Out of bounds! The array is of size 20, but the index has bounds 22..22 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 22. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 22..22 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 22. +Error: Out of bounds! The array is of size 20, but the index has bounds 22..22 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 22. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 22..22 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 22. +Error: Out of bounds! The array is of size 20, but the index has bounds 22..22 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 22. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 22..22 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 22. +Error: Out of bounds! The array is of size 20, but the index has bounds 22..22 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 22. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 22..22 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 22. +Error: Out of bounds! The array is of size 20, but the index has bounds 22..22 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 22. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 22..22 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 22. +Error: Out of bounds! The array is of size 20, but the index has bounds 22..22 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 22. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 22..22 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 22. +Error: Out of bounds! The array is of size 20, but the index has bounds 22..22 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 22. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 22..22 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 22. +Error: Out of bounds! The array is of size 20, but the index has bounds 22..22 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 22. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 22..22 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 22. +Error: Out of bounds! The array is of size 20, but the index has bounds 22..22 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 22. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 22..22 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 22. +Error: Out of bounds! The array is of size 20, but the index has bounds 22..22 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 22. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 22..22 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 22. +Error: Out of bounds! The array is of size 20, but the index has bounds 22..22 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 22. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 22..22 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 22. +Error: Out of bounds! The array is of size 20, but the index has bounds 22..22 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 22. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 22..22 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 23. +Error: Out of bounds! The array is of size 20, but the index has bounds 23..23 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 23. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 23..23 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 23. +Error: Out of bounds! The array is of size 20, but the index has bounds 23..23 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 23. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 23..23 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 23. +Error: Out of bounds! The array is of size 20, but the index has bounds 23..23 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 23. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 23..23 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 23. +Error: Out of bounds! The array is of size 20, but the index has bounds 23..23 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 23. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 23..23 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 23. +Error: Out of bounds! The array is of size 20, but the index has bounds 23..23 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 23. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 23..23 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 23. +Error: Out of bounds! The array is of size 20, but the index has bounds 23..23 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 23. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 23..23 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 23. +Error: Out of bounds! The array is of size 20, but the index has bounds 23..23 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 23. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 23..23 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 23. +Error: Out of bounds! The array is of size 20, but the index has bounds 23..23 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 23. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 23..23 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 23. +Error: Out of bounds! The array is of size 20, but the index has bounds 23..23 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 23. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 23..23 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 23. +Error: Out of bounds! The array is of size 20, but the index has bounds 23..23 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 23. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 23..23 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 23. +Error: Out of bounds! The array is of size 20, but the index has bounds 23..23 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 23. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 23..23 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 23. +Error: Out of bounds! The array is of size 20, but the index has bounds 23..23 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 23. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 23..23 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 23. +Error: Out of bounds! The array is of size 20, but the index has bounds 23..23 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 23. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 23..23 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 23. +Error: Out of bounds! The array is of size 20, but the index has bounds 23..23 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 23. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 23..23 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 23. +Error: Out of bounds! The array is of size 20, but the index has bounds 23..23 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 23. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 23..23 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 23. +Error: Out of bounds! The array is of size 20, but the index has bounds 23..23 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 23. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 23..23 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 23. +Error: Out of bounds! The array is of size 20, but the index has bounds 23..23 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 23. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 23..23 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 23. +Error: Out of bounds! The array is of size 20, but the index has bounds 23..23 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 23. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 23..23 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 23. +Error: Out of bounds! The array is of size 20, but the index has bounds 23..23 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 23. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 23..23 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 23. +Error: Out of bounds! The array is of size 20, but the index has bounds 23..23 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 23. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 23..23 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 24. +Error: Out of bounds! The array is of size 20, but the index has bounds 24..24 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 24. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 24..24 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 24. +Error: Out of bounds! The array is of size 20, but the index has bounds 24..24 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 24. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 24..24 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 24. +Error: Out of bounds! The array is of size 20, but the index has bounds 24..24 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 24. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 24..24 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 24. +Error: Out of bounds! The array is of size 20, but the index has bounds 24..24 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 24. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 24..24 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 24. +Error: Out of bounds! The array is of size 20, but the index has bounds 24..24 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 24. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 24..24 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 24. +Error: Out of bounds! The array is of size 20, but the index has bounds 24..24 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 24. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 24..24 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 24. +Error: Out of bounds! The array is of size 20, but the index has bounds 24..24 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 24. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 24..24 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 24. +Error: Out of bounds! The array is of size 20, but the index has bounds 24..24 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 24. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 24..24 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 24. +Error: Out of bounds! The array is of size 20, but the index has bounds 24..24 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 24. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 24..24 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 24. +Error: Out of bounds! The array is of size 20, but the index has bounds 24..24 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 24. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 24..24 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 24. +Error: Out of bounds! The array is of size 20, but the index has bounds 24..24 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 24. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 24..24 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 24. +Error: Out of bounds! The array is of size 20, but the index has bounds 24..24 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 24. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 24..24 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 24. +Error: Out of bounds! The array is of size 20, but the index has bounds 24..24 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 24. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 24..24 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 24. +Error: Out of bounds! The array is of size 20, but the index has bounds 24..24 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 24. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 24..24 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 24. +Error: Out of bounds! The array is of size 20, but the index has bounds 24..24 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 24. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 24..24 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 24. +Error: Out of bounds! The array is of size 20, but the index has bounds 24..24 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 24. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 24..24 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 24. +Error: Out of bounds! The array is of size 20, but the index has bounds 24..24 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 24. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 24..24 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 24. +Error: Out of bounds! The array is of size 20, but the index has bounds 24..24 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 24. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 24..24 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 24. +Error: Out of bounds! The array is of size 20, but the index has bounds 24..24 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 24. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 24..24 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 24. +Error: Out of bounds! The array is of size 20, but the index has bounds 24..24 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 24. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 24..24 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 25. +Error: Out of bounds! The array is of size 20, but the index has bounds 25..25 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 25. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 25..25 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 25. +Error: Out of bounds! The array is of size 20, but the index has bounds 25..25 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 25. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 25..25 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 25. +Error: Out of bounds! The array is of size 20, but the index has bounds 25..25 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 25. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 25..25 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 25. +Error: Out of bounds! The array is of size 20, but the index has bounds 25..25 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 25. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 25..25 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 25. +Error: Out of bounds! The array is of size 20, but the index has bounds 25..25 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 25. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 25..25 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 25. +Error: Out of bounds! The array is of size 20, but the index has bounds 25..25 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 25. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 25..25 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 25. +Error: Out of bounds! The array is of size 20, but the index has bounds 25..25 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 25. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 25..25 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 25. +Error: Out of bounds! The array is of size 20, but the index has bounds 25..25 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 25. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 25..25 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 25. +Error: Out of bounds! The array is of size 20, but the index has bounds 25..25 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 25. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 25..25 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 25. +Error: Out of bounds! The array is of size 20, but the index has bounds 25..25 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 25. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 25..25 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 25. +Error: Out of bounds! The array is of size 20, but the index has bounds 25..25 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 25. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 25..25 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 25. +Error: Out of bounds! The array is of size 20, but the index has bounds 25..25 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 25. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 25..25 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 25. +Error: Out of bounds! The array is of size 20, but the index has bounds 25..25 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 25. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 25..25 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 25. +Error: Out of bounds! The array is of size 20, but the index has bounds 25..25 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 25. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 25..25 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 25. +Error: Out of bounds! The array is of size 20, but the index has bounds 25..25 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 25. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 25..25 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 25. +Error: Out of bounds! The array is of size 20, but the index has bounds 25..25 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 25. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 25..25 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 25. +Error: Out of bounds! The array is of size 20, but the index has bounds 25..25 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 25. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 25..25 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 25. +Error: Out of bounds! The array is of size 20, but the index has bounds 25..25 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 25. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 25..25 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 25. +Error: Out of bounds! The array is of size 20, but the index has bounds 25..25 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 25. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 25..25 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 25. +Error: Out of bounds! The array is of size 20, but the index has bounds 25..25 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 25. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 25..25 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 26. +Error: Out of bounds! The array is of size 20, but the index has bounds 26..26 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 26. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 26..26 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 26. +Error: Out of bounds! The array is of size 20, but the index has bounds 26..26 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 26. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 26..26 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 26. +Error: Out of bounds! The array is of size 20, but the index has bounds 26..26 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 26. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 26..26 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 26. +Error: Out of bounds! The array is of size 20, but the index has bounds 26..26 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 26. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 26..26 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 26. +Error: Out of bounds! The array is of size 20, but the index has bounds 26..26 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 26. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 26..26 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 26. +Error: Out of bounds! The array is of size 20, but the index has bounds 26..26 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 26. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 26..26 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 26. +Error: Out of bounds! The array is of size 20, but the index has bounds 26..26 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 26. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 26..26 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 26. +Error: Out of bounds! The array is of size 20, but the index has bounds 26..26 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 26. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 26..26 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 26. +Error: Out of bounds! The array is of size 20, but the index has bounds 26..26 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 26. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 26..26 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 26. +Error: Out of bounds! The array is of size 20, but the index has bounds 26..26 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 26. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 26..26 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 26. +Error: Out of bounds! The array is of size 20, but the index has bounds 26..26 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 26. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 26..26 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 26. +Error: Out of bounds! The array is of size 20, but the index has bounds 26..26 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 26. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 26..26 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 26. +Error: Out of bounds! The array is of size 20, but the index has bounds 26..26 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 26. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 26..26 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 26. +Error: Out of bounds! The array is of size 20, but the index has bounds 26..26 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 26. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 26..26 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 26. +Error: Out of bounds! The array is of size 20, but the index has bounds 26..26 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 26. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 26..26 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 26. +Error: Out of bounds! The array is of size 20, but the index has bounds 26..26 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 26. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 26..26 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 26. +Error: Out of bounds! The array is of size 20, but the index has bounds 26..26 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 26. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 26..26 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 26. +Error: Out of bounds! The array is of size 20, but the index has bounds 26..26 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 26. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 26..26 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 26. +Error: Out of bounds! The array is of size 20, but the index has bounds 26..26 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 26. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 26..26 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 26. +Error: Out of bounds! The array is of size 20, but the index has bounds 26..26 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 26. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 26..26 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 27. +Error: Out of bounds! The array is of size 20, but the index has bounds 27..27 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 27. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 27..27 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 27. +Error: Out of bounds! The array is of size 20, but the index has bounds 27..27 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 27. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 27..27 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 27. +Error: Out of bounds! The array is of size 20, but the index has bounds 27..27 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 27. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 27..27 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 27. +Error: Out of bounds! The array is of size 20, but the index has bounds 27..27 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 27. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 27..27 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 27. +Error: Out of bounds! The array is of size 20, but the index has bounds 27..27 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 27. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 27..27 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 27. +Error: Out of bounds! The array is of size 20, but the index has bounds 27..27 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 27. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 27..27 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 27. +Error: Out of bounds! The array is of size 20, but the index has bounds 27..27 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 27. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 27..27 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 27. +Error: Out of bounds! The array is of size 20, but the index has bounds 27..27 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 27. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 27..27 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 27. +Error: Out of bounds! The array is of size 20, but the index has bounds 27..27 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 27. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 27..27 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 27. +Error: Out of bounds! The array is of size 20, but the index has bounds 27..27 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 27. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 27..27 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 27. +Error: Out of bounds! The array is of size 20, but the index has bounds 27..27 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 27. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 27..27 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 27. +Error: Out of bounds! The array is of size 20, but the index has bounds 27..27 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 27. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 27..27 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 27. +Error: Out of bounds! The array is of size 20, but the index has bounds 27..27 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 27. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 27..27 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 27. +Error: Out of bounds! The array is of size 20, but the index has bounds 27..27 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 27. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 27..27 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 27. +Error: Out of bounds! The array is of size 20, but the index has bounds 27..27 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 27. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 27..27 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 27. +Error: Out of bounds! The array is of size 20, but the index has bounds 27..27 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 27. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 27..27 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 27. +Error: Out of bounds! The array is of size 20, but the index has bounds 27..27 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 27. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 27..27 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 27. +Error: Out of bounds! The array is of size 20, but the index has bounds 27..27 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 27. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 27..27 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 27. +Error: Out of bounds! The array is of size 20, but the index has bounds 27..27 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 27. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 27..27 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 27. +Error: Out of bounds! The array is of size 20, but the index has bounds 27..27 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 27. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 27..27 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 28. +Error: Out of bounds! The array is of size 20, but the index has bounds 28..28 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 28. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 28..28 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 28. +Error: Out of bounds! The array is of size 20, but the index has bounds 28..28 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 28. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 28..28 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 28. +Error: Out of bounds! The array is of size 20, but the index has bounds 28..28 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 28. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 28..28 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 28. +Error: Out of bounds! The array is of size 20, but the index has bounds 28..28 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 28. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 28..28 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 28. +Error: Out of bounds! The array is of size 20, but the index has bounds 28..28 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 28. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 28..28 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 28. +Error: Out of bounds! The array is of size 20, but the index has bounds 28..28 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 28. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 28..28 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 28. +Error: Out of bounds! The array is of size 20, but the index has bounds 28..28 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 28. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 28..28 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 28. +Error: Out of bounds! The array is of size 20, but the index has bounds 28..28 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 28. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 28..28 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 28. +Error: Out of bounds! The array is of size 20, but the index has bounds 28..28 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 28. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 28..28 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 28. +Error: Out of bounds! The array is of size 20, but the index has bounds 28..28 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 28. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 28..28 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 28. +Error: Out of bounds! The array is of size 20, but the index has bounds 28..28 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 28. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 28..28 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 28. +Error: Out of bounds! The array is of size 20, but the index has bounds 28..28 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 28. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 28..28 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 28. +Error: Out of bounds! The array is of size 20, but the index has bounds 28..28 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 28. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 28..28 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 28. +Error: Out of bounds! The array is of size 20, but the index has bounds 28..28 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 28. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 28..28 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 28. +Error: Out of bounds! The array is of size 20, but the index has bounds 28..28 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 28. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 28..28 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 28. +Error: Out of bounds! The array is of size 20, but the index has bounds 28..28 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 28. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 28..28 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 28. +Error: Out of bounds! The array is of size 20, but the index has bounds 28..28 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 28. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 28..28 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 28. +Error: Out of bounds! The array is of size 20, but the index has bounds 28..28 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 28. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 28..28 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 28. +Error: Out of bounds! The array is of size 20, but the index has bounds 28..28 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 28. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 28..28 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 28. +Error: Out of bounds! The array is of size 20, but the index has bounds 28..28 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 28. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 28..28 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 29. +Error: Out of bounds! The array is of size 20, but the index has bounds 29..29 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 29. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 29..29 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 29. +Error: Out of bounds! The array is of size 20, but the index has bounds 29..29 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 29. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 29..29 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 29. +Error: Out of bounds! The array is of size 20, but the index has bounds 29..29 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 29. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 29..29 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 29. +Error: Out of bounds! The array is of size 20, but the index has bounds 29..29 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 29. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 29..29 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 29. +Error: Out of bounds! The array is of size 20, but the index has bounds 29..29 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 29. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 29..29 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 29. +Error: Out of bounds! The array is of size 20, but the index has bounds 29..29 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 29. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 29..29 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 29. +Error: Out of bounds! The array is of size 20, but the index has bounds 29..29 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 29. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 29..29 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 29. +Error: Out of bounds! The array is of size 20, but the index has bounds 29..29 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 29. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 29..29 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 29. +Error: Out of bounds! The array is of size 20, but the index has bounds 29..29 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 29. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 29..29 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 29. +Error: Out of bounds! The array is of size 20, but the index has bounds 29..29 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 29. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 29..29 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 29. +Error: Out of bounds! The array is of size 20, but the index has bounds 29..29 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 29. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 29..29 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 29. +Error: Out of bounds! The array is of size 20, but the index has bounds 29..29 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 29. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 29..29 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 29. +Error: Out of bounds! The array is of size 20, but the index has bounds 29..29 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 29. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 29..29 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 29. +Error: Out of bounds! The array is of size 20, but the index has bounds 29..29 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 29. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 29..29 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 29. +Error: Out of bounds! The array is of size 20, but the index has bounds 29..29 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 29. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 29..29 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 29. +Error: Out of bounds! The array is of size 20, but the index has bounds 29..29 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 29. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 29..29 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 29. +Error: Out of bounds! The array is of size 20, but the index has bounds 29..29 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 29. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 29..29 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 29. +Error: Out of bounds! The array is of size 20, but the index has bounds 29..29 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 29. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 29..29 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 29. +Error: Out of bounds! The array is of size 20, but the index has bounds 29..29 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 29. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 29..29 ─────╯ -Error: Index out of bounds. Array is of size 20, but the index is 29. +Error: Out of bounds! The array is of size 20, but the index has bounds 29..29 ╭─[ test.sus:352:28 ] │ 352 │ row_products[col] = mat[row][col] * vec[col] │ ─┬─ - │ ╰─── Index out of bounds. Array is of size 20, but the index is 29. + │ ╰─── Out of bounds! The array is of size 20, but the index has bounds 29..29 ─────╯ Error: This instruction is part of a net-positive latency cycle of +5 @@ -1799,9 +2114,9 @@ _1_i'0 Which conflicts with the starting latency ╭─[ test.sus:360:8 ] │ - 360 │ state int test - │ ────┬─── - │ ╰───── This instruction is part of a net-positive latency cycle of +5 + 360 │ state int#(MIN: 0, MAX: 7) test + │ ────────────┬──────────── + │ ╰────────────── This instruction is part of a net-positive latency cycle of +5 _1_i'0 -> test'5 (+5) @@ -1829,76 +2144,46 @@ _1_i'0 Which conflicts with the starting latency ─────╯ Warning: Unused Variable: This variable does not affect the output ports of this module - ╭─[ test.sus:375:36 ] + ╭─[ test.sus:375:34 ] │ - 375 │ interface offset_latency : int i'0 -> int o'-5 - │ ┬ - │ ╰── Unused Variable: This variable does not affect the output ports of this module + 375 │ interface offset_latency : T i'0 -> T o'-5 + │ ┬ + │ ╰── Unused Variable: This variable does not affect the output ports of this module ─────╯ Warning: Unused Variable: This variable does not affect the output ports of this module - ╭─[ test.sus:393:32 ] + ╭─[ test.sus:393:33 ] │ - 393 │ interface input_only : int i - │ ┬ - │ ╰── Unused Variable: This variable does not affect the output ports of this module + 393 │ interface input_only : bool i + │ ┬ + │ ╰── Unused Variable: This variable does not affect the output ports of this module ─────╯ Warning: Unused Variable: This variable does not affect the output ports of this module - ╭─[ test.sus:394:12 ] + ╭─[ test.sus:394:13 ] │ - 394 │ state int loop - │ ──┬─ - │ ╰─── Unused Variable: This variable does not affect the output ports of this module + 394 │ state bool loop + │ ──┬─ + │ ╰─── Unused Variable: This variable does not affect the output ports of this module ─────╯ Warning: Unused Variable: This variable does not affect the output ports of this module - ╭─[ test.sus:400:42 ] + ╭─[ test.sus:400:43 ] │ - 400 │ interface multiple_inputs_only : int i, int i2 - │ ┬ - │ ╰── Unused Variable: This variable does not affect the output ports of this module + 400 │ interface multiple_inputs_only : bool i'0, bool i2'0 + │ ┬ + │ ╰── Unused Variable: This variable does not affect the output ports of this module ─────╯ Warning: Unused Variable: This variable does not affect the output ports of this module - ╭─[ test.sus:400:49 ] - │ - 400 │ interface multiple_inputs_only : int i, int i2 - │ ─┬ - │ ╰── Unused Variable: This variable does not affect the output ports of this module -─────╯ -Error: This port is not strongly connected to the strongly connected port cluster 'i'. -An input and output port are strongly connected if there is a direct dependency path from the input port to the output port. -Strongly connected ports are also transitive. -If you do not wish to change your design, then 'virtually' connect this port to the strongly connected cluster by explicitly annotating its absolute latency. - ╭─[ test.sus:400:49 ] + ╭─[ test.sus:400:53 ] │ - 400 │ interface multiple_inputs_only : int i, int i2 - │ ┬ ─┬ - │ ╰────────── 'i' declared here - │ │ - │ ╰── This port is not strongly connected to the strongly connected port cluster 'i'. -An input and output port are strongly connected if there is a direct dependency path from the input port to the output port. -Strongly connected ports are also transitive. -If you do not wish to change your design, then 'virtually' connect this port to the strongly connected cluster by explicitly annotating its absolute latency. + 400 │ interface multiple_inputs_only : bool i'0, bool i2'0 + │ ─┬ + │ ╰── Unused Variable: This variable does not affect the output ports of this module ─────╯ Warning: Unused Variable: This variable does not affect the output ports of this module - ╭─[ test.sus:401:12 ] - │ - 401 │ state int loop - │ ──┬─ - │ ╰─── Unused Variable: This variable does not affect the output ports of this module -─────╯ -Error: This port is not strongly connected to the strongly connected port cluster 'o'. -An input and output port are strongly connected if there is a direct dependency path from the input port to the output port. -Strongly connected ports are also transitive. -If you do not wish to change your design, then 'virtually' connect this port to the strongly connected cluster by explicitly annotating its absolute latency. - ╭─[ test.sus:415:53 ] + ╭─[ test.sus:401:13 ] │ - 415 │ interface multiple_outputs_only : -> int o, int o2 - │ ┬ ─┬ - │ ╰────────── 'o' declared here - │ │ - │ ╰── This port is not strongly connected to the strongly connected port cluster 'o'. -An input and output port are strongly connected if there is a direct dependency path from the input port to the output port. -Strongly connected ports are also transitive. -If you do not wish to change your design, then 'virtually' connect this port to the strongly connected cluster by explicitly annotating its absolute latency. + 401 │ state bool loop + │ ──┬─ + │ ╰─── Unused Variable: This variable does not affect the output ports of this module ─────╯ Error: 'contains_submodule_submodule' conflicts with other declarations: ╭─[ test.sus:441:8 ] @@ -1911,18 +2196,39 @@ Error: 'contains_submodule_submodule' conflicts with other declarations: │ ──────────────┬───────────── │ ╰─────────────── Conflicts with ─────╯ -Error: ::doNothing does not have a main interface. You should explicitly specify an interface to access +Error: Could not fully figure out the type of this object. type_variable_12[...peano_variable_12] + ╭─[ test.sus:445:2 ] + │ + 445 │ doNothing() + │ ─────┬───── + │ ╰─────── Could not fully figure out the type of this object. type_variable_12[...peano_variable_12] +─────╯ +Error: Could not fully figure out the type of this object. type_variable_12[...peano_variable_12] + ╭─[ test.sus:445:2 ] + │ + 445 │ doNothing() + │ ─────┬───── + │ ╰─────── Could not fully figure out the type of this object. type_variable_12[...peano_variable_12] +─────╯ +Warning: The result of this expression is not used. Only function calls can return nothing. + ╭─[ test.sus:445:2 ] + │ + 445 │ doNothing() + │ ─────┬───── + │ ╰─────── The result of this expression is not used. Only function calls can return nothing. +─────╯ +Error: doNothing does not have a main interface. You should explicitly specify an interface to access ╭─[ test.sus:445:2 ] │ 431 │ module doNothing {} │ ────┬──── - │ ╰────── Module 'doNothing' defined here. module ::doNothing #(): + │ ╰────── Module 'doNothing' defined here. module doNothing #(): domain clk: │ 445 │ doNothing() │ ────┬──── - │ ╰────── ::doNothing does not have a main interface. You should explicitly specify an interface to access + │ ╰────── doNothing does not have a main interface. You should explicitly specify an interface to access ─────╯ Warning: Unused Variable: This variable does not affect the output ports of this module ╭─[ test.sus:462:7 ] @@ -1931,6 +2237,32 @@ Warning: Unused Variable: This variable does not affect the output ports of this │ ┬ │ ╰── Unused Variable: This variable does not affect the output ports of this module ─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:584:71 ] + │ + 584 │ interface use_submodule_named_ports : int#(MIN: 0, MAX: 100) i -> int o + │ ──┬── + │ ╰──── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:586:24 ] + │ + 586 │ submodule_named_ports sm + │ ─┬ + │ ╰── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ Error: 'contains_submodule_submodule' conflicts with other declarations: ╭─[ test.sus:597:8 ] │ @@ -1942,18 +2274,39 @@ Error: 'contains_submodule_submodule' conflicts with other declarations: │ ──────────────┬───────────── │ ╰─────────────── 'contains_submodule_submodule' conflicts with other declarations: ─────╯ -Error: ::doNothing does not have a main interface. You should explicitly specify an interface to access +Error: Could not fully figure out the type of this object. type_variable_12[...peano_variable_12] + ╭─[ test.sus:601:2 ] + │ + 601 │ doNothing() + │ ─────┬───── + │ ╰─────── Could not fully figure out the type of this object. type_variable_12[...peano_variable_12] +─────╯ +Error: Could not fully figure out the type of this object. type_variable_12[...peano_variable_12] + ╭─[ test.sus:601:2 ] + │ + 601 │ doNothing() + │ ─────┬───── + │ ╰─────── Could not fully figure out the type of this object. type_variable_12[...peano_variable_12] +─────╯ +Warning: The result of this expression is not used. Only function calls can return nothing. + ╭─[ test.sus:601:2 ] + │ + 601 │ doNothing() + │ ─────┬───── + │ ╰─────── The result of this expression is not used. Only function calls can return nothing. +─────╯ +Error: doNothing does not have a main interface. You should explicitly specify an interface to access ╭─[ test.sus:601:2 ] │ 431 │ module doNothing {} │ ────┬──── - │ ╰────── Module 'doNothing' defined here. module ::doNothing #(): + │ ╰────── Module 'doNothing' defined here. module doNothing #(): domain clk: │ 601 │ doNothing() │ ────┬──── - │ ╰────── ::doNothing does not have a main interface. You should explicitly specify an interface to access + │ ╰────── doNothing does not have a main interface. You should explicitly specify an interface to access ─────╯ Warning: Unused Variable: This variable does not affect the output ports of this module ╭─[ test.sus:608:22 ] @@ -1963,11 +2316,11 @@ Warning: Unused Variable: This variable does not affect the output ports of this │ ╰── Unused Variable: This variable does not affect the output ports of this module ─────╯ Warning: Unused Variable: This variable does not affect the output ports of this module - ╭─[ test.sus:613:21 ] + ╭─[ test.sus:613:40 ] │ - 613 │ interface in : int i'0 - │ ┬ - │ ╰── Unused Variable: This variable does not affect the output ports of this module + 613 │ interface in : int#(MIN: 0, MAX: 100) i'0 + │ ┬ + │ ╰── Unused Variable: This variable does not affect the output ports of this module ─────╯ Warning: Unused Variable: This variable does not affect the output ports of this module ╭─[ test.sus:619:31 ] @@ -1983,6 +2336,19 @@ Warning: Unused Variable: This variable does not affect the output ports of this │ ┬ │ ╰── Unused Variable: This variable does not affect the output ports of this module ─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:648:29 ] + │ + 648 │ interface use_fifo : -> int o + │ ──┬── + │ ╰──── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ Error: Pre-emptive error because latency-unspecified 'o' is never written to. (This is because work-in-progress code would get a lot of latency counting errors while unfinished) ╭─[ test.sus:648:33 ] @@ -1992,18 +2358,18 @@ Error: Pre-emptive error because latency-unspecified 'o' is never written to. │ ╰── Pre-emptive error because latency-unspecified 'o' is never written to. (This is because work-in-progress code would get a lot of latency counting errors while unfinished) ─────╯ -Error: Could not fully instantiate ::FIFO #( - T: type ::bool[20], - DEPTH: /* Could not infer */ +Error: Could not infer the parameters of this submodule, some parameters were still unknown: FIFO #( + T: type bool[20], + DEPTH: /* Could not infer */, READY_SLACK: /* Could not infer */ ) ╭─[ test.sus:649:7 ] │ 649 │ FIFO fiii │ ──┬─ - │ ╰─── Could not fully instantiate ::FIFO #( - T: type ::bool[20], - DEPTH: /* Could not infer */ + │ ╰─── Could not infer the parameters of this submodule, some parameters were still unknown: FIFO #( + T: type bool[20], + DEPTH: /* Could not infer */, READY_SLACK: /* Could not infer */ ) ─────╯ @@ -2029,85 +2395,80 @@ Warning: Unused Variable: This variable does not affect the output ports of this │ ╰──── Unused Variable: This variable does not affect the output ports of this module ─────╯ Warning: Unused Variable: This variable does not affect the output ports of this module - ╭─[ test.sus:659:43 ] + ╭─[ test.sus:659:44 ] │ - 659 │ interface test_separated_domain : int main - │ ──┬─ - │ ╰─── Unused Variable: This variable does not affect the output ports of this module + 659 │ interface test_separated_domain : bool main + │ ──┬─ + │ ╰─── Unused Variable: This variable does not affect the output ports of this module ─────╯ Warning: Unused Variable: This variable does not affect the output ports of this module - ╭─[ test.sus:660:6 ] + ╭─[ test.sus:660:7 ] │ - 660 │ int domain2 - │ ───┬─── - │ ╰───── Unused Variable: This variable does not affect the output ports of this module + 660 │ bool domain2 + │ ───┬─── + │ ╰───── Unused Variable: This variable does not affect the output ports of this module ─────╯ Warning: Unused Variable: This variable does not affect the output ports of this module - ╭─[ test.sus:662:6 ] + ╭─[ test.sus:662:7 ] │ - 662 │ int domain3 - │ ───┬─── - │ ╰───── Unused Variable: This variable does not affect the output ports of this module + 662 │ bool domain3 + │ ───┬─── + │ ╰───── Unused Variable: This variable does not affect the output ports of this module ─────╯ Warning: Unused Variable: This variable does not affect the output ports of this module - ╭─[ test.sus:664:6 ] + ╭─[ test.sus:664:7 ] │ - 664 │ int domain4 - │ ───┬─── - │ ╰───── Unused Variable: This variable does not affect the output ports of this module + 664 │ bool domain4 + │ ───┬─── + │ ╰───── Unused Variable: This variable does not affect the output ports of this module ─────╯ Warning: Unused Variable: This variable does not affect the output ports of this module - ╭─[ test.sus:670:6 ] + ╭─[ test.sus:670:7 ] │ - 670 │ int domain5 - │ ───┬─── - │ ╰───── Unused Variable: This variable does not affect the output ports of this module + 670 │ bool domain5 + │ ───┬─── + │ ╰───── Unused Variable: This variable does not affect the output ports of this module ─────╯ -Error: MIN is not a valid template argument of ::int - ╭─[ test.sus:672:8 ] +Warning: Unused Variable: This variable does not affect the output ports of this module + ╭─[ test.sus:672:26 ] │ 672 │ int #(MIN: 0, MAX: 199) my_int - │ ─┬─ - │ ╰─── MIN is not a valid template argument of ::int - │ - ├─[ core.sus:33:20 ] - │ - 33 │ __builtin__ struct int {} - │ ─┬─ - │ ╰─── 'int' defined here + │ ───┬── + │ ╰──── Unused Variable: This variable does not affect the output ports of this module ─────╯ -Error: MAX is not a valid template argument of ::int - ╭─[ test.sus:672:16 ] - │ - 672 │ int #(MIN: 0, MAX: 199) my_int - │ ─┬─ - │ ╰─── MAX is not a valid template argument of ::int +Error: Could not fully figure out the type of this object. type_variable_0[...peano_variable_0] + ╭─[ test.sus:678:2 ] │ - ├─[ core.sus:33:20 ] + 678 │ no_port_module() + │ ────────┬─────── + │ ╰───────── Could not fully figure out the type of this object. type_variable_0[...peano_variable_0] +─────╯ +Error: Could not fully figure out the type of this object. type_variable_0[...peano_variable_0] + ╭─[ test.sus:678:2 ] │ - 33 │ __builtin__ struct int {} - │ ─┬─ - │ ╰─── 'int' defined here + 678 │ no_port_module() + │ ────────┬─────── + │ ╰───────── Could not fully figure out the type of this object. type_variable_0[...peano_variable_0] ─────╯ -Warning: Unused Variable: This variable does not affect the output ports of this module - ╭─[ test.sus:672:26 ] +Warning: The result of this expression is not used. Only function calls can return nothing. + ╭─[ test.sus:678:2 ] │ - 672 │ int #(MIN: 0, MAX: 199) my_int - │ ───┬── - │ ╰──── Unused Variable: This variable does not affect the output ports of this module + 678 │ no_port_module() + │ ────────┬─────── + │ ╰───────── The result of this expression is not used. Only function calls can return nothing. ─────╯ -Error: ::no_port_module does not have a main interface. You should explicitly specify an interface to access +Error: no_port_module does not have a main interface. You should explicitly specify an interface to access ╭─[ test.sus:678:2 ] │ 675 │ module no_port_module {} │ ───────┬────── - │ ╰──────── Module 'no_port_module' defined here. module ::no_port_module #(): + │ ╰──────── Module 'no_port_module' defined here. module no_port_module #(): domain clk: │ 678 │ no_port_module() │ ───────┬────── - │ ╰──────── ::no_port_module does not have a main interface. You should explicitly specify an interface to access + │ ╰──────── no_port_module does not have a main interface. You should explicitly specify an interface to access ─────╯ Warning: Unused Variable: This variable does not affect the output ports of this module ╭─[ test.sus:681:6 ] @@ -2116,25 +2477,25 @@ Warning: Unused Variable: This variable does not affect the output ports of this │ ┬ │ ╰── Unused Variable: This variable does not affect the output ports of this module ─────╯ -Error: ::no_port_module does not have a main interface. You should explicitly specify an interface to access +Error: no_port_module does not have a main interface. You should explicitly specify an interface to access ╭─[ test.sus:681:10 ] │ 675 │ module no_port_module {} │ ───────┬────── - │ ╰──────── Module 'no_port_module' defined here. module ::no_port_module #(): + │ ╰──────── Module 'no_port_module' defined here. module no_port_module #(): domain clk: │ 681 │ int x = no_port() │ ───┬─── - │ ╰───── ::no_port_module does not have a main interface. You should explicitly specify an interface to access + │ ╰───── no_port_module does not have a main interface. You should explicitly specify an interface to access ─────╯ Warning: Unused Variable: This variable does not affect the output ports of this module - ╭─[ test.sus:686:21 ] + ╭─[ test.sus:686:40 ] │ - 686 │ interface v : int a -> int b - │ ┬ - │ ╰── Unused Variable: This variable does not affect the output ports of this module + 686 │ interface v : int#(MIN: 0, MAX: 100) a -> int b + │ ┬ + │ ╰── Unused Variable: This variable does not affect the output ports of this module ─────╯ Warning: Unused Variable: This variable does not affect the output ports of this module ╭─[ test.sus:691:6 ] @@ -2159,12 +2520,19 @@ Error: This value is non-generative, yet it is being assigned to a generative va │ │ │ ╰── This value is non-generative, yet it is being assigned to a generative value ─────╯ +Warning: The result of this expression is not used. Only function calls can return nothing. + ╭─[ test.sus:707:2 ] + │ + 707 │ mm.a + │ ──┬─ + │ ╰─── The result of this expression is not used. Only function calls can return nothing. +─────╯ Error: Port 'a' is used, but the instantiated module has this port disabled ╭─[ test.sus:707:5 ] │ - 686 │ interface v : int a -> int b - │ ┬ - │ ╰── Port 'a' declared here + 686 │ interface v : int#(MIN: 0, MAX: 100) a -> int b + │ ┬ + │ ╰── Port 'a' declared here │ 705 │ mod_with_unused_interface mm │ ─┬ @@ -2174,6 +2542,45 @@ Error: Port 'a' is used, but the instantiated module has this port disabled │ ┬ │ ╰── Port 'a' is used, but the instantiated module has this port disabled ─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:727:40 ] + │ + 727 │ interface iter : -> bool valid, state int index + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:732:12 ] + │ + 732 │ cross_int upTo_cr + │ ───┬─── + │ ╰───── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:741:11 ] + │ + 741 │ index = index - 1 + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ Warning: Unused Variable: This variable does not affect the output ports of this module ╭─[ test.sus:750:30 ] │ @@ -2181,6 +2588,26 @@ Warning: Unused Variable: This variable does not affect the output ports of this │ ──┬── │ ╰──── Unused Variable: This variable does not affect the output ports of this module ─────╯ +Error: Error instantiating submodule + ╭─[ test.sus:752:2 ] + │ + 752 │ sequenceDownFrom sdf + │ ────────┬─────── + │ ╰───────── Error instantiating submodule +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:752:19 ] + │ + 752 │ sequenceDownFrom sdf + │ ─┬─ + │ ╰─── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ Warning: Unused Variable: This variable does not affect the output ports of this module ╭─[ test.sus:756:7 ] │ @@ -2195,6 +2622,19 @@ Warning: Unused Variable: This variable does not affect the output ports of this │ ─────┬──── │ ╰────── Unused Variable: This variable does not affect the output ports of this module ─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:758:19 ] + │ + 758 │ bool iter_valid, int iter_index = sdf.iter() + │ ───────┬────── + │ ╰──────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ Warning: Unused Variable: This variable does not affect the output ports of this module ╭─[ test.sus:758:23 ] │ @@ -2202,6 +2642,19 @@ Warning: Unused Variable: This variable does not affect the output ports of this │ ─────┬──── │ ╰────── Unused Variable: This variable does not affect the output ports of this module ─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:760:3 ] + │ + 760 │ int idx = iter_index + │ ───┬─── + │ ╰───── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ Warning: Unused Variable: This variable does not affect the output ports of this module ╭─[ test.sus:760:7 ] │ @@ -2209,6 +2662,19 @@ Warning: Unused Variable: This variable does not affect the output ports of this │ ─┬─ │ ╰─── Unused Variable: This variable does not affect the output ports of this module ─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:763:2 ] + │ + 763 │ int beep + │ ────┬─── + │ ╰───── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ Warning: Unused Variable: This variable does not affect the output ports of this module ╭─[ test.sus:763:6 ] │ @@ -2223,51 +2689,58 @@ Warning: Unused Variable: This variable does not affect the output ports of this │ ────┬─── │ ╰───── Unused Variable: This variable does not affect the output ports of this module ─────╯ -Error: beep is not a valid template argument of ::int +Error: beep is not a valid template argument of int ╭─[ test.sus:767:30 ] │ 767 │ interface test : ::int #(beep: 20 > 3, BEEP: int) ab │ ──┬─ - │ ╰─── beep is not a valid template argument of ::int + │ ╰─── beep is not a valid template argument of int │ - ├─[ core.sus:33:20 ] + ├─[ core.sus:39:20 ] │ - 33 │ __builtin__ struct int {} + 39 │ __builtin__ struct int #(int MIN, int MAX) {} │ ─┬─ │ ╰─── 'int' defined here ─────╯ -Error: BEEP is not a valid template argument of ::int +Error: BEEP is not a valid template argument of int ╭─[ test.sus:767:44 ] │ 767 │ interface test : ::int #(beep: 20 > 3, BEEP: int) ab │ ──┬─ - │ ╰─── BEEP is not a valid template argument of ::int + │ ╰─── BEEP is not a valid template argument of int │ - ├─[ core.sus:33:20 ] + ├─[ core.sus:39:20 ] │ - 33 │ __builtin__ struct int {} + 39 │ __builtin__ struct int #(int MIN, int MAX) {} │ ─┬─ │ ╰─── 'int' defined here ─────╯ -Error: ::int is not a named wire: local or constant, it is a Struct instead! +Error: Could not fully figure out the type of this object. type_variable_7[...peano_variable_8] ╭─[ test.sus:767:50 ] │ 767 │ interface test : ::int #(beep: 20 > 3, BEEP: int) ab │ ─┬─ - │ ╰─── ::int is not a named wire: local or constant, it is a Struct instead! - │ - ├─[ core.sus:33:20 ] + │ ╰─── Could not fully figure out the type of this object. type_variable_7[...peano_variable_8] +─────╯ +Error: Could not fully figure out the type of this object. type_variable_7[...peano_variable_8] + ╭─[ test.sus:767:50 ] │ - 33 │ __builtin__ struct int {} - │ ─┬─ - │ ╰─── Defined here + 767 │ interface test : ::int #(beep: 20 > 3, BEEP: int) ab + │ ─┬─ + │ ╰─── Could not fully figure out the type of this object. type_variable_7[...peano_variable_8] ─────╯ -Error: Could not fully figure out the type of this object. type_variable_3[...peano_variable_4] +Error: int is not a named wire: local or constant, it is a Struct instead! ╭─[ test.sus:767:50 ] │ 767 │ interface test : ::int #(beep: 20 > 3, BEEP: int) ab │ ─┬─ - │ ╰─── Could not fully figure out the type of this object. type_variable_3[...peano_variable_4] + │ ╰─── int is not a named wire: local or constant, it is a Struct instead! + │ + ├─[ core.sus:39:20 ] + │ + 39 │ __builtin__ struct int #(int MIN, int MAX) {} + │ ─┬─ + │ ╰─── Defined here ─────╯ Warning: Unused Variable: This variable does not affect the output ports of this module ╭─[ test.sus:767:55 ] @@ -2305,19 +2778,19 @@ Error: 'beep' is read-only │ ──┬─ │ ╰─── 'beep' is read-only ─────╯ -Error: Could not fully figure out the type of this object. type_variable_7[...peano_variable_8] +Error: Could not fully figure out the type of this object. type_variable_14[...peano_variable_15] ╭─[ test.sus:775:2 ] │ 775 │ FIFO #(BITWIDTH: 4) badoop │ ─────────┬───────── - │ ╰─────────── Could not fully figure out the type of this object. type_variable_7[...peano_variable_8] + │ ╰─────────── Could not fully figure out the type of this object. type_variable_14[...peano_variable_15] ─────╯ -Error: BITWIDTH is not a valid template argument of ::FIFO +Error: BITWIDTH is not a valid template argument of FIFO ╭─[ test.sus:775:9 ] │ 775 │ FIFO #(BITWIDTH: 4) badoop │ ────┬─── - │ ╰───── BITWIDTH is not a valid template argument of ::FIFO + │ ╰───── BITWIDTH is not a valid template argument of FIFO │ ├─[ util.sus:22:8 ] │ @@ -2371,788 +2844,9149 @@ Warning: Unused port 'o' │ │ │ ╰── c declared here ─────╯ -Warning: Unused port 'data' - ╭─[ test.sus:851:2 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[127] + ╭─[ test.sus:799:8 ] + │ + 799 │ input int[WIDTH] values + │ ────────┬──────── + │ ╰────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[127] +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[15] + ╭─[ test.sus:799:8 ] + │ + 799 │ input int[WIDTH] values + │ ────────┬──────── + │ ╰────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[15] +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[1] + ╭─[ test.sus:799:8 ] + │ + 799 │ input int[WIDTH] values + │ ────────┬──────── + │ ╰────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[1] +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[255] + ╭─[ test.sus:799:8 ] + │ + 799 │ input int[WIDTH] values + │ ────────┬──────── + │ ╰────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[255] +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[31] + ╭─[ test.sus:799:8 ] + │ + 799 │ input int[WIDTH] values + │ ────────┬──────── + │ ╰────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[31] +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[3] + ╭─[ test.sus:799:8 ] + │ + 799 │ input int[WIDTH] values + │ ────────┬──────── + │ ╰────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[3] +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[63] + ╭─[ test.sus:799:8 ] + │ + 799 │ input int[WIDTH] values + │ ────────┬──────── + │ ╰────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[63] +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[7] + ╭─[ test.sus:799:8 ] + │ + 799 │ input int[WIDTH] values + │ ────────┬──────── + │ ╰────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[7] +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:800:9 ] │ - 840 │ input T data - │ ──┬─ - │ ╰─── Port 'data' declared here - │ - 851 │ replicate #(NUM_REPLS: 20, T: type int[30]) b - │ ─────────────────────┬───────────────────── ┬ - │ ╰───────────────────────── Unused port 'data' - │ │ - │ ╰── b declared here + 800 │ output int sum + │ ───┬─── + │ ╰───── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ─────╯ -Warning: Unused port 'result' - ╭─[ test.sus:851:2 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:800:9 ] │ - 842 │ output T[NUM_REPLS] result - │ ───┬── - │ ╰──── Port 'result' declared here - │ - 851 │ replicate #(NUM_REPLS: 20, T: type int[30]) b - │ ─────────────────────┬───────────────────── ┬ - │ ╰───────────────────────── Unused port 'result' - │ │ - │ ╰── b declared here + 800 │ output int sum + │ ───┬─── + │ ╰───── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ─────╯ -Warning: Unused Variable: This variable does not affect the output ports of this module - ╭─[ test.sus:854:6 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:800:9 ] │ - 854 │ int val = 3 - │ ─┬─ - │ ╰─── Unused Variable: This variable does not affect the output ports of this module + 800 │ output int sum + │ ───┬─── + │ ╰───── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ─────╯ -Warning: Unused Variable: This variable does not affect the output ports of this module - ╭─[ test.sus:857:10 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:800:9 ] │ - 857 │ int[30] out = c.result - │ ─┬─ - │ ╰─── Unused Variable: This variable does not affect the output ports of this module + 800 │ output int sum + │ ───┬─── + │ ╰───── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ─────╯ -Warning: Unused Variable: This variable does not affect the output ports of this module - ╭─[ test.sus:869:13 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:800:9 ] │ - 869 │ gen int[8] SOURCES = [3, 2, 4, 5, 1, 2, 7, 6] - │ ───┬─── - │ ╰───── Unused Variable: This variable does not affect the output ports of this module + 800 │ output int sum + │ ───┬─── + │ ╰───── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ─────╯ -Warning: Unused Variable: This variable does not affect the output ports of this module - ╭─[ test.sus:871:9 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:800:9 ] │ - 871 │ int[2] inArr - │ ──┬── - │ ╰──── Unused Variable: This variable does not affect the output ports of this module + 800 │ output int sum + │ ───┬─── + │ ╰───── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ─────╯ -Warning: Unused Variable: This variable does not affect the output ports of this module - ╭─[ test.sus:878:9 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:800:9 ] │ - 878 │ int[8] beep = permut.permute(SOURCES) - │ ──┬─ - │ ╰─── Unused Variable: This variable does not affect the output ports of this module + 800 │ output int sum + │ ───┬─── + │ ╰───── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ─────╯ -Warning: Unused Variable: This variable does not affect the output ports of this module - ╭─[ test.sus:882:28 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:800:9 ] │ - 882 │ interface from : bool[32] instr - │ ──┬── - │ ╰──── Unused Variable: This variable does not affect the output ports of this module + 800 │ output int sum + │ ───┬─── + │ ╰───── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ─────╯ -Warning: Unused Variable: This variable does not affect the output ports of this module - ╭─[ test.sus:890:42 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:803:9 ] │ - 890 │ interface run_instruction : bool[32] instr - │ ──┬── - │ ╰──── Unused Variable: This variable does not affect the output ports of this module + 803 │ sum = values[0] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ─────╯ -Error: Excess output targets. Function returns 0 results, but 1 targets were given. - ╭─[ test.sus:894:7 ] +Error: Error instantiating submodule + ╭─[ test.sus:806:3 ] │ - 883 │ interface is_jump - │ ───┬─── - │ ╰───── Interface 'is_jump' defined here - │ - 894 │ when decoder.is_jump() : int target_addr { - │ ────────┬──────── - │ ╰────────── Excess output targets. Function returns 0 results, but 1 targets were given. + 806 │ tree_add #(WIDTH: HALF_WIDTH) left + │ ──────────────┬────────────── + │ ╰──────────────── Error instantiating submodule ─────╯ -Error: While parsing 'if_statement', parser found a syntax error in a node of type 'ERROR' - ╭─[ test.sus:894:25 ] +Error: Error instantiating submodule + ╭─[ test.sus:806:3 ] │ - 894 │ ╭─▶ when decoder.is_jump() : int target_addr { - │ │ ────────┬──────── - │ │ ╰────────── While parsing 'if_statement', parser found a syntax error in a node of type 'ERROR' - ┆ ┆ - 896 │ ├─▶ } - │ │ - │ ╰─────────── Parent node 'if_statement' + 806 │ tree_add #(WIDTH: HALF_WIDTH) left + │ ──────────────┬────────────── + │ ╰──────────────── Error instantiating submodule ─────╯ -Error: Excess output targets. Function returns 0 results, but 1 targets were given. - ╭─[ test.sus:897:7 ] +Error: Error instantiating submodule + ╭─[ test.sus:806:3 ] │ - 884 │ interface is_load - │ ───┬─── - │ ╰───── Interface 'is_load' defined here - │ - 897 │ when decoder.is_load() : int reg_to, int addr { - │ ────────┬──────── - │ ╰────────── Excess output targets. Function returns 0 results, but 1 targets were given. + 806 │ tree_add #(WIDTH: HALF_WIDTH) left + │ ──────────────┬────────────── + │ ╰──────────────── Error instantiating submodule ─────╯ -Error: While parsing 'if_statement', parser found a syntax error in a node of type 'ERROR' - ╭─[ test.sus:897:25 ] +Error: Error instantiating submodule + ╭─[ test.sus:806:3 ] │ - 897 │ ╭─▶ when decoder.is_load() : int reg_to, int addr { - │ │ ───────────┬────────── - │ │ ╰──────────── While parsing 'if_statement', parser found a syntax error in a node of type 'ERROR' - ┆ ┆ - 899 │ ├─▶ } - │ │ - │ ╰─────────── Parent node 'if_statement' + 806 │ tree_add #(WIDTH: HALF_WIDTH) left + │ ──────────────┬────────────── + │ ╰──────────────── Error instantiating submodule ─────╯ -Warning: Used 'when' in a generative context, use 'if' instead - ╭─[ test.sus:900:2 ] +Error: Error instantiating submodule + ╭─[ test.sus:806:3 ] │ - 900 │ when decoder.is_arith() : int reg_a, int reg_b, Operator op { - │ ──┬─ - │ ╰─── Used 'when' in a generative context, use 'if' instead + 806 │ tree_add #(WIDTH: HALF_WIDTH) left + │ ──────────────┬────────────── + │ ╰──────────────── Error instantiating submodule ─────╯ -Error: While parsing 'if_statement', parser found a syntax error in a node of type 'ERROR' - ╭─[ test.sus:900:7 ] +Error: Error instantiating submodule + ╭─[ test.sus:806:3 ] │ - 900 │ ╭─▶ when decoder.is_arith() : int reg_a, int reg_b, Operator op { - │ │ ─────────────────────────┬───────────────────────── - │ │ ╰─────────────────────────── While parsing 'if_statement', parser found a syntax error in a node of type 'ERROR' - ┆ ┆ - 902 │ ├─▶ } - │ │ - │ ╰─────────── Parent node 'if_statement' + 806 │ tree_add #(WIDTH: HALF_WIDTH) left + │ ──────────────┬────────────── + │ ╰──────────────── Error instantiating submodule ─────╯ -Error: No Global of the name 'op' was found. Did you forget to import it? - ╭─[ test.sus:900:59 ] +Error: Error instantiating submodule + ╭─[ test.sus:806:3 ] │ - 900 │ when decoder.is_arith() : int reg_a, int reg_b, Operator op { - │ ─┬ - │ ╰── No Global of the name 'op' was found. Did you forget to import it? + 806 │ tree_add #(WIDTH: HALF_WIDTH) left + │ ──────────────┬────────────── + │ ╰──────────────── Error instantiating submodule ─────╯ -Warning: Unused Variable: This variable does not affect the output ports of this module - ╭─[ test.sus:913:6 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:806:33 ] │ - 913 │ int x = no_interface_named() - │ ┬ - │ ╰── Unused Variable: This variable does not affect the output ports of this module + 806 │ tree_add #(WIDTH: HALF_WIDTH) left + │ ──┬─ + │ ╰─── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ─────╯ -Error: ::no_main_interface does not have a main interface. You should explicitly specify an interface to access - ╭─[ test.sus:913:10 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:806:33 ] │ - 906 │ module no_main_interface { - │ ────────┬──────── - │ ╰────────── Module 'no_main_interface' defined here. module ::no_main_interface #(): -domain clk: - - │ - 913 │ int x = no_interface_named() - │ ─────────┬──────── - │ ╰────────── ::no_main_interface does not have a main interface. You should explicitly specify an interface to access + 806 │ tree_add #(WIDTH: HALF_WIDTH) left + │ ──┬─ + │ ╰─── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ─────╯ -Warning: Unused Variable: This variable does not affect the output ports of this module - ╭─[ test.sus:914:6 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:806:33 ] │ - 914 │ int y = no_main_interface() - │ ┬ - │ ╰── Unused Variable: This variable does not affect the output ports of this module + 806 │ tree_add #(WIDTH: HALF_WIDTH) left + │ ──┬─ + │ ╰─── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ─────╯ -Error: ::no_main_interface does not have a main interface. You should explicitly specify an interface to access - ╭─[ test.sus:914:10 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:806:33 ] │ - 906 │ module no_main_interface { - │ ────────┬──────── - │ ╰────────── Module 'no_main_interface' defined here. module ::no_main_interface #(): -domain clk: - - │ - 914 │ int y = no_main_interface() - │ ────────┬──────── - │ ╰────────── ::no_main_interface does not have a main interface. You should explicitly specify an interface to access + 806 │ tree_add #(WIDTH: HALF_WIDTH) left + │ ──┬─ + │ ╰─── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ─────╯ -Error: Typing Error: array size expects a ::int but was given a ::bool - ╭─[ test.sus:918:6 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:806:33 ] │ - 918 │ int[true] a - │ ──┬─ - │ ╰─── Typing Error: array size expects a ::int but was given a ::bool + 806 │ tree_add #(WIDTH: HALF_WIDTH) left + │ ──┬─ + │ ╰─── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ─────╯ -Warning: Unused Variable: This variable does not affect the output ports of this module - ╭─[ test.sus:918:12 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:806:33 ] │ - 918 │ int[true] a - │ ┬ - │ ╰── Unused Variable: This variable does not affect the output ports of this module + 806 │ tree_add #(WIDTH: HALF_WIDTH) left + │ ──┬─ + │ ╰─── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ─────╯ -Error: Typing Error: array size expects a ::int but was given a ::bool - ╭─[ test.sus:922:41 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:806:33 ] │ - 922 │ interface moduleWithBadInterface : int[true] a - │ ──┬─ - │ ╰─── Typing Error: array size expects a ::int but was given a ::bool + 806 │ tree_add #(WIDTH: HALF_WIDTH) left + │ ──┬─ + │ ╰─── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ─────╯ -Warning: Unused Variable: This variable does not affect the output ports of this module - ╭─[ test.sus:922:47 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[127] + ╭─[ test.sus:806:33 ] + │ + 806 │ tree_add #(WIDTH: HALF_WIDTH) left + │ ──┬─ + │ ╰─── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[127] +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[15] + ╭─[ test.sus:806:33 ] + │ + 806 │ tree_add #(WIDTH: HALF_WIDTH) left + │ ──┬─ + │ ╰─── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[15] +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[1] + ╭─[ test.sus:806:33 ] + │ + 806 │ tree_add #(WIDTH: HALF_WIDTH) left + │ ──┬─ + │ ╰─── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[1] +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[31] + ╭─[ test.sus:806:33 ] + │ + 806 │ tree_add #(WIDTH: HALF_WIDTH) left + │ ──┬─ + │ ╰─── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[31] +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[3] + ╭─[ test.sus:806:33 ] + │ + 806 │ tree_add #(WIDTH: HALF_WIDTH) left + │ ──┬─ + │ ╰─── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[3] +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[63] + ╭─[ test.sus:806:33 ] + │ + 806 │ tree_add #(WIDTH: HALF_WIDTH) left + │ ──┬─ + │ ╰─── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[63] +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[7] + ╭─[ test.sus:806:33 ] + │ + 806 │ tree_add #(WIDTH: HALF_WIDTH) left + │ ──┬─ + │ ╰─── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[7] +─────╯ +Error: Error instantiating submodule + ╭─[ test.sus:807:3 ] │ - 922 │ interface moduleWithBadInterface : int[true] a - │ ┬ - │ ╰── Unused Variable: This variable does not affect the output ports of this module + 807 │ tree_add #(WIDTH: HALF_WIDTH) right + │ ──────────────┬────────────── + │ ╰──────────────── Error instantiating submodule ─────╯ -Warning: Unused Variable: This variable does not affect the output ports of this module - ╭─[ test.sus:926:9 ] +Error: Error instantiating submodule + ╭─[ test.sus:807:3 ] │ - 926 │ int[3] xyz - │ ─┬─ - │ ╰─── Unused Variable: This variable does not affect the output ports of this module + 807 │ tree_add #(WIDTH: HALF_WIDTH) right + │ ──────────────┬────────────── + │ ╰──────────────── Error instantiating submodule ─────╯ -Error: Typing Error: variable reference expects a ::int but was given a ::bool - ╭─[ test.sus:929:2 ] +Error: Error instantiating submodule + ╭─[ test.sus:807:3 ] │ - 929 │ xyz[3] = true - │ ───┬── - │ ╰──── Typing Error: variable reference expects a ::int but was given a ::bool + 807 │ tree_add #(WIDTH: HALF_WIDTH) right + │ ──────────────┬────────────── + │ ╰──────────────── Error instantiating submodule ─────╯ -Error: While parsing 'block', parser found a syntax error in a node of type 'ERROR' - ╭─[ test.sus:935:2 ] +Error: Error instantiating submodule + ╭─[ test.sus:807:3 ] │ - 933 │ ╭─▶ const int SUM_UP #(int SIZE, int[SIZE] DATA) { - ┆ ┆ - 935 │ │ for I in 0..SIZE { - │ │ ────────┬─────── - │ │ ╰───────── While parsing 'block', parser found a syntax error in a node of type 'ERROR' - ┆ ┆ - 938 │ ├─▶ } - │ │ - │ ╰─────── Parent node 'block' + 807 │ tree_add #(WIDTH: HALF_WIDTH) right + │ ──────────────┬────────────── + │ ╰──────────────── Error instantiating submodule ─────╯ -Error: No Global of the name 'I' was found. Did you forget to import it? - ╭─[ test.sus:936:29 ] +Error: Error instantiating submodule + ╭─[ test.sus:807:3 ] │ - 936 │ SUM_UP = SUM_UP + DATA[I] - │ ┬ - │ ╰── No Global of the name 'I' was found. Did you forget to import it? + 807 │ tree_add #(WIDTH: HALF_WIDTH) right + │ ──────────────┬────────────── + │ ╰──────────────── Error instantiating submodule ─────╯ -Warning: Unused Variable: This variable does not affect the output ports of this module - ╭─[ test.sus:943:13 ] +Error: Error instantiating submodule + ╭─[ test.sus:807:3 ] │ - 943 │ gen int[5] DATA - │ ──┬─ - │ ╰─── Unused Variable: This variable does not affect the output ports of this module + 807 │ tree_add #(WIDTH: HALF_WIDTH) right + │ ──────────────┬────────────── + │ ╰──────────────── Error instantiating submodule ─────╯ -Warning: Unused Variable: This variable does not affect the output ports of this module - ╭─[ test.sus:950:10 ] +Error: Error instantiating submodule + ╭─[ test.sus:807:3 ] │ - 950 │ gen int X = SUM_UP #(SIZE: 4, DATA, BEEEP: 3) - │ ┬ - │ ╰── Unused Variable: This variable does not affect the output ports of this module + 807 │ tree_add #(WIDTH: HALF_WIDTH) right + │ ──────────────┬────────────── + │ ╰──────────────── Error instantiating submodule ─────╯ -Error: BEEEP is not a valid template argument of ::SUM_UP - ╭─[ test.sus:950:38 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:807:33 ] │ - 933 │ const int SUM_UP #(int SIZE, int[SIZE] DATA) { - │ ───┬── - │ ╰──── 'SUM_UP' defined here - │ - 950 │ gen int X = SUM_UP #(SIZE: 4, DATA, BEEEP: 3) - │ ──┬── - │ ╰──── BEEEP is not a valid template argument of ::SUM_UP + 807 │ tree_add #(WIDTH: HALF_WIDTH) right + │ ──┬── + │ ╰──── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ─────╯ -Error: ABC is not a valid template argument of ::int - ╭─[ test.sus:952:8 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:807:33 ] │ - 952 │ int #(ABC) x - │ ─┬─ - │ ╰─── ABC is not a valid template argument of ::int + 807 │ tree_add #(WIDTH: HALF_WIDTH) right + │ ──┬── + │ ╰──── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:807:33 ] │ - ├─[ core.sus:33:20 ] + 807 │ tree_add #(WIDTH: HALF_WIDTH) right + │ ──┬── + │ ╰──── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:807:33 ] │ - 33 │ __builtin__ struct int {} - │ ─┬─ - │ ╰─── 'int' defined here + 807 │ tree_add #(WIDTH: HALF_WIDTH) right + │ ──┬── + │ ╰──── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ─────╯ -Error: ABC does not name a Type or a Value. - ╭─[ test.sus:952:8 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:807:33 ] │ - 952 │ int #(ABC) x - │ ─┬─ - │ ╰─── ABC does not name a Type or a Value. + 807 │ tree_add #(WIDTH: HALF_WIDTH) right + │ ──┬── + │ ╰──── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ─────╯ -Warning: Unused Variable: This variable does not affect the output ports of this module - ╭─[ test.sus:952:13 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:807:33 ] │ - 952 │ int #(ABC) x - │ ┬ - │ ╰── Unused Variable: This variable does not affect the output ports of this module + 807 │ tree_add #(WIDTH: HALF_WIDTH) right + │ ──┬── + │ ╰──── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ─────╯ -Warning: Unused Variable: This variable does not affect the output ports of this module - ╭─[ test.sus:956:9 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:807:33 ] │ - 956 │ int[5] a - │ ┬ - │ ╰── Unused Variable: This variable does not affect the output ports of this module + 807 │ tree_add #(WIDTH: HALF_WIDTH) right + │ ──┬── + │ ╰──── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ─────╯ -Warning: Unused Variable: This variable does not affect the output ports of this module - ╭─[ test.sus:961:9 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[127] + ╭─[ test.sus:807:33 ] + │ + 807 │ tree_add #(WIDTH: HALF_WIDTH) right + │ ──┬── + │ ╰──── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[127] +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[15] + ╭─[ test.sus:807:33 ] + │ + 807 │ tree_add #(WIDTH: HALF_WIDTH) right + │ ──┬── + │ ╰──── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[15] +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[1] + ╭─[ test.sus:807:33 ] + │ + 807 │ tree_add #(WIDTH: HALF_WIDTH) right + │ ──┬── + │ ╰──── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[1] +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[31] + ╭─[ test.sus:807:33 ] + │ + 807 │ tree_add #(WIDTH: HALF_WIDTH) right + │ ──┬── + │ ╰──── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[31] +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[3] + ╭─[ test.sus:807:33 ] + │ + 807 │ tree_add #(WIDTH: HALF_WIDTH) right + │ ──┬── + │ ╰──── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[3] +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[63] + ╭─[ test.sus:807:33 ] + │ + 807 │ tree_add #(WIDTH: HALF_WIDTH) right + │ ──┬── + │ ╰──── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[63] +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[7] + ╭─[ test.sus:807:33 ] + │ + 807 │ tree_add #(WIDTH: HALF_WIDTH) right + │ ──┬── + │ ╰──── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[7] +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] │ - 961 │ int[5] b = cr.out - │ ┬ - │ ╰── Unused Variable: This variable does not affect the output ports of this module + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ─────╯ -Warning: Unused Variable: This variable does not affect the output ports of this module - ╭─[ test.sus:965:9 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] │ - 965 │ int[5] arr - │ ─┬─ - │ ╰─── Unused Variable: This variable does not affect the output ports of this module + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ─────╯ -Warning: Unused Variable: This variable does not affect the output ports of this module - ╭─[ test.sus:974:6 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] │ - 974 │ int total = adder(arr) - │ ──┬── - │ ╰──── Unused Variable: This variable does not affect the output ports of this module + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:810:21 ] + │ + 810 │ left.values[i] = values[i] + │ ────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:811:22 ] + │ + 811 │ right.values[i] = values[i+HALF_WIDTH] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:817:14 ] + │ + 817 │ reg sum = left.sum + right.sum + values[WIDTH - 1] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:817:14 ] + │ + 817 │ reg sum = left.sum + right.sum + values[WIDTH - 1] + │ ────────────────────┬─────────────────── + │ ╰───────────────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:817:14 ] + │ + 817 │ reg sum = left.sum + right.sum + values[WIDTH - 1] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:817:14 ] + │ + 817 │ reg sum = left.sum + right.sum + values[WIDTH - 1] + │ ────────────────────┬─────────────────── + │ ╰───────────────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:817:14 ] + │ + 817 │ reg sum = left.sum + right.sum + values[WIDTH - 1] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:817:14 ] + │ + 817 │ reg sum = left.sum + right.sum + values[WIDTH - 1] + │ ────────────────────┬─────────────────── + │ ╰───────────────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:817:14 ] + │ + 817 │ reg sum = left.sum + right.sum + values[WIDTH - 1] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:817:14 ] + │ + 817 │ reg sum = left.sum + right.sum + values[WIDTH - 1] + │ ────────────────────┬─────────────────── + │ ╰───────────────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:817:14 ] + │ + 817 │ reg sum = left.sum + right.sum + values[WIDTH - 1] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:817:14 ] + │ + 817 │ reg sum = left.sum + right.sum + values[WIDTH - 1] + │ ────────────────────┬─────────────────── + │ ╰───────────────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:817:14 ] + │ + 817 │ reg sum = left.sum + right.sum + values[WIDTH - 1] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:817:14 ] + │ + 817 │ reg sum = left.sum + right.sum + values[WIDTH - 1] + │ ────────────────────┬─────────────────── + │ ╰───────────────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:817:14 ] + │ + 817 │ reg sum = left.sum + right.sum + values[WIDTH - 1] + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:817:14 ] + │ + 817 │ reg sum = left.sum + right.sum + values[WIDTH - 1] + │ ────────────────────┬─────────────────── + │ ╰───────────────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:817:37 ] + │ + 817 │ reg sum = left.sum + right.sum + values[WIDTH - 1] + │ ────────┬──────── + │ ╰────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:817:37 ] + │ + 817 │ reg sum = left.sum + right.sum + values[WIDTH - 1] + │ ────────┬──────── + │ ╰────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:817:37 ] + │ + 817 │ reg sum = left.sum + right.sum + values[WIDTH - 1] + │ ────────┬──────── + │ ╰────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:817:37 ] + │ + 817 │ reg sum = left.sum + right.sum + values[WIDTH - 1] + │ ────────┬──────── + │ ╰────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:817:37 ] + │ + 817 │ reg sum = left.sum + right.sum + values[WIDTH - 1] + │ ────────┬──────── + │ ╰────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:817:37 ] + │ + 817 │ reg sum = left.sum + right.sum + values[WIDTH - 1] + │ ────────┬──────── + │ ╰────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:817:37 ] + │ + 817 │ reg sum = left.sum + right.sum + values[WIDTH - 1] + │ ────────┬──────── + │ ╰────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Error instantiating submodule + ╭─[ test.sus:831:2 ] + │ + 831 │ tree_add #(WIDTH: SIZE) tr + │ ───────────┬─────────── + │ ╰───────────── Error instantiating submodule +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:831:26 ] + │ + 831 │ tree_add #(WIDTH: SIZE) tr + │ ─┬ + │ ╰── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:835:9 ] + │ + 835 │ output int beep = tr.sum + │ ────┬─── + │ ╰───── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +─────╯ +Error: Could not infer the parameters of this submodule, some parameters were still unknown: replicate #( + T: type int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[30], + NUM_REPLS: 20 +) + ╭─[ test.sus:851:46 ] + │ + 851 │ replicate #(NUM_REPLS: 20, T: type int[30]) b + │ ┬ + │ ╰── Could not infer the parameters of this submodule, some parameters were still unknown: replicate #( + T: type int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[30], + NUM_REPLS: 20 +) +─────╯ +Warning: Unused Variable: This variable does not affect the output ports of this module + ╭─[ test.sus:854:6 ] + │ + 854 │ int val = 3 + │ ─┬─ + │ ╰─── Unused Variable: This variable does not affect the output ports of this module +─────╯ +Warning: Unused Variable: This variable does not affect the output ports of this module + ╭─[ test.sus:857:10 ] + │ + 857 │ int[30] out = c.result + │ ─┬─ + │ ╰─── Unused Variable: This variable does not affect the output ports of this module +─────╯ +Warning: Unused Variable: This variable does not affect the output ports of this module + ╭─[ test.sus:869:13 ] + │ + 869 │ gen int[8] SOURCES = [3, 2, 4, 5, 1, 2, 7, 6] + │ ───┬─── + │ ╰───── Unused Variable: This variable does not affect the output ports of this module +─────╯ +Warning: Unused Variable: This variable does not affect the output ports of this module + ╭─[ test.sus:871:9 ] + │ + 871 │ int[2] inArr + │ ──┬── + │ ╰──── Unused Variable: This variable does not affect the output ports of this module +─────╯ +Warning: Unused Variable: This variable does not affect the output ports of this module + ╭─[ test.sus:878:9 ] + │ + 878 │ int[8] beep = permut.permute(SOURCES) + │ ──┬─ + │ ╰─── Unused Variable: This variable does not affect the output ports of this module +─────╯ +Warning: Unused Variable: This variable does not affect the output ports of this module + ╭─[ test.sus:882:28 ] + │ + 882 │ interface from : bool[32] instr + │ ──┬── + │ ╰──── Unused Variable: This variable does not affect the output ports of this module +─────╯ +Warning: Unused Variable: This variable does not affect the output ports of this module + ╭─[ test.sus:890:42 ] + │ + 890 │ interface run_instruction : bool[32] instr + │ ──┬── + │ ╰──── Unused Variable: This variable does not affect the output ports of this module +─────╯ +Error: Excess output targets. Function returns 0 results, but 1 targets were given. + ╭─[ test.sus:894:7 ] + │ + 883 │ interface is_jump + │ ───┬─── + │ ╰───── Interface 'is_jump' defined here + │ + 894 │ when decoder.is_jump() : int target_addr { + │ ────────┬──────── + │ ╰────────── Excess output targets. Function returns 0 results, but 1 targets were given. +─────╯ +Error: While parsing 'if_statement', parser found a syntax error in a node of type 'ERROR' + ╭─[ test.sus:894:25 ] + │ + 894 │ ╭─▶ when decoder.is_jump() : int target_addr { + │ │ ────────┬──────── + │ │ ╰────────── While parsing 'if_statement', parser found a syntax error in a node of type 'ERROR' + ┆ ┆ + 896 │ ├─▶ } + │ │ + │ ╰─────────── Parent node 'if_statement' +─────╯ +Error: Excess output targets. Function returns 0 results, but 1 targets were given. + ╭─[ test.sus:897:7 ] + │ + 884 │ interface is_load + │ ───┬─── + │ ╰───── Interface 'is_load' defined here + │ + 897 │ when decoder.is_load() : int reg_to, int addr { + │ ────────┬──────── + │ ╰────────── Excess output targets. Function returns 0 results, but 1 targets were given. +─────╯ +Error: While parsing 'if_statement', parser found a syntax error in a node of type 'ERROR' + ╭─[ test.sus:897:25 ] + │ + 897 │ ╭─▶ when decoder.is_load() : int reg_to, int addr { + │ │ ───────────┬────────── + │ │ ╰──────────── While parsing 'if_statement', parser found a syntax error in a node of type 'ERROR' + ┆ ┆ + 899 │ ├─▶ } + │ │ + │ ╰─────────── Parent node 'if_statement' +─────╯ +Warning: Used 'when' in a generative context, use 'if' instead + ╭─[ test.sus:900:2 ] + │ + 900 │ when decoder.is_arith() : int reg_a, int reg_b, Operator op { + │ ──┬─ + │ ╰─── Used 'when' in a generative context, use 'if' instead +─────╯ +Error: While parsing 'if_statement', parser found a syntax error in a node of type 'ERROR' + ╭─[ test.sus:900:7 ] + │ + 900 │ ╭─▶ when decoder.is_arith() : int reg_a, int reg_b, Operator op { + │ │ ─────────────────────────┬───────────────────────── + │ │ ╰─────────────────────────── While parsing 'if_statement', parser found a syntax error in a node of type 'ERROR' + ┆ ┆ + 902 │ ├─▶ } + │ │ + │ ╰─────────── Parent node 'if_statement' +─────╯ +Error: No Global of the name 'op' was found. Did you forget to import it? + ╭─[ test.sus:900:59 ] + │ + 900 │ when decoder.is_arith() : int reg_a, int reg_b, Operator op { + │ ─┬ + │ ╰── No Global of the name 'op' was found. Did you forget to import it? +─────╯ +Warning: Unused Variable: This variable does not affect the output ports of this module + ╭─[ test.sus:913:6 ] + │ + 913 │ int x = no_interface_named() + │ ┬ + │ ╰── Unused Variable: This variable does not affect the output ports of this module +─────╯ +Error: no_main_interface does not have a main interface. You should explicitly specify an interface to access + ╭─[ test.sus:913:10 ] + │ + 906 │ module no_main_interface { + │ ────────┬──────── + │ ╰────────── Module 'no_main_interface' defined here. module no_main_interface #(): +domain clk: + + │ + 913 │ int x = no_interface_named() + │ ─────────┬──────── + │ ╰────────── no_main_interface does not have a main interface. You should explicitly specify an interface to access +─────╯ +Warning: Unused Variable: This variable does not affect the output ports of this module + ╭─[ test.sus:914:6 ] + │ + 914 │ int y = no_main_interface() + │ ┬ + │ ╰── Unused Variable: This variable does not affect the output ports of this module +─────╯ +Error: no_main_interface does not have a main interface. You should explicitly specify an interface to access + ╭─[ test.sus:914:10 ] + │ + 906 │ module no_main_interface { + │ ────────┬──────── + │ ╰────────── Module 'no_main_interface' defined here. module no_main_interface #(): +domain clk: + + │ + 914 │ int y = no_main_interface() + │ ────────┬──────── + │ ╰────────── no_main_interface does not have a main interface. You should explicitly specify an interface to access +─────╯ +Error: Typing Error: array size expects a int but was given a bool + ╭─[ test.sus:918:6 ] + │ + 918 │ int[true] a + │ ──┬─ + │ ╰─── Typing Error: array size expects a int but was given a bool +─────╯ +Warning: Unused Variable: This variable does not affect the output ports of this module + ╭─[ test.sus:918:12 ] + │ + 918 │ int[true] a + │ ┬ + │ ╰── Unused Variable: This variable does not affect the output ports of this module +─────╯ +Error: Typing Error: array size expects a int but was given a bool + ╭─[ test.sus:922:41 ] + │ + 922 │ interface moduleWithBadInterface : int[true] a + │ ──┬─ + │ ╰─── Typing Error: array size expects a int but was given a bool +─────╯ +Warning: Unused Variable: This variable does not affect the output ports of this module + ╭─[ test.sus:922:47 ] + │ + 922 │ interface moduleWithBadInterface : int[true] a + │ ┬ + │ ╰── Unused Variable: This variable does not affect the output ports of this module +─────╯ +Warning: Unused Variable: This variable does not affect the output ports of this module + ╭─[ test.sus:926:9 ] + │ + 926 │ int[3] xyz + │ ─┬─ + │ ╰─── Unused Variable: This variable does not affect the output ports of this module +─────╯ +Error: Typing Error: reading from wire reference expects a bool but was given a int + ╭─[ test.sus:929:11 ] + │ + 929 │ xyz[3] = true + │ ──┬─ + │ ╰─── Typing Error: reading from wire reference expects a bool but was given a int +─────╯ +Error: While parsing 'block', parser found a syntax error in a node of type 'ERROR' + ╭─[ test.sus:935:2 ] + │ + 933 │ ╭─▶ const int SUM_UP #(int SIZE, int[SIZE] DATA) { + ┆ ┆ + 935 │ │ for I in 0..SIZE { + │ │ ────────┬─────── + │ │ ╰───────── While parsing 'block', parser found a syntax error in a node of type 'ERROR' + ┆ ┆ + 938 │ ├─▶ } + │ │ + │ ╰─────── Parent node 'block' +─────╯ +Error: No Global of the name 'I' was found. Did you forget to import it? + ╭─[ test.sus:936:29 ] + │ + 936 │ SUM_UP = SUM_UP + DATA[I] + │ ┬ + │ ╰── No Global of the name 'I' was found. Did you forget to import it? +─────╯ +Warning: Unused Variable: This variable does not affect the output ports of this module + ╭─[ test.sus:943:13 ] + │ + 943 │ gen int[5] DATA + │ ──┬─ + │ ╰─── Unused Variable: This variable does not affect the output ports of this module +─────╯ +Warning: Unused Variable: This variable does not affect the output ports of this module + ╭─[ test.sus:950:10 ] + │ + 950 │ gen int X = SUM_UP #(SIZE: 4, DATA, BEEEP: 3) + │ ┬ + │ ╰── Unused Variable: This variable does not affect the output ports of this module +─────╯ +Error: BEEEP is not a valid template argument of SUM_UP + ╭─[ test.sus:950:38 ] + │ + 933 │ const int SUM_UP #(int SIZE, int[SIZE] DATA) { + │ ───┬── + │ ╰──── 'SUM_UP' defined here + │ + 950 │ gen int X = SUM_UP #(SIZE: 4, DATA, BEEEP: 3) + │ ──┬── + │ ╰──── BEEEP is not a valid template argument of SUM_UP +─────╯ +Error: ABC does not name a Type or a Value. + ╭─[ test.sus:952:8 ] + │ + 952 │ int #(ABC) x + │ ─┬─ + │ ╰─── ABC does not name a Type or a Value. +─────╯ +Error: ABC is not a valid template argument of int + ╭─[ test.sus:952:8 ] + │ + 952 │ int #(ABC) x + │ ─┬─ + │ ╰─── ABC is not a valid template argument of int + │ + ├─[ core.sus:39:20 ] + │ + 39 │ __builtin__ struct int #(int MIN, int MAX) {} + │ ─┬─ + │ ╰─── 'int' defined here +─────╯ +Warning: Unused Variable: This variable does not affect the output ports of this module + ╭─[ test.sus:952:13 ] + │ + 952 │ int #(ABC) x + │ ┬ + │ ╰── Unused Variable: This variable does not affect the output ports of this module +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[5] + ╭─[ test.sus:956:2 ] + │ + 956 │ int[5] a + │ ────┬─── + │ ╰───── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[5] +─────╯ +Warning: Unused Variable: This variable does not affect the output ports of this module + ╭─[ test.sus:956:9 ] + │ + 956 │ int[5] a + │ ┬ + │ ╰── Unused Variable: This variable does not affect the output ports of this module +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[5] + ╭─[ test.sus:958:14 ] + │ + 958 │ CrossDomain cr + │ ─┬ + │ ╰── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[5] +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[5] + ╭─[ test.sus:958:14 ] + │ + 958 │ CrossDomain cr + │ ─┬ + │ ╰── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[5] +─────╯ +Error: Could not infer the parameters of this submodule, some parameters were still unknown: CrossDomain #( + T: type int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[5] +) + ╭─[ test.sus:958:14 ] + │ + 958 │ CrossDomain cr + │ ─┬ + │ ╰── Could not infer the parameters of this submodule, some parameters were still unknown: CrossDomain #( + T: type int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[5] +) +─────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[5] + ╭─[ test.sus:961:2 ] + │ + 961 │ int[5] b = cr.out + │ ────┬─── + │ ╰───── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[5] +─────╯ +Warning: Unused Variable: This variable does not affect the output ports of this module + ╭─[ test.sus:961:9 ] + │ + 961 │ int[5] b = cr.out + │ ┬ + │ ╰── Unused Variable: This variable does not affect the output ports of this module +─────╯ +Warning: Unused Variable: This variable does not affect the output ports of this module + ╭─[ test.sus:965:9 ] + │ + 965 │ int[5] arr + │ ─┬─ + │ ╰─── Unused Variable: This variable does not affect the output ports of this module +─────╯ +Warning: Unused Variable: This variable does not affect the output ports of this module + ╭─[ test.sus:974:6 ] + │ + 974 │ int total = adder(arr) + │ ──┬── + │ ╰──── Unused Variable: This variable does not affect the output ports of this module +─────╯ +Warning: Unused Variable: This variable does not affect the output ports of this module + ╭─[ test.sus:1006:12 ] + │ + 1006 │ input int bad_port + │ ────┬─── + │ ╰───── Unused Variable: This variable does not affect the output ports of this module +──────╯ +Error: When using explicit domains, no port is allowed to be declared on the implicit 'clk' domain. + ╭─[ test.sus:1008:2 ] + │ + 1006 │ input int bad_port + │ ──────┬───── + │ ╰─────── A domain should be explicitly defined before this port + │ + 1008 │ domain bad_domain + │ ────────┬──────── + │ ╰────────── When using explicit domains, no port is allowed to be declared on the implicit 'clk' domain. +──────╯ +Error: This declaration conflicts with a previous declaration in the same scope + ╭─[ test.sus:1015:12 ] + │ + 1014 │ domain my_domain + │ ────┬──── + │ ╰────── Domain 'my_domain' declared here + 1015 │ input int my_domain + │ ────┬──── + │ ╰────── This declaration conflicts with a previous declaration in the same scope +──────╯ +Warning: Unused Variable: This variable does not affect the output ports of this module + ╭─[ test.sus:1015:12 ] + │ + 1015 │ input int my_domain + │ ────┬──── + │ ╰────── Unused Variable: This variable does not affect the output ports of this module +──────╯ +Error: Conflicting domain declaration. Domain 'my_domain' was already declared earlier + ╭─[ test.sus:1017:9 ] + │ + 1014 │ domain my_domain + │ ────┬──── + │ ╰────── Domain 'my_domain' declared here + │ + 1017 │ domain my_domain + │ ────┬──── + │ ╰────── Conflicting domain declaration. Domain 'my_domain' was already declared earlier +──────╯ +Error: Could not fully figure out the type of this object. type_variable_0[...peano_variable_0] + ╭─[ test.sus:1027:2 ] + │ + 1027 │ make_infinite_type_help mtinf + │ ───────────┬─────────── + │ ╰───────────── Could not fully figure out the type of this object. type_variable_0[...peano_variable_0] +──────╯ +Error: Could not fully figure out the type of this object. type_variable_0[][...peano_variable_0] + ╭─[ test.sus:1029:2 ] + │ + 1029 │ mtinf.a = mtinf.b + │ ───┬─── + │ ╰───── Could not fully figure out the type of this object. type_variable_0[][...peano_variable_0] +──────╯ +Error: Could not fully figure out the type of this object. type_variable_0[...peano_variable_0] + ╭─[ test.sus:1029:12 ] + │ + 1029 │ mtinf.a = mtinf.b + │ ───┬─── + │ ╰───── Could not fully figure out the type of this object. type_variable_0[...peano_variable_0] +──────╯ +Error: Typing Error: reading from wire reference: Creating Infinite Types is Forbidden! expects a type_variable_0[...peano_variable_0] but was given a type_variable_0[][...peano_variable_0] + ╭─[ test.sus:1029:12 ] + │ + 1029 │ mtinf.a = mtinf.b + │ ───┬─── + │ ╰───── Typing Error: reading from wire reference: Creating Infinite Types is Forbidden! expects a type_variable_0[...peano_variable_0] but was given a type_variable_0[][...peano_variable_0] +──────╯ +Warning: Unused Variable: This variable does not affect the output ports of this module + ╭─[ test.sus:1036:8 ] + │ + 1036 │ bool do_write'0, + │ ────┬─── + │ ╰───── Unused Variable: This variable does not affect the output ports of this module +──────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1037:3 ] + │ + 1037 │ int addr'0, + │ ─────┬──── + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +──────╯ +Warning: Unused Variable: This variable does not affect the output ports of this module + ╭─[ test.sus:1038:13 ] + │ + 1038 │ bool[500] data'0 -> + │ ──┬─ + │ ╰─── Unused Variable: This variable does not affect the output ports of this module +──────╯ +Error: Could not infer the parameters of this submodule, some parameters were still unknown: FIFO #( + T: type int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +), + DEPTH: 3, + READY_SLACK: 5 +) + ╭─[ test.sus:1049:48 ] + │ + 1049 │ FIFO #(DEPTH: 3, READY_SLACK: 5, T: type int) f + │ ┬ + │ ╰── Could not infer the parameters of this submodule, some parameters were still unknown: FIFO #( + T: type int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +), + DEPTH: 3, + READY_SLACK: 5 +) +──────╯ +Warning: Unused Variable: This variable does not affect the output ports of this module + ╭─[ test.sus:1053:35 ] + │ + 1053 │ interface start_iteration : bool do_start + │ ────┬─── + │ ╰───── Unused Variable: This variable does not affect the output ports of this module +──────╯ +Error: Used 'if' in a non generative context, use 'when' instead + ╭─[ test.sus:1064:2 ] + │ + 1064 │ if iter_valid { + │ ─┬ + │ ╰── Used 'if' in a non generative context, use 'when' instead +──────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[20] + ╭─[ test.sus:1070:2 ] + │ + 1070 │ int[20] arr + │ ─────┬───── + │ ╰─────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[20] +──────╯ +Warning: Unused Variable: This variable does not affect the output ports of this module + ╭─[ test.sus:1070:10 ] + │ + 1070 │ int[20] arr + │ ─┬─ + │ ╰─── Unused Variable: This variable does not affect the output ports of this module +──────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[5] + ╭─[ test.sus:1072:2 ] + │ + 1072 │ int[5] subArr = Slice #(SIZE: 20, OUT_SIZE: 5, FROM: 3, T: type int)(arr) + │ ──────┬────── + │ ╰──────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[5] +──────╯ +Warning: Unused Variable: This variable does not affect the output ports of this module + ╭─[ test.sus:1072:9 ] + │ + 1072 │ int[5] subArr = Slice #(SIZE: 20, OUT_SIZE: 5, FROM: 3, T: type int)(arr) + │ ───┬── + │ ╰──── Unused Variable: This variable does not affect the output ports of this module +──────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[20] + ╭─[ test.sus:1072:18 ] + │ + 1072 │ int[5] subArr = Slice #(SIZE: 20, OUT_SIZE: 5, FROM: 3, T: type int)(arr) + │ ──────────────────────────┬───────────────────────── + │ ╰─────────────────────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[20] +──────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[5] + ╭─[ test.sus:1072:18 ] + │ + 1072 │ int[5] subArr = Slice #(SIZE: 20, OUT_SIZE: 5, FROM: 3, T: type int)(arr) + │ ──────────────────────────┬───────────────────────── + │ ╰─────────────────────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[5] +──────╯ +Error: Could not infer the parameters of this submodule, some parameters were still unknown: Slice #( + T: type int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +), + SIZE: 20, + OUT_SIZE: 5, + FROM: 3 +) + ╭─[ test.sus:1072:18 ] + │ + 1072 │ int[5] subArr = Slice #(SIZE: 20, OUT_SIZE: 5, FROM: 3, T: type int)(arr) + │ ──────────────────────────┬───────────────────────── + │ ╰─────────────────────────── Could not infer the parameters of this submodule, some parameters were still unknown: Slice #( + T: type int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +), + SIZE: 20, + OUT_SIZE: 5, + FROM: 3 +) +──────╯ +Error: For executing compile-time constants, all arguments must be fully specified. In this case, the arguments 'T' were not specified + ╭─[ test.sus:1077:25 ] + │ + 1077 │ gen int INT_ARR_SIZE = sizeof #(T: type int[10][10]) + │ ──────────────┬────────────── + │ ╰──────────────── For executing compile-time constants, all arguments must be fully specified. In this case, the arguments 'T' were not specified +──────╯ +Warning: The result of this expression is not used. Only function calls can return nothing. + ╭─[ test.sus:1079:2 ] + │ + 1079 │ assert #(C: INT_ARR_SIZE == 3200) + │ ────────────────┬──────────────── + │ ╰────────────────── The result of this expression is not used. Only function calls can return nothing. +──────╯ +Warning: The result of this expression is not used. Only function calls can return nothing. + ╭─[ test.sus:1081:2 ] + │ + 1081 │ assert #(C: clog2 #(V: 15) == 4) + │ ────────────────┬─────────────── + │ ╰───────────────── The result of this expression is not used. Only function calls can return nothing. +──────╯ +Warning: The result of this expression is not used. Only function calls can return nothing. + ╭─[ test.sus:1082:2 ] + │ + 1082 │ assert #(C: clog2 #(V: 16) == 4) + │ ────────────────┬─────────────── + │ ╰───────────────── The result of this expression is not used. Only function calls can return nothing. +──────╯ +Warning: The result of this expression is not used. Only function calls can return nothing. + ╭─[ test.sus:1083:2 ] + │ + 1083 │ assert #(C: clog2 #(V: 17) == 5) + │ ────────────────┬─────────────── + │ ╰───────────────── The result of this expression is not used. Only function calls can return nothing. +──────╯ +Error: Assertion failed + ╭─[ test.sus:1087:2 ] + │ + 1087 │ assert #(C: 15 + 3 == 19) + │ ────────────┬──────────── + │ ╰────────────── Assertion failed +──────╯ +Warning: The result of this expression is not used. Only function calls can return nothing. + ╭─[ test.sus:1087:2 ] + │ + 1087 │ assert #(C: 15 + 3 == 19) + │ ────────────┬──────────── + │ ╰────────────── The result of this expression is not used. Only function calls can return nothing. +──────╯ +Warning: Used 'when' in a generative context, use 'if' instead + ╭─[ test.sus:1098:2 ] + │ + 1098 │ when WIDTH <= BASE_CASE_SIZE { + │ ──┬─ + │ ╰─── Used 'when' in a generative context, use 'if' instead +──────╯ +Error: Used 'if' in a non generative context, use 'when' instead + ╭─[ test.sus:1101:4 ] + │ + 1101 │ if bits[I] { + │ ─┬ + │ ╰── Used 'if' in a non generative context, use 'when' instead +──────╯ +Error: Used 'if' in a non generative context, use 'when' instead + ╭─[ test.sus:1103:11 ] + │ + 1103 │ } else if !bits[I] { + │ ─┬ + │ ╰── Used 'if' in a non generative context, use 'when' instead +──────╯ +Warning: Used 'when' in a generative context, use 'if' instead + ╭─[ test.sus:1108:9 ] + │ + 1108 │ } else when WIDTH > BASE_CASE_SIZE { + │ ──┬─ + │ ╰─── Used 'when' in a generative context, use 'if' instead +──────╯ +Error: This port is not strongly connected to the strongly connected port cluster 'a', 'b'. +An input and output port are strongly connected if there is a direct dependency path from the input port to the output port. +Strongly connected ports are also transitive. +If you do not wish to change your design, then 'virtually' connect this port to the strongly connected cluster by explicitly annotating its absolute latency. + ╭─[ test.sus:1114:21 ] + │ + 1113 │ interface x : bool a -> bool b + │ ┬ ┬ + │ ╰──────────── 'a' declared here + │ │ + │ ╰── 'b' declared here + 1114 │ interface y : bool c -> bool d + │ ┬ + │ ╰── This port is not strongly connected to the strongly connected port cluster 'a', 'b'. +An input and output port are strongly connected if there is a direct dependency path from the input port to the output port. +Strongly connected ports are also transitive. +If you do not wish to change your design, then 'virtually' connect this port to the strongly connected cluster by explicitly annotating its absolute latency. +──────╯ +Error: This port is not strongly connected to the strongly connected port cluster 'a', 'b'. +An input and output port are strongly connected if there is a direct dependency path from the input port to the output port. +Strongly connected ports are also transitive. +If you do not wish to change your design, then 'virtually' connect this port to the strongly connected cluster by explicitly annotating its absolute latency. + ╭─[ test.sus:1114:31 ] + │ + 1113 │ interface x : bool a -> bool b + │ ┬ ┬ + │ ╰──────────── 'a' declared here + │ │ + │ ╰── 'b' declared here + 1114 │ interface y : bool c -> bool d + │ ┬ + │ ╰── This port is not strongly connected to the strongly connected port cluster 'a', 'b'. +An input and output port are strongly connected if there is a direct dependency path from the input port to the output port. +Strongly connected ports are also transitive. +If you do not wish to change your design, then 'virtually' connect this port to the strongly connected cluster by explicitly annotating its absolute latency. +──────╯ +Error: This port is not strongly connected to the strongly connected port cluster 'a', 'b'. +An input and output port are strongly connected if there is a direct dependency path from the input port to the output port. +Strongly connected ports are also transitive. +If you do not wish to change your design, then 'virtually' connect this port to the strongly connected cluster by explicitly annotating its absolute latency. + ╭─[ test.sus:1124:21 ] + │ + 1123 │ interface x : bool a -> bool b + │ ┬ ┬ + │ ╰──────────── 'a' declared here + │ │ + │ ╰── 'b' declared here + 1124 │ interface y : bool c -> bool d + │ ┬ + │ ╰── This port is not strongly connected to the strongly connected port cluster 'a', 'b'. +An input and output port are strongly connected if there is a direct dependency path from the input port to the output port. +Strongly connected ports are also transitive. +If you do not wish to change your design, then 'virtually' connect this port to the strongly connected cluster by explicitly annotating its absolute latency. +──────╯ +Error: This port is not strongly connected to the strongly connected port cluster 'a', 'b'. +An input and output port are strongly connected if there is a direct dependency path from the input port to the output port. +Strongly connected ports are also transitive. +If you do not wish to change your design, then 'virtually' connect this port to the strongly connected cluster by explicitly annotating its absolute latency. + ╭─[ test.sus:1124:31 ] + │ + 1123 │ interface x : bool a -> bool b + │ ┬ ┬ + │ ╰──────────── 'a' declared here + │ │ + │ ╰── 'b' declared here + 1124 │ interface y : bool c -> bool d + │ ┬ + │ ╰── This port is not strongly connected to the strongly connected port cluster 'a', 'b'. +An input and output port are strongly connected if there is a direct dependency path from the input port to the output port. +Strongly connected ports are also transitive. +If you do not wish to change your design, then 'virtually' connect this port to the strongly connected cluster by explicitly annotating its absolute latency. +──────╯ +Warning: Unused Variable: This variable does not affect the output ports of this module + ╭─[ test.sus:1128:11 ] + │ + 1128 │ reg bool a_delayed = a + │ ────┬──── + │ ╰────── Unused Variable: This variable does not affect the output ports of this module +──────╯ +Warning: Unused Variable: This variable does not affect the output ports of this module + ╭─[ test.sus:1130:7 ] + │ + 1130 │ bool out_shared = a_delayed ^ c + │ ─────┬──── + │ ╰────── Unused Variable: This variable does not affect the output ports of this module +──────╯ +Error: Excess argument. Function takes 1 args, but 2 were passed. + ╭─[ test.sus:1140:47 ] + │ + 1140 │ out_val = infer_me(in_val | (in_val_2 == 0), in_val_2) + │ ────┬─── + │ ╰───── Excess argument. Function takes 1 args, but 2 were passed. + │ + 1145 │ interface infer_me : bool x'0 -> bool y'A + │ ────┬─── + │ ╰───── Interface 'infer_me' defined here +──────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1160:8 ] + │ + 1160 │ input int data_received'3 + │ ─────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +──────╯ +Warning: Unused Variable: This variable does not affect the output ports of this module + ╭─[ test.sus:1160:12 ] + │ + 1160 │ input int data_received'3 + │ ──────┬────── + │ ╰──────── Unused Variable: This variable does not affect the output ports of this module +──────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1162:20 ] + │ + 1162 │ FIFO #(DEPTH: 30) fifo + │ ──┬─ + │ ╰─── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +──────╯ +Error: Could not infer the parameters of this submodule, some parameters were still unknown: FIFO #( + T: type int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +), + DEPTH: 30, + READY_SLACK: /* Could not infer */ +) + ╭─[ test.sus:1162:20 ] + │ + 1162 │ FIFO #(DEPTH: 30) fifo + │ ──┬─ + │ ╰─── Could not infer the parameters of this submodule, some parameters were still unknown: FIFO #( + T: type int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +), + DEPTH: 30, + READY_SLACK: /* Could not infer */ +) +──────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1166:23 ] + │ + 1166 │ reg reg reg reg reg int heavy_computation = data_received + │ ──────────┬────────── + │ ╰──────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +──────╯ Warning: Unused Variable: This variable does not affect the output ports of this module - ╭─[ test.sus:1006:12 ] + ╭─[ test.sus:1166:27 ] │ - 1006 │ input int bad_port - │ ────┬─── - │ ╰───── Unused Variable: This variable does not affect the output ports of this module + 1166 │ reg reg reg reg reg int heavy_computation = data_received + │ ────────┬──────── + │ ╰────────── Unused Variable: This variable does not affect the output ports of this module ──────╯ -Error: When using explicit domains, no port is allowed to be declared on the implicit 'clk' domain. - ╭─[ test.sus:1008:2 ] +Error: Could not infer the parameters of this submodule, some parameters were still unknown: infer_me #( + A: /* Could not infer */ +) + ╭─[ test.sus:1187:11 ] │ - 1006 │ input int bad_port - │ ──────┬───── - │ ╰─────── A domain should be explicitly defined before this port - │ - 1008 │ domain bad_domain - │ ────────┬──────── - │ ╰────────── When using explicit domains, no port is allowed to be declared on the implicit 'clk' domain. + 1187 │ infer_me x + │ ┬ + │ ╰── Could not infer the parameters of this submodule, some parameters were still unknown: infer_me #( + A: /* Could not infer */ +) ──────╯ -Error: This declaration conflicts with a previous declaration in the same scope - ╭─[ test.sus:1015:12 ] +Error: Could not infer the parameters of this submodule, some parameters were still unknown: infer_me #( + A: /* Could not infer */ +) + ╭─[ test.sus:1188:11 ] │ - 1014 │ domain my_domain - │ ────┬──── - │ ╰────── Domain 'my_domain' declared here - 1015 │ input int my_domain - │ ────┬──── - │ ╰────── This declaration conflicts with a previous declaration in the same scope + 1188 │ infer_me y + │ ┬ + │ ╰── Could not infer the parameters of this submodule, some parameters were still unknown: infer_me #( + A: /* Could not infer */ +) ──────╯ Warning: Unused Variable: This variable does not affect the output ports of this module - ╭─[ test.sus:1015:12 ] + ╭─[ test.sus:1199:7 ] │ - 1015 │ input int my_domain + 1199 │ bool in_spec'0 = in_port + │ ───┬─── + │ ╰───── Unused Variable: This variable does not affect the output ports of this module +──────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[10][6][2] + ╭─[ test.sus:1206:29 ] + │ + 1206 │ interface testArrayWrite : int[10][6][2] in_arr -> int[10][6] out_arr + │ ──────────┬───────── + │ ╰─────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[10][6][2] +──────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[10][6] + ╭─[ test.sus:1206:53 ] + │ + 1206 │ interface testArrayWrite : int[10][6][2] in_arr -> int[10][6] out_arr + │ ─────────┬──────── + │ ╰────────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[10][6] +──────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[10][6] + ╭─[ test.sus:1208:12 ] + │ + 1208 │ out_arr = in_arr[0] │ ────┬──── - │ ╰────── Unused Variable: This variable does not affect the output ports of this module + │ ╰────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[10][6] ──────╯ -Error: Conflicting domain declaration. Domain 'my_domain' was already declared earlier - ╭─[ test.sus:1017:9 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1210:18 ] │ - 1014 │ domain my_domain - │ ────┬──── - │ ╰────── Domain 'my_domain' declared here - │ - 1017 │ domain my_domain - │ ────┬──── - │ ╰────── Conflicting domain declaration. Domain 'my_domain' was already declared earlier + 1210 │ out_arr[5][9] = in_arr[0][5][9] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ──────╯ -Error: Could not fully figure out the type of this object. type_variable_0[...peano_variable_0] - ╭─[ test.sus:1027:2 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - 1027 │ make_infinite_type_help mtinf - │ ───────────┬─────────── - │ ╰───────────── Could not fully figure out the type of this object. type_variable_0[...peano_variable_0] + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ──────╯ -Error: Could not fully figure out the type of this object. type_variable_0[...peano_variable_0] - ╭─[ test.sus:1029:2 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - 1029 │ mtinf.a = mtinf.b - │ ───┬─── - │ ╰───── Could not fully figure out the type of this object. type_variable_0[...peano_variable_0] + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ──────╯ -Error: Typing Error: variable reference: Creating Infinite Types is Forbidden! expects a type_variable_0[][...peano_variable_0] but was given a type_variable_0[...peano_variable_0] - ╭─[ test.sus:1029:2 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - 1029 │ mtinf.a = mtinf.b - │ ───┬─── - │ ╰───── Typing Error: variable reference: Creating Infinite Types is Forbidden! expects a type_variable_0[][...peano_variable_0] but was given a type_variable_0[...peano_variable_0] + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ──────╯ -Warning: Unused Variable: This variable does not affect the output ports of this module - ╭─[ test.sus:1036:8 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - 1036 │ bool do_write'0, - │ ────┬─── - │ ╰───── Unused Variable: This variable does not affect the output ports of this module + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ──────╯ -Warning: Unused Variable: This variable does not affect the output ports of this module - ╭─[ test.sus:1038:13 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - 1038 │ bool[500] data'0 -> - │ ──┬─ - │ ╰─── Unused Variable: This variable does not affect the output ports of this module + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ──────╯ -Warning: Unused port 'ready' - ╭─[ test.sus:1049:2 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - 1049 │ FIFO #(DEPTH: 3, READY_SLACK: 5, T: type int) f - │ ──────────────────────┬────────────────────── ┬ - │ ╰────────────────────────── Unused port 'ready' - │ │ - │ ╰── f declared here + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +──────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - ├─[ util.sus:36:14 ] + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +──────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - 36 │ output bool ready'0 - │ ──┬── - │ ╰──── Port 'ready' declared here + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +──────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] + │ + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ──────╯ -Warning: Unused port 'push' - ╭─[ test.sus:1049:2 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - 1049 │ FIFO #(DEPTH: 3, READY_SLACK: 5, T: type int) f - │ ──────────────────────┬────────────────────── ┬ - │ ╰────────────────────────── Unused port 'push' - │ │ - │ ╰── f declared here + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +──────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - ├─[ util.sus:37:24 ] + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +──────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - 37 │ interface push : bool push'READY_SLACK, T data_in'READY_SLACK - │ ──┬─ - │ ╰─── Port 'push' declared here + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ──────╯ -Warning: Unused port 'data_in' - ╭─[ test.sus:1049:2 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - 1049 │ FIFO #(DEPTH: 3, READY_SLACK: 5, T: type int) f - │ ──────────────────────┬────────────────────── ┬ - │ ╰────────────────────────── Unused port 'data_in' - │ │ - │ ╰── f declared here + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +──────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - ├─[ util.sus:37:44 ] + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +──────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - 37 │ interface push : bool push'READY_SLACK, T data_in'READY_SLACK - │ ───┬─── - │ ╰───── Port 'data_in' declared here + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ──────╯ -Warning: Unused port 'pop' - ╭─[ test.sus:1049:2 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - 1049 │ FIFO #(DEPTH: 3, READY_SLACK: 5, T: type int) f - │ ──────────────────────┬────────────────────── ┬ - │ ╰────────────────────────── Unused port 'pop' - │ │ - │ ╰── f declared here + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +──────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - ├─[ util.sus:40:23 ] + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +──────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - 40 │ interface pop : bool pop -> bool data_valid, T data_out - │ ─┬─ - │ ╰─── Port 'pop' declared here + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ──────╯ -Warning: Unused port 'data_valid' - ╭─[ test.sus:1049:2 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - 1049 │ FIFO #(DEPTH: 3, READY_SLACK: 5, T: type int) f - │ ──────────────────────┬────────────────────── ┬ - │ ╰────────────────────────── Unused port 'data_valid' - │ │ - │ ╰── f declared here + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +──────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - ├─[ util.sus:40:35 ] + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +──────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - 40 │ interface pop : bool pop -> bool data_valid, T data_out - │ ─────┬──── - │ ╰────── Port 'data_valid' declared here + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ──────╯ -Warning: Unused port 'data_out' - ╭─[ test.sus:1049:2 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - 1049 │ FIFO #(DEPTH: 3, READY_SLACK: 5, T: type int) f - │ ──────────────────────┬────────────────────── ┬ - │ ╰────────────────────────── Unused port 'data_out' - │ │ - │ ╰── f declared here + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +──────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - ├─[ util.sus:40:49 ] + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +──────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - 40 │ interface pop : bool pop -> bool data_valid, T data_out - │ ────┬─── - │ ╰───── Port 'data_out' declared here + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ──────╯ -Warning: Unused Variable: This variable does not affect the output ports of this module - ╭─[ test.sus:1053:35 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - 1053 │ interface start_iteration : bool do_start - │ ────┬─── - │ ╰───── Unused Variable: This variable does not affect the output ports of this module + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ──────╯ -Error: Used 'if' in a non generative context, use 'when' instead - ╭─[ test.sus:1064:2 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - 1064 │ if iter_valid { - │ ─┬ - │ ╰── Used 'if' in a non generative context, use 'when' instead + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ──────╯ -Warning: Unused Variable: This variable does not affect the output ports of this module - ╭─[ test.sus:1070:10 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - 1070 │ int[20] arr - │ ─┬─ - │ ╰─── Unused Variable: This variable does not affect the output ports of this module + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ──────╯ -Warning: Unused Variable: This variable does not affect the output ports of this module - ╭─[ test.sus:1072:9 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - 1072 │ int[5] subArr = Slice #(SIZE: 20, OUT_SIZE: 5, FROM: 3, T: type int)(arr) - │ ───┬── - │ ╰──── Unused Variable: This variable does not affect the output ports of this module + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ──────╯ -Error: Assertion failed - ╭─[ test.sus:1087:2 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - 1087 │ assert #(C: 15 + 3 == 19) - │ ────────────┬──────────── - │ ╰────────────── Assertion failed + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ──────╯ -Warning: Used 'when' in a generative context, use 'if' instead - ╭─[ test.sus:1098:2 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - 1098 │ when WIDTH <= BASE_CASE_SIZE { - │ ──┬─ - │ ╰─── Used 'when' in a generative context, use 'if' instead + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ──────╯ -Error: Used 'if' in a non generative context, use 'when' instead - ╭─[ test.sus:1101:4 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - 1101 │ if bits[I] { - │ ─┬ - │ ╰── Used 'if' in a non generative context, use 'when' instead + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ──────╯ -Error: Used 'if' in a non generative context, use 'when' instead - ╭─[ test.sus:1103:11 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - 1103 │ } else if !bits[I] { - │ ─┬ - │ ╰── Used 'if' in a non generative context, use 'when' instead + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ──────╯ -Warning: Used 'when' in a generative context, use 'if' instead - ╭─[ test.sus:1108:9 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - 1108 │ } else when WIDTH > BASE_CASE_SIZE { - │ ──┬─ - │ ╰─── Used 'when' in a generative context, use 'if' instead + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ──────╯ -Error: This port is not strongly connected to the strongly connected port cluster 'a', 'b'. -An input and output port are strongly connected if there is a direct dependency path from the input port to the output port. -Strongly connected ports are also transitive. -If you do not wish to change your design, then 'virtually' connect this port to the strongly connected cluster by explicitly annotating its absolute latency. - ╭─[ test.sus:1114:21 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] + │ + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +──────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - 1113 │ interface x : bool a -> bool b - │ ┬ ┬ - │ ╰──────────── 'a' declared here - │ │ - │ ╰── 'b' declared here - 1114 │ interface y : bool c -> bool d - │ ┬ - │ ╰── This port is not strongly connected to the strongly connected port cluster 'a', 'b'. -An input and output port are strongly connected if there is a direct dependency path from the input port to the output port. -Strongly connected ports are also transitive. -If you do not wish to change your design, then 'virtually' connect this port to the strongly connected cluster by explicitly annotating its absolute latency. + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ──────╯ -Error: This port is not strongly connected to the strongly connected port cluster 'a', 'b'. -An input and output port are strongly connected if there is a direct dependency path from the input port to the output port. -Strongly connected ports are also transitive. -If you do not wish to change your design, then 'virtually' connect this port to the strongly connected cluster by explicitly annotating its absolute latency. - ╭─[ test.sus:1114:31 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - 1113 │ interface x : bool a -> bool b - │ ┬ ┬ - │ ╰──────────── 'a' declared here - │ │ - │ ╰── 'b' declared here - 1114 │ interface y : bool c -> bool d - │ ┬ - │ ╰── This port is not strongly connected to the strongly connected port cluster 'a', 'b'. -An input and output port are strongly connected if there is a direct dependency path from the input port to the output port. -Strongly connected ports are also transitive. -If you do not wish to change your design, then 'virtually' connect this port to the strongly connected cluster by explicitly annotating its absolute latency. + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ──────╯ -Error: This port is not strongly connected to the strongly connected port cluster 'a', 'b'. -An input and output port are strongly connected if there is a direct dependency path from the input port to the output port. -Strongly connected ports are also transitive. -If you do not wish to change your design, then 'virtually' connect this port to the strongly connected cluster by explicitly annotating its absolute latency. - ╭─[ test.sus:1124:21 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - 1123 │ interface x : bool a -> bool b - │ ┬ ┬ - │ ╰──────────── 'a' declared here - │ │ - │ ╰── 'b' declared here - 1124 │ interface y : bool c -> bool d - │ ┬ - │ ╰── This port is not strongly connected to the strongly connected port cluster 'a', 'b'. -An input and output port are strongly connected if there is a direct dependency path from the input port to the output port. -Strongly connected ports are also transitive. -If you do not wish to change your design, then 'virtually' connect this port to the strongly connected cluster by explicitly annotating its absolute latency. + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ──────╯ -Error: This port is not strongly connected to the strongly connected port cluster 'a', 'b'. -An input and output port are strongly connected if there is a direct dependency path from the input port to the output port. -Strongly connected ports are also transitive. -If you do not wish to change your design, then 'virtually' connect this port to the strongly connected cluster by explicitly annotating its absolute latency. - ╭─[ test.sus:1124:31 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - 1123 │ interface x : bool a -> bool b - │ ┬ ┬ - │ ╰──────────── 'a' declared here - │ │ - │ ╰── 'b' declared here - 1124 │ interface y : bool c -> bool d - │ ┬ - │ ╰── This port is not strongly connected to the strongly connected port cluster 'a', 'b'. -An input and output port are strongly connected if there is a direct dependency path from the input port to the output port. -Strongly connected ports are also transitive. -If you do not wish to change your design, then 'virtually' connect this port to the strongly connected cluster by explicitly annotating its absolute latency. + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ──────╯ -Warning: Unused Variable: This variable does not affect the output ports of this module - ╭─[ test.sus:1128:11 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - 1128 │ reg bool a_delayed = a - │ ────┬──── - │ ╰────── Unused Variable: This variable does not affect the output ports of this module + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ──────╯ -Warning: Unused Variable: This variable does not affect the output ports of this module - ╭─[ test.sus:1130:7 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - 1130 │ bool out_shared = a_delayed ^ c - │ ─────┬──── - │ ╰────── Unused Variable: This variable does not affect the output ports of this module + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ──────╯ -Error: Excess argument. Function takes 1 args, but 2 were passed. - ╭─[ test.sus:1140:47 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - 1140 │ out_val = infer_me(in_val | (in_val_2 == 0), in_val_2) - │ ────┬─── - │ ╰───── Excess argument. Function takes 1 args, but 2 were passed. - │ - 1145 │ interface infer_me : bool x'0 -> bool y'A - │ ────┬─── - │ ╰───── Interface 'infer_me' defined here + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ──────╯ -Warning: Unused Variable: This variable does not affect the output ports of this module - ╭─[ test.sus:1160:12 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - 1160 │ input int data_received'3 - │ ──────┬────── - │ ╰──────── Unused Variable: This variable does not affect the output ports of this module + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ──────╯ -Warning: Unused port 'pop' - ╭─[ test.sus:1162:2 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - 1162 │ FIFO #(DEPTH: 30) fifo - │ ────────┬──────── ──┬─ - │ ╰─────────────── Unused port 'pop' - │ │ - │ ╰─── fifo declared here + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +──────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - ├─[ util.sus:40:23 ] + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +──────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - 40 │ interface pop : bool pop -> bool data_valid, T data_out - │ ─┬─ - │ ╰─── Port 'pop' declared here + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ──────╯ -Warning: Unused port 'data_valid' - ╭─[ test.sus:1162:2 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - 1162 │ FIFO #(DEPTH: 30) fifo - │ ────────┬──────── ──┬─ - │ ╰─────────────── Unused port 'data_valid' - │ │ - │ ╰─── fifo declared here + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +──────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - ├─[ util.sus:40:35 ] + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +──────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - 40 │ interface pop : bool pop -> bool data_valid, T data_out - │ ─────┬──── - │ ╰────── Port 'data_valid' declared here + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ──────╯ -Warning: Unused port 'data_out' - ╭─[ test.sus:1162:2 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - 1162 │ FIFO #(DEPTH: 30) fifo - │ ────────┬──────── ──┬─ - │ ╰─────────────── Unused port 'data_out' - │ │ - │ ╰─── fifo declared here + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +──────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - ├─[ util.sus:40:49 ] + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +──────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - 40 │ interface pop : bool pop -> bool data_valid, T data_out - │ ────┬─── - │ ╰───── Port 'data_out' declared here + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ──────╯ -Warning: Unused Variable: This variable does not affect the output ports of this module - ╭─[ test.sus:1166:27 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - 1166 │ reg reg reg reg reg int heavy_computation = data_received - │ ────────┬──────── - │ ╰────────── Unused Variable: This variable does not affect the output ports of this module + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ──────╯ -Error: Could not fully instantiate ::infer_me #( - A: /* Could not infer */ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ ) - ╭─[ test.sus:1187:11 ] + ╭─[ test.sus:1214:20 ] │ - 1187 │ infer_me x - │ ┬ - │ ╰── Could not fully instantiate ::infer_me #( - A: /* Could not infer */ + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ ) ──────╯ -Error: Could not fully instantiate ::infer_me #( - A: /* Could not infer */ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ ) - ╭─[ test.sus:1188:11 ] + ╭─[ test.sus:1214:20 ] │ - 1188 │ infer_me y - │ ┬ - │ ╰── Could not fully instantiate ::infer_me #( - A: /* Could not infer */ + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ ) ──────╯ -Warning: Unused Variable: This variable does not affect the output ports of this module - ╭─[ test.sus:1199:7 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - 1199 │ bool in_spec'0 = in_port - │ ───┬─── - │ ╰───── Unused Variable: This variable does not affect the output ports of this module + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ──────╯ -Error: Could not fully instantiate ::infer_me_with_poison_output #( - N: /* Could not infer */ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ ) - ╭─[ test.sus:1229:19 ] + ╭─[ test.sus:1214:20 ] │ - 1229 │ bool x, bool y = infer_me_with_poison_output(i) - │ ─────────────┬───────────── - │ ╰─────────────── Could not fully instantiate ::infer_me_with_poison_output #( - N: /* Could not infer */ + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ ) ──────╯ -Warning: Unused Variable: This variable does not affect the output ports of this module - ╭─[ test.sus:1233:22 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - 1233 │ module __add__ #(int A, int B) { - │ ┬ - │ ╰── Unused Variable: This variable does not affect the output ports of this module + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ──────╯ -Warning: Unused Variable: This variable does not affect the output ports of this module - ╭─[ test.sus:1233:29 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - 1233 │ module __add__ #(int A, int B) { - │ ┬ - │ ╰── Unused Variable: This variable does not affect the output ports of this module + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) ──────╯ -Error: MAX is not a valid template argument of ::int - ╭─[ test.sus:1234:27 ] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - 1234 │ interface __add__ : int#(MAX: A) a'0, int #(MAX:B) b'0 -> int #(MAX: A+B) o'clog2 #(V: 5) - │ ─┬─ - │ ╰─── MAX is not a valid template argument of ::int + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +──────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) + ╭─[ test.sus:1214:20 ] │ - ├─[ core.sus:33:20 ] + 1214 │ out_arr[j][i] = in_arr[0][j][i] + │ ───────┬─────── + │ ╰───────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +) +──────╯ +Error: Could not infer the parameters of this submodule, some parameters were still unknown: infer_me_with_poison_output #( + N: /* Could not infer */ +) + ╭─[ test.sus:1229:19 ] │ - 33 │ __builtin__ struct int {} - │ ─┬─ - │ ╰─── 'int' defined here + 1229 │ bool x, bool y = infer_me_with_poison_output(i) + │ ─────────────┬───────────── + │ ╰─────────────── Could not infer the parameters of this submodule, some parameters were still unknown: infer_me_with_poison_output #( + N: /* Could not infer */ +) ──────╯ Warning: Unused Variable: This variable does not affect the output ports of this module ╭─[ test.sus:1234:35 ] @@ -3161,19 +11995,6 @@ Warning: Unused Variable: This variable does not affect the output ports of this │ ┬ │ ╰── Unused Variable: This variable does not affect the output ports of this module ──────╯ -Error: MAX is not a valid template argument of ::int - ╭─[ test.sus:1234:46 ] - │ - 1234 │ interface __add__ : int#(MAX: A) a'0, int #(MAX:B) b'0 -> int #(MAX: A+B) o'clog2 #(V: 5) - │ ─┬─ - │ ╰─── MAX is not a valid template argument of ::int - │ - ├─[ core.sus:33:20 ] - │ - 33 │ __builtin__ struct int {} - │ ─┬─ - │ ╰─── 'int' defined here -──────╯ Warning: Unused Variable: This variable does not affect the output ports of this module ╭─[ test.sus:1234:53 ] │ @@ -3181,19 +12002,6 @@ Warning: Unused Variable: This variable does not affect the output ports of this │ ┬ │ ╰── Unused Variable: This variable does not affect the output ports of this module ──────╯ -Error: MAX is not a valid template argument of ::int - ╭─[ test.sus:1234:66 ] - │ - 1234 │ interface __add__ : int#(MAX: A) a'0, int #(MAX:B) b'0 -> int #(MAX: A+B) o'clog2 #(V: 5) - │ ─┬─ - │ ╰─── MAX is not a valid template argument of ::int - │ - ├─[ core.sus:33:20 ] - │ - 33 │ __builtin__ struct int {} - │ ─┬─ - │ ╰─── 'int' defined here -──────╯ Warning: Unused Variable: This variable does not affect the output ports of this module ╭─[ test.sus:1245:32 ] │ @@ -3208,12 +12016,12 @@ Error: No Global of the name 'trigger' was found. Did you forget to import it? │ ───┬─── │ ╰───── No Global of the name 'trigger' was found. Did you forget to import it? ──────╯ -Error: Could not fully figure out the type of this object. type_variable_1[...peano_variable_1] +Error: Could not fully figure out the type of this object. type_variable_4[...peano_variable_4] ╭─[ test.sus:1246:10 ] │ 1246 │ trigger may_process'0 : T cur_state { │ ─────┬───── - │ ╰─────── Could not fully figure out the type of this object. type_variable_1[...peano_variable_1] + │ ╰─────── Could not fully figure out the type of this object. type_variable_4[...peano_variable_4] ──────╯ Warning: Unused Variable: This variable does not affect the output ports of this module ╭─[ test.sus:1246:10 ] @@ -3257,12 +12065,12 @@ Error: No Global of the name 'action' was found. Did you forget to import it? │ ───┬── │ ╰──── No Global of the name 'action' was found. Did you forget to import it? ──────╯ -Error: Could not fully figure out the type of this object. type_variable_3[...peano_variable_3] +Error: Could not fully figure out the type of this object. type_variable_6[...peano_variable_6] ╭─[ test.sus:1247:10 ] │ 1247 │ action next_state'II : T next_state_value │ ─────┬──── - │ ╰────── Could not fully figure out the type of this object. type_variable_3[...peano_variable_3] + │ ╰────── Could not fully figure out the type of this object. type_variable_6[...peano_variable_6] ──────╯ Warning: Unused Variable: This variable does not affect the output ports of this module ╭─[ test.sus:1247:10 ] @@ -3292,9 +12100,9 @@ Error: While parsing 'source_file', parser found a syntax error in a node of typ │ │ ─────────────────────────────┬──────────────────────────── │ │ ╰────────────────────────────── While parsing 'source_file', parser found a syntax error in a node of type 'ERROR' ┆ ┆ - 1365 │ ├─▶ - │ │ - │ ╰────── Parent node 'source_file' + 1377 │ ├─▶ } + │ │ + │ ╰─────── Parent node 'source_file' ──────╯ Error: While parsing 'source_file', parser found a syntax error in a node of type 'ERROR' ╭─[ test.sus:1251:1 ] @@ -3305,9 +12113,9 @@ Error: While parsing 'source_file', parser found a syntax error in a node of typ │ │ ┬ │ │ ╰── While parsing 'source_file', parser found a syntax error in a node of type 'ERROR' ┆ ┆ - 1365 │ ├─▶ - │ │ - │ ╰────── Parent node 'source_file' + 1377 │ ├─▶ } + │ │ + │ ╰─────── Parent node 'source_file' ──────╯ Error: Could not fully figure out the type of this object. type_variable_0[...peano_variable_0] ╭─[ test.sus:1254:2 ] @@ -3396,7 +12204,7 @@ Error: There is no port or interface of name 'process' on module MultiStateLoop │ 1245 │ module MultiStateLoop #(T, int II) { │ ───────┬────── - │ ╰──────── Module 'MultiStateLoop' defined here. module ::MultiStateLoop #(T, int II): + │ ╰──────── Module 'MultiStateLoop' defined here. module MultiStateLoop #(T, int II): domain clk: │ @@ -3415,13 +12223,6 @@ Error: While parsing 'if_statement', parser found a syntax error in a node of ty │ │ │ ╰─────────── Parent node 'if_statement' ──────╯ -Error: Typing Error: variable reference expects a ::float but was given a ::int - ╭─[ test.sus:1264:3 ] - │ - 1264 │ float next_state = cur_state * cur_state - │ ────────┬─────── - │ ╰───────── Typing Error: variable reference expects a ::float but was given a ::int -──────╯ Warning: Unused Variable: This variable does not affect the output ports of this module ╭─[ test.sus:1264:9 ] │ @@ -3436,6 +12237,13 @@ Error: No Global of the name 'cur_state' was found. Did you forget to import it? │ ────┬──── │ ╰────── No Global of the name 'cur_state' was found. Did you forget to import it? ──────╯ +Error: Typing Error: binop output expects a int but was given a float + ╭─[ test.sus:1264:22 ] + │ + 1264 │ float next_state = cur_state * cur_state + │ ──────────┬────────── + │ ╰──────────── Typing Error: binop output expects a int but was given a float +──────╯ Error: No Global of the name 'cur_state' was found. Did you forget to import it? ╭─[ test.sus:1264:34 ] │ @@ -3482,12 +12290,18 @@ Warning: Unused Variable: This variable does not affect the output ports of this │ ┬ │ ╰── Unused Variable: This variable does not affect the output ports of this module ──────╯ -Error: Typing Error: write wire access expects a ::int[0] but was given a ::int[4] +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[4] ╭─[ test.sus:1275:2 ] │ 1275 │ int[4] result = [] │ ──────┬────── - │ ╰──────── Typing Error: write wire access expects a ::int[0] but was given a ::int[4] + │ ╰──────── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[4] ──────╯ Warning: Unused Variable: This variable does not affect the output ports of this module ╭─[ test.sus:1275:9 ] @@ -3496,6 +12310,19 @@ Warning: Unused Variable: This variable does not affect the output ports of this │ ───┬── │ ╰──── Unused Variable: This variable does not affect the output ports of this module ──────╯ +Error: Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[0] + ╭─[ test.sus:1275:18 ] + │ + 1275 │ int[4] result = [] + │ ─┬ + │ ╰── Could not finalize this type, some parameters were still unknown: int #( + MIN: /* Could not infer */, + MAX: /* Could not infer */ +)[0] +──────╯ Warning: Unused Variable: This variable does not affect the output ports of this module ╭─[ test.sus:1278:29 ] │ @@ -3503,14 +12330,14 @@ Warning: Unused Variable: This variable does not affect the output ports of this │ ┬ │ ╰── Unused Variable: This variable does not affect the output ports of this module ──────╯ -Error: Could not fully instantiate ::unknownLatency #( +Error: Could not infer the parameters of this submodule, some parameters were still unknown: unknownLatency #( V: /* Could not infer */ ) ╭─[ test.sus:1288:17 ] │ 1288 │ unknownLatency ulat │ ──┬─ - │ ╰─── Could not fully instantiate ::unknownLatency #( + │ ╰─── Could not infer the parameters of this submodule, some parameters were still unknown: unknownLatency #( V: /* Could not infer */ ) ──────╯ @@ -3528,14 +12355,14 @@ Warning: Unused Variable: This variable does not affect the output ports of this │ ┬ │ ╰── Unused Variable: This variable does not affect the output ports of this module ──────╯ -Error: Could not fully instantiate ::infer_me_conflicting_directions #( +Error: Could not infer the parameters of this submodule, some parameters were still unknown: infer_me_conflicting_directions #( V: /* Could not infer */ ) ╭─[ test.sus:1302:34 ] │ 1302 │ infer_me_conflicting_directions inf │ ─┬─ - │ ╰─── Could not fully instantiate ::infer_me_conflicting_directions #( + │ ╰─── Could not infer the parameters of this submodule, some parameters were still unknown: infer_me_conflicting_directions #( V: /* Could not infer */ ) ──────╯ @@ -3602,14 +12429,14 @@ Warning: Unused Variable: This variable does not affect the output ports of this │ ┬ │ ╰── Unused Variable: This variable does not affect the output ports of this module ──────╯ -Error: Could not fully instantiate ::infer_me_inputs_only #( +Error: Could not infer the parameters of this submodule, some parameters were still unknown: infer_me_inputs_only #( V: /* Could not infer */ ) ╭─[ test.sus:1348:2 ] │ 1348 │ infer_me_inputs_only(x, y) │ ──────────┬───────── - │ ╰─────────── Could not fully instantiate ::infer_me_inputs_only #( + │ ╰─────────── Could not infer the parameters of this submodule, some parameters were still unknown: infer_me_inputs_only #( V: /* Could not infer */ ) ──────╯ @@ -3655,3 +12482,70 @@ Warning: Unused Variable: This variable does not affect the output ports of this │ ───┬── │ ╰──── Unused Variable: This variable does not affect the output ports of this module ──────╯ +Warning: Unused Variable: This variable does not affect the output ports of this module + ╭─[ test.sus:1369:9 ] + │ + 1369 │ int[5] vs = [1, 2, 3, 4, 5] + │ ─┬ + │ ╰── Unused Variable: This variable does not affect the output ports of this module +──────╯ +Warning: Unused port 'data_out' + ╭─[ test.sus:1374:5 ] + │ + 1374 │ FIFO #(DEPTH: 53, READY_SLACK: 3) f + │ ────────────────┬──────────────── ┬ + │ ╰──────────────────── Unused port 'data_out' + │ │ + │ ╰── f declared here + │ + ├─[ util.sus:40:49 ] + │ + 40 │ interface pop : bool pop -> bool data_valid, T data_out + │ ────┬─── + │ ╰───── Port 'data_out' declared here +──────╯ +Warning: Unused port 'data_valid' + ╭─[ test.sus:1374:5 ] + │ + 1374 │ FIFO #(DEPTH: 53, READY_SLACK: 3) f + │ ────────────────┬──────────────── ┬ + │ ╰──────────────────── Unused port 'data_valid' + │ │ + │ ╰── f declared here + │ + ├─[ util.sus:40:35 ] + │ + 40 │ interface pop : bool pop -> bool data_valid, T data_out + │ ─────┬──── + │ ╰────── Port 'data_valid' declared here +──────╯ +Warning: Unused port 'pop' + ╭─[ test.sus:1374:5 ] + │ + 1374 │ FIFO #(DEPTH: 53, READY_SLACK: 3) f + │ ────────────────┬──────────────── ┬ + │ ╰──────────────────── Unused port 'pop' + │ │ + │ ╰── f declared here + │ + ├─[ util.sus:40:23 ] + │ + 40 │ interface pop : bool pop -> bool data_valid, T data_out + │ ─┬─ + │ ╰─── Port 'pop' declared here +──────╯ +Warning: Unused port 'ready' + ╭─[ test.sus:1374:5 ] + │ + 1374 │ FIFO #(DEPTH: 53, READY_SLACK: 3) f + │ ────────────────┬──────────────── ┬ + │ ╰──────────────────── Unused port 'ready' + │ │ + │ ╰── f declared here + │ + ├─[ util.sus:36:14 ] + │ + 36 │ output bool ready'0 + │ ──┬── + │ ╰──── Port 'ready' declared here +──────╯ diff --git a/test.sus_output.txt b/test.sus_output.txt index cb7b5f59..b7c91ccf 100644 --- a/test.sus_output.txt +++ b/test.sus_output.txt @@ -1,164 +1,170 @@ -TREE SITTER module! LatencyOffset -TREE SITTER module! CrossDomain -TREE SITTER module! IntToBits -TREE SITTER module! BitsToInt -TREE SITTER module! bool -TREE SITTER module! int -TREE SITTER module! float -TREE SITTER module! __crash_compiler -TREE SITTER module! true -TREE SITTER module! false -TREE SITTER module! assert -TREE SITTER module! sizeof -TREE SITTER module! clog2 -TREE SITTER module! pow2 -TREE SITTER module! pow -TREE SITTER module! factorial -TREE SITTER module! falling_factorial -TREE SITTER module! comb -TREE SITTER module! DualPortMem -TREE SITTER module! FIFO -TREE SITTER module! JoinDomains -TREE SITTER module! Iterator -TREE SITTER module! FixedSizeIterator -TREE SITTER module! SlowClockGenerator -TREE SITTER module! SplitAt -TREE SITTER module! Abs -TREE SITTER module! Slice -TREE SITTER module! BitSelect -TREE SITTER module! PopCount -TREE SITTER module! TreeAdd -TREE SITTER module! example_md -TREE SITTER module! multiply_add -TREE SITTER module! test_pow17 -TREE SITTER module! pow17 -TREE SITTER module! fibonnaci -TREE SITTER module! blur2 -TREE SITTER module! Tree_Multiply -TREE SITTER module! Accumulator -TREE SITTER module! blur -TREE SITTER module! Unpack4 -TREE SITTER module! generative -TREE SITTER module! add_indices_to_array -TREE SITTER module! assignment_producer -TREE SITTER module! test_various_assignments -TREE SITTER module! first_bit_idx_6 -TREE SITTER module! multiply_add_with_latencies -TREE SITTER module! first_bit_idx_24 -TREE SITTER module! permute -TREE SITTER module! permute24 -TREE SITTER module! test_single_wire -TREE SITTER module! disjoint_ports -TREE SITTER module! undeteriminable_input_latency -TREE SITTER module! specified_input_latency -TREE SITTER module! determinable_input_latency -TREE SITTER module! determinable_because_no_input_output_ports -TREE SITTER module! conflicting_latency_declarations -TREE SITTER module! bad_cycle -TREE SITTER module! module_taking_time -TREE SITTER module! matrix_vector_mul -TREE SITTER module! bad_cycle2 -TREE SITTER module! module_taking_a_lot_of_time -TREE SITTER module! offset_latency -TREE SITTER module! good_cycle -TREE SITTER module! input_only -TREE SITTER module! multiple_inputs_only -TREE SITTER module! output_only -TREE SITTER module! multiple_outputs_only -TREE SITTER module! submodule -TREE SITTER module! doNothing -TREE SITTER module! contains_submodule_submodule -TREE SITTER module! xor -TREE SITTER module! use_xor -TREE SITTER module! fizz_buzz -TREE SITTER module! fizz_buzz_gen -TREE SITTER module! mbf_dual -TREE SITTER module! monotonize_down -TREE SITTER module! my_mod -TREE SITTER module! use_my_mod -TREE SITTER module! submodule_named_ports -TREE SITTER module! use_submodule_named_ports -TREE SITTER module! contains_submodule_submodule -TREE SITTER module! cross_bool -TREE SITTER module! cross_int -TREE SITTER module! cross_memory -TREE SITTER module! offset_backwards -TREE SITTER module! dual_port_mem -TREE SITTER module! use_fifo -TREE SITTER module! test_separated_domain -TREE SITTER module! no_port_module -TREE SITTER module! use_no_input_module -TREE SITTER module! mod_with_unused_interface -TREE SITTER module! test_write_to_gen_var -TREE SITTER module! use_bad_interface -TREE SITTER module! sequenceDownFrom -TREE SITTER module! sumUpTo -TREE SITTER module! test -TREE SITTER module! use_test -TREE SITTER module! tinyTestMod -TREE SITTER module! testTinyTestMod -TREE SITTER module! tree_add -TREE SITTER module! make_tree_add -TREE SITTER module! replicate -TREE SITTER module! use_replicate -TREE SITTER module! permute_t -TREE SITTER module! use_permute -TREE SITTER module! instruction_decoder -TREE SITTER module! run_instruction -TREE SITTER module! no_main_interface -TREE SITTER module! use_no_main_interface -TREE SITTER module! moduleWithBadDeclaration -TREE SITTER module! moduleWithBadInterface -TREE SITTER module! useModuleWithBadInterface -TREE SITTER module! SUM_UP -TREE SITTER module! dont_care -TREE SITTER module! m -TREE SITTER module! xyz -TREE SITTER module! numbersToAddUp -TREE SITTER module! sized_int_add -TREE SITTER module! use_sized_int_add -TREE SITTER module! implicit_domain_forbidden -TREE SITTER module! conflicting_domain_with_port_name -TREE SITTER module! make_infinite_type_help -TREE SITTER module! make_infinite_type -TREE SITTER module! UseDualPortMem -TREE SITTER module! example_FIFO -TREE SITTER module! use_Iterator -TREE SITTER module! UseSlice -TREE SITTER module! UseBuiltinConstants -TREE SITTER module! FailingAssert -TREE SITTER module! IfTesting -TREE SITTER module! latency_counting_disjoint_blocks -TREE SITTER module! latency_counting_disjoint_blocks_merge_error -TREE SITTER module! use_infer_me -TREE SITTER module! infer_me -TREE SITTER module! infer_from_local_context -TREE SITTER module! instantiate_fifo -TREE SITTER module! inference_edge_case -TREE SITTER module! specified_latencies_not_ports_edge_case -TREE SITTER module! testArrayWrite -TREE SITTER module! infer_me_with_poison_output -TREE SITTER module! instantiate_infer_me_with_poison_output -TREE SITTER module! __add__ -TREE SITTER module! ShiftReg -TREE SITTER module! MultiStateLoop -TREE SITTER module! use_MultiStateLoop -TREE SITTER module! CombineArray -TREE SITTER module! unknownLatency -TREE SITTER module! useUnknownLatency -TREE SITTER module! infer_me_conflicting_directions -TREE SITTER module! use_infer_me_conflicting_directions -TREE SITTER module! infer_me_with_delta -TREE SITTER module! use_infer_me_with_delta -TREE SITTER module! infer_me_with_negative_delta -TREE SITTER module! use_infer_me_with_negative_delta -TREE SITTER module! infer_me_inputs_only -TREE SITTER module! use_infer_me_inputs_only -TREE SITTER module! use_ranks +Flattening LatencyOffset +Flattening CrossDomain +Flattening IntToBits +Flattening BitsToInt +Flattening UIntToBits +Flattening BitsToUInt +Flattening bool +Flattening int +Flattening float +Flattening __crash_compiler +Flattening true +Flattening false +Flattening assert +Flattening sizeof +Flattening clog2 +Flattening pow2 +Flattening pow +Flattening factorial +Flattening falling_factorial +Flattening comb +Flattening DualPortMem +Flattening FIFO +Flattening JoinDomains +Flattening Iterator +Flattening FixedSizeIterator +Flattening SlowClockGenerator +Flattening SplitAt +Flattening Abs +Flattening Slice +Flattening BitSelect +Flattening PopCount +Flattening TreeAdd +Flattening example_md +Flattening multiply_add +Flattening test_pow17 +Flattening pow17 +Flattening fibonnaci +Flattening blur2 +Flattening Tree_Multiply +Flattening Accumulator +Flattening blur +Flattening Unpack4 +Flattening generative +Flattening add_indices_to_array +Flattening assignment_producer +Flattening test_various_assignments +Flattening first_bit_idx_6 +Flattening multiply_add_with_latencies +Flattening first_bit_idx_24 +Flattening permute +Flattening permute24 +Flattening test_single_wire +Flattening disjoint_ports +Flattening undeteriminable_input_latency +Flattening specified_input_latency +Flattening determinable_input_latency +Flattening determinable_because_no_input_output_ports +Flattening conflicting_latency_declarations +Flattening bad_cycle +Flattening module_taking_time +Flattening matrix_vector_mul +Flattening bad_cycle2 +Flattening module_taking_a_lot_of_time +Flattening offset_latency +Flattening good_cycle +Flattening input_only +Flattening multiple_inputs_only +Flattening output_only +Flattening multiple_outputs_only +Flattening submodule +Flattening doNothing +Flattening contains_submodule_submodule +Flattening xor +Flattening use_xor +Flattening fizz_buzz +Flattening fizz_buzz_gen +Flattening mbf_dual +Flattening monotonize_down +Flattening my_mod +Flattening use_my_mod +Flattening submodule_named_ports +Flattening use_submodule_named_ports +Flattening contains_submodule_submodule +Flattening cross_bool +Flattening cross_int +Flattening cross_memory +Flattening offset_backwards +Flattening dual_port_mem +Flattening use_fifo +Flattening test_separated_domain +Flattening no_port_module +Flattening use_no_input_module +Flattening mod_with_unused_interface +Flattening test_write_to_gen_var +Flattening use_bad_interface +Flattening sequenceDownFrom +Flattening sumUpTo +Flattening test +Flattening use_test +Flattening tinyTestMod +Flattening testTinyTestMod +Flattening tree_add +Flattening make_tree_add +Flattening replicate +Flattening use_replicate +Flattening permute_t +Flattening use_permute +Flattening instruction_decoder +Flattening run_instruction +Flattening no_main_interface +Flattening use_no_main_interface +Flattening moduleWithBadDeclaration +Flattening moduleWithBadInterface +Flattening useModuleWithBadInterface +Flattening SUM_UP +Flattening dont_care +Flattening m +Flattening xyz +Flattening numbersToAddUp +Flattening sized_int_add +Flattening use_sized_int_add +Flattening implicit_domain_forbidden +Flattening conflicting_domain_with_port_name +Flattening make_infinite_type_help +Flattening make_infinite_type +Flattening UseDualPortMem +Flattening example_FIFO +Flattening use_Iterator +Flattening UseSlice +Flattening UseBuiltinConstants +Flattening FailingAssert +Flattening IfTesting +Flattening latency_counting_disjoint_blocks +Flattening latency_counting_disjoint_blocks_merge_error +Flattening use_infer_me +Flattening infer_me +Flattening infer_from_local_context +Flattening instantiate_fifo +Flattening inference_edge_case +Flattening specified_latencies_not_ports_edge_case +Flattening testArrayWrite +Flattening infer_me_with_poison_output +Flattening instantiate_infer_me_with_poison_output +Flattening __add__ +Flattening ShiftReg +Flattening MultiStateLoop +Flattening use_MultiStateLoop +Flattening CombineArray +Flattening unknownLatency +Flattening useUnknownLatency +Flattening infer_me_conflicting_directions +Flattening use_infer_me_conflicting_directions +Flattening infer_me_with_delta +Flattening use_infer_me_with_delta +Flattening infer_me_with_negative_delta +Flattening use_infer_me_with_negative_delta +Flattening infer_me_inputs_only +Flattening use_infer_me_inputs_only +Flattening use_ranks +Flattening testInts +Flattening use_FIFO Typechecking LatencyOffset Typechecking CrossDomain Typechecking IntToBits Typechecking BitsToInt +Typechecking UIntToBits +Typechecking BitsToUInt Typechecking DualPortMem Typechecking FIFO Typechecking JoinDomains @@ -296,327 +302,212 @@ Typechecking use_infer_me_with_negative_delta Typechecking infer_me_inputs_only Typechecking use_infer_me_inputs_only Typechecking use_ranks -Instantiating Iterator -Concrete Typechecking Iterator -Latency Counting Iterator -Checking array accesses Iterator -Instantiating Abs -Concrete Typechecking Abs -Latency Counting Abs -Checking array accesses Abs +Typechecking testInts +Typechecking use_FIFO Instantiating example_md Concrete Typechecking example_md -Latency Counting example_md Checking array accesses example_md Instantiating multiply_add Concrete Typechecking multiply_add -Latency Counting multiply_add Checking array accesses multiply_add Instantiating test_pow17 Concrete Typechecking test_pow17 Instantiating pow17 Concrete Typechecking pow17 -Latency Counting pow17 Checking array accesses pow17 -Latency Counting test_pow17 -Checking array accesses test_pow17 Instantiating fibonnaci Concrete Typechecking fibonnaci -Latency Counting fibonnaci Checking array accesses fibonnaci Instantiating blur2 Concrete Typechecking blur2 -Latency Counting blur2 Checking array accesses blur2 Instantiating Tree_Multiply Concrete Typechecking Tree_Multiply -Latency Counting Tree_Multiply Checking array accesses Tree_Multiply Instantiating Accumulator Concrete Typechecking Accumulator -Latency Counting Accumulator -Checking array accesses Accumulator Instantiating blur Concrete Typechecking blur -Latency Counting blur Checking array accesses blur Instantiating Unpack4 Concrete Typechecking Unpack4 -Latency Counting Unpack4 Checking array accesses Unpack4 Not Instantiating generative due to flattening errors Instantiating add_indices_to_array Concrete Typechecking add_indices_to_array -Latency Counting add_indices_to_array Checking array accesses add_indices_to_array Instantiating assignment_producer Concrete Typechecking assignment_producer -Latency Counting assignment_producer -Checking array accesses assignment_producer Instantiating test_various_assignments Concrete Typechecking test_various_assignments -Latency Counting test_various_assignments -Checking array accesses test_various_assignments Instantiating first_bit_idx_6 Concrete Typechecking first_bit_idx_6 -Latency Counting first_bit_idx_6 Checking array accesses first_bit_idx_6 Not Instantiating multiply_add_with_latencies due to flattening errors Instantiating first_bit_idx_24 Concrete Typechecking first_bit_idx_24 -Latency Counting first_bit_idx_24 -Checking array accesses first_bit_idx_24 Instantiating permute Concrete Typechecking permute -Latency Counting permute -Checking array accesses permute Not Instantiating permute24 due to flattening errors Instantiating test_single_wire Concrete Typechecking test_single_wire -Latency Counting test_single_wire Checking array accesses test_single_wire Instantiating disjoint_ports Concrete Typechecking disjoint_ports -Latency Counting disjoint_ports -Checking array accesses disjoint_ports Instantiating undeteriminable_input_latency Concrete Typechecking undeteriminable_input_latency -Latency Counting undeteriminable_input_latency -Checking array accesses undeteriminable_input_latency Instantiating specified_input_latency Concrete Typechecking specified_input_latency -Latency Counting specified_input_latency Checking array accesses specified_input_latency Instantiating determinable_input_latency Concrete Typechecking determinable_input_latency -Latency Counting determinable_input_latency Checking array accesses determinable_input_latency Instantiating determinable_because_no_input_output_ports Concrete Typechecking determinable_because_no_input_output_ports -Latency Counting determinable_because_no_input_output_ports Checking array accesses determinable_because_no_input_output_ports Instantiating conflicting_latency_declarations Concrete Typechecking conflicting_latency_declarations -Latency Counting conflicting_latency_declarations -Checking array accesses conflicting_latency_declarations Instantiating bad_cycle Concrete Typechecking bad_cycle -Latency Counting bad_cycle -Checking array accesses bad_cycle Instantiating module_taking_time Concrete Typechecking module_taking_time -Latency Counting module_taking_time Checking array accesses module_taking_time Instantiating matrix_vector_mul Concrete Typechecking matrix_vector_mul -Latency Counting matrix_vector_mul Checking array accesses matrix_vector_mul Instantiating bad_cycle2 Concrete Typechecking bad_cycle2 -Latency Counting bad_cycle2 -Checking array accesses bad_cycle2 Instantiating module_taking_a_lot_of_time Concrete Typechecking module_taking_a_lot_of_time -Latency Counting module_taking_a_lot_of_time Checking array accesses module_taking_a_lot_of_time -Instantiating offset_latency -Concrete Typechecking offset_latency -Latency Counting offset_latency -Checking array accesses offset_latency Instantiating good_cycle Concrete Typechecking good_cycle -Latency Counting good_cycle Checking array accesses good_cycle Instantiating input_only Concrete Typechecking input_only -Latency Counting input_only Checking array accesses input_only Instantiating multiple_inputs_only Concrete Typechecking multiple_inputs_only -Latency Counting multiple_inputs_only Checking array accesses multiple_inputs_only Instantiating output_only Concrete Typechecking output_only -Latency Counting output_only Checking array accesses output_only Instantiating multiple_outputs_only Concrete Typechecking multiple_outputs_only -Latency Counting multiple_outputs_only Checking array accesses multiple_outputs_only Instantiating submodule Concrete Typechecking submodule -Latency Counting submodule Checking array accesses submodule Instantiating doNothing Concrete Typechecking doNothing -Latency Counting doNothing Checking array accesses doNothing Not Instantiating contains_submodule_submodule due to flattening errors Instantiating xor Concrete Typechecking xor -Latency Counting xor Checking array accesses xor Instantiating use_xor Concrete Typechecking use_xor -Latency Counting use_xor Checking array accesses use_xor Instantiating fizz_buzz Concrete Typechecking fizz_buzz -Latency Counting fizz_buzz Checking array accesses fizz_buzz -Instantiating fizz_buzz_gen -Concrete Typechecking fizz_buzz_gen -Latency Counting fizz_buzz_gen -Checking array accesses fizz_buzz_gen Instantiating mbf_dual Concrete Typechecking mbf_dual -Latency Counting mbf_dual Checking array accesses mbf_dual Instantiating monotonize_down Concrete Typechecking monotonize_down -Latency Counting monotonize_down Checking array accesses monotonize_down Instantiating my_mod Concrete Typechecking my_mod -Latency Counting my_mod Checking array accesses my_mod Instantiating use_my_mod Concrete Typechecking use_my_mod -Latency Counting use_my_mod Checking array accesses use_my_mod Instantiating submodule_named_ports Concrete Typechecking submodule_named_ports -Latency Counting submodule_named_ports Checking array accesses submodule_named_ports Instantiating use_submodule_named_ports Concrete Typechecking use_submodule_named_ports -Latency Counting use_submodule_named_ports -Checking array accesses use_submodule_named_ports Not Instantiating contains_submodule_submodule due to flattening errors Instantiating cross_bool Concrete Typechecking cross_bool -Latency Counting cross_bool Checking array accesses cross_bool Instantiating cross_int Concrete Typechecking cross_int -Latency Counting cross_int Checking array accesses cross_int Instantiating cross_memory Concrete Typechecking cross_memory -Latency Counting cross_memory Checking array accesses cross_memory Instantiating offset_backwards Concrete Typechecking offset_backwards -Latency Counting offset_backwards Checking array accesses offset_backwards Instantiating dual_port_mem Concrete Typechecking dual_port_mem -Latency Counting dual_port_mem Checking array accesses dual_port_mem Instantiating use_fifo Concrete Typechecking use_fifo -Latency Counting use_fifo -Checking array accesses use_fifo -Not Instantiating test_separated_domain due to flattening errors +Instantiating test_separated_domain +Concrete Typechecking test_separated_domain +Checking array accesses test_separated_domain Instantiating no_port_module Concrete Typechecking no_port_module -Latency Counting no_port_module Checking array accesses no_port_module Not Instantiating use_no_input_module due to flattening errors Instantiating mod_with_unused_interface Concrete Typechecking mod_with_unused_interface -Latency Counting mod_with_unused_interface Checking array accesses mod_with_unused_interface Not Instantiating test_write_to_gen_var due to flattening errors Instantiating use_bad_interface Concrete Typechecking use_bad_interface -Latency Counting use_bad_interface -Checking array accesses use_bad_interface Instantiating sequenceDownFrom Concrete Typechecking sequenceDownFrom -Latency Counting sequenceDownFrom -Checking array accesses sequenceDownFrom Instantiating sumUpTo Concrete Typechecking sumUpTo -Latency Counting sumUpTo -Checking array accesses sumUpTo Not Instantiating use_test due to flattening errors Instantiating testTinyTestMod Concrete Typechecking testTinyTestMod -Instantiating tinyTestMod -Concrete Typechecking tinyTestMod -Latency Counting tinyTestMod -Checking array accesses tinyTestMod -Instantiating tinyTestMod -Concrete Typechecking tinyTestMod -Latency Counting tinyTestMod -Checking array accesses tinyTestMod -Latency Counting testTinyTestMod +Instantiating tinyTestMod #(beep: 3) +Concrete Typechecking tinyTestMod #(beep: 3) +Checking array accesses tinyTestMod #(beep: 3) +Instantiating tinyTestMod #(beep: 4) +Concrete Typechecking tinyTestMod #(beep: 4) +Checking array accesses tinyTestMod #(beep: 4) Checking array accesses testTinyTestMod Instantiating make_tree_add Concrete Typechecking make_tree_add -Instantiating tree_add -Concrete Typechecking tree_add -Instantiating tree_add -Concrete Typechecking tree_add -Instantiating tree_add -Concrete Typechecking tree_add -Instantiating tree_add -Concrete Typechecking tree_add -Instantiating tree_add -Concrete Typechecking tree_add -Instantiating tree_add -Concrete Typechecking tree_add -Instantiating tree_add -Concrete Typechecking tree_add -Instantiating tree_add -Concrete Typechecking tree_add -Latency Counting tree_add -Checking array accesses tree_add -Latency Counting tree_add -Checking array accesses tree_add -Latency Counting tree_add -Checking array accesses tree_add -Latency Counting tree_add -Checking array accesses tree_add -Latency Counting tree_add -Checking array accesses tree_add -Latency Counting tree_add -Checking array accesses tree_add -Latency Counting tree_add -Checking array accesses tree_add -Latency Counting tree_add -Checking array accesses tree_add -Latency Counting make_tree_add -Checking array accesses make_tree_add +Instantiating tree_add #(WIDTH: 255) +Concrete Typechecking tree_add #(WIDTH: 255) +Instantiating tree_add #(WIDTH: 127) +Concrete Typechecking tree_add #(WIDTH: 127) +Instantiating tree_add #(WIDTH: 63) +Concrete Typechecking tree_add #(WIDTH: 63) +Instantiating tree_add #(WIDTH: 31) +Concrete Typechecking tree_add #(WIDTH: 31) +Instantiating tree_add #(WIDTH: 15) +Concrete Typechecking tree_add #(WIDTH: 15) +Instantiating tree_add #(WIDTH: 7) +Concrete Typechecking tree_add #(WIDTH: 7) +Instantiating tree_add #(WIDTH: 3) +Concrete Typechecking tree_add #(WIDTH: 3) +Instantiating tree_add #(WIDTH: 1) +Concrete Typechecking tree_add #(WIDTH: 1) Instantiating use_replicate Concrete Typechecking use_replicate -Instantiating replicate -Concrete Typechecking replicate -Latency Counting replicate -Checking array accesses replicate -Instantiating replicate -Concrete Typechecking replicate -Latency Counting replicate -Checking array accesses replicate -Latency Counting use_replicate -Checking array accesses use_replicate +Instantiating replicate #(T: type int #(MIN: 3, MAX: 3), NUM_REPLS: 30) +Concrete Typechecking replicate #(T: type int #(MIN: 3, MAX: 3), NUM_REPLS: 30) +Checking array accesses replicate #(T: type int #(MIN: 3, MAX: 3), NUM_REPLS: 30) Instantiating use_permute Concrete Typechecking use_permute -Instantiating permute_t -Concrete Typechecking permute_t -Latency Counting permute_t -Checking array accesses permute_t -Latency Counting use_permute +Instantiating permute_t #(T: type int #(MIN: 1, MAX: 7), SIZE: 8, SOURCES: [3, 2, 4, 5, 1, 2, 7, 6]) +Concrete Typechecking permute_t #(T: type int #(MIN: 1, MAX: 7), SIZE: 8, SOURCES: [3, 2, 4, 5, 1, 2, 7, 6]) +Checking array accesses permute_t #(T: type int #(MIN: 1, MAX: 7), SIZE: 8, SOURCES: [3, 2, 4, 5, 1, 2, 7, 6]) Checking array accesses use_permute Instantiating instruction_decoder Concrete Typechecking instruction_decoder -Latency Counting instruction_decoder Checking array accesses instruction_decoder Not Instantiating run_instruction due to flattening errors Instantiating no_main_interface Concrete Typechecking no_main_interface -Latency Counting no_main_interface Checking array accesses no_main_interface Not Instantiating use_no_main_interface due to flattening errors Not Instantiating moduleWithBadDeclaration due to flattening errors @@ -625,181 +516,113 @@ Not Instantiating useModuleWithBadInterface due to flattening errors Not Instantiating m due to flattening errors Instantiating xyz Concrete Typechecking xyz -Instantiating CrossDomain -Concrete Typechecking CrossDomain -Latency Counting CrossDomain -Checking array accesses CrossDomain -Latency Counting xyz -Checking array accesses xyz Instantiating numbersToAddUp Concrete Typechecking numbersToAddUp -Instantiating TreeAdd -Concrete Typechecking TreeAdd -Instantiating SplitAt -Concrete Typechecking SplitAt -Latency Counting SplitAt -Checking array accesses SplitAt -Instantiating TreeAdd -Concrete Typechecking TreeAdd -Instantiating SplitAt -Concrete Typechecking SplitAt -Latency Counting SplitAt -Checking array accesses SplitAt -Instantiating TreeAdd -Concrete Typechecking TreeAdd -Latency Counting TreeAdd -Checking array accesses TreeAdd -Latency Counting TreeAdd -Checking array accesses TreeAdd -Instantiating TreeAdd -Concrete Typechecking TreeAdd -Instantiating SplitAt -Concrete Typechecking SplitAt -Latency Counting SplitAt -Checking array accesses SplitAt -Latency Counting TreeAdd -Checking array accesses TreeAdd -Latency Counting TreeAdd -Checking array accesses TreeAdd -Latency Counting numbersToAddUp +Instantiating TreeAdd #(WIDTH: 5, MIN: 3, MAX: 3) +Concrete Typechecking TreeAdd #(WIDTH: 5, MIN: 3, MAX: 3) +Instantiating SplitAt #(T: type int #(MIN: 3, MAX: 3), SIZE: 5, SPLIT_POINT: 2) +Concrete Typechecking SplitAt #(T: type int #(MIN: 3, MAX: 3), SIZE: 5, SPLIT_POINT: 2) +Checking array accesses SplitAt #(T: type int #(MIN: 3, MAX: 3), SIZE: 5, SPLIT_POINT: 2) +Instantiating TreeAdd #(WIDTH: 3, MIN: 3, MAX: 3) +Concrete Typechecking TreeAdd #(WIDTH: 3, MIN: 3, MAX: 3) +Instantiating SplitAt #(T: type int #(MIN: 3, MAX: 3), SIZE: 3, SPLIT_POINT: 1) +Concrete Typechecking SplitAt #(T: type int #(MIN: 3, MAX: 3), SIZE: 3, SPLIT_POINT: 1) +Checking array accesses SplitAt #(T: type int #(MIN: 3, MAX: 3), SIZE: 3, SPLIT_POINT: 1) +Instantiating TreeAdd #(WIDTH: 2, MIN: 3, MAX: 3) +Concrete Typechecking TreeAdd #(WIDTH: 2, MIN: 3, MAX: 3) +Instantiating SplitAt #(T: type int #(MIN: 3, MAX: 3), SIZE: 2, SPLIT_POINT: 1) +Concrete Typechecking SplitAt #(T: type int #(MIN: 3, MAX: 3), SIZE: 2, SPLIT_POINT: 1) +Checking array accesses SplitAt #(T: type int #(MIN: 3, MAX: 3), SIZE: 2, SPLIT_POINT: 1) +Instantiating TreeAdd #(WIDTH: 1, MIN: 3, MAX: 3) +Concrete Typechecking TreeAdd #(WIDTH: 1, MIN: 3, MAX: 3) +Checking array accesses TreeAdd #(WIDTH: 1, MIN: 3, MAX: 3) +Checking array accesses TreeAdd #(WIDTH: 2, MIN: 3, MAX: 3) +Checking array accesses TreeAdd #(WIDTH: 3, MIN: 3, MAX: 3) +Checking array accesses TreeAdd #(WIDTH: 5, MIN: 3, MAX: 3) Checking array accesses numbersToAddUp Instantiating use_sized_int_add Concrete Typechecking use_sized_int_add -Instantiating sized_int_add -Concrete Typechecking sized_int_add -Latency Counting sized_int_add -Checking array accesses sized_int_add -Latency Counting use_sized_int_add +Instantiating sized_int_add #(LEFT_SIZE: 4, RIGHT_SIZE: 3, OUTPUT_SIZE: 5) +Concrete Typechecking sized_int_add #(LEFT_SIZE: 4, RIGHT_SIZE: 3, OUTPUT_SIZE: 5) +Checking array accesses sized_int_add #(LEFT_SIZE: 4, RIGHT_SIZE: 3, OUTPUT_SIZE: 5) Checking array accesses use_sized_int_add Not Instantiating implicit_domain_forbidden due to flattening errors Not Instantiating conflicting_domain_with_port_name due to flattening errors Not Instantiating make_infinite_type due to flattening errors Instantiating UseDualPortMem Concrete Typechecking UseDualPortMem -Instantiating DualPortMem -Concrete Typechecking DualPortMem -Instantiating CrossDomain -Concrete Typechecking CrossDomain -Latency Counting CrossDomain -Checking array accesses CrossDomain -Latency Counting DualPortMem -Checking array accesses DualPortMem -Latency Counting UseDualPortMem -Checking array accesses UseDualPortMem +Instantiating DualPortMem #(T: type bool[500], MAX: 128) +Concrete Typechecking DualPortMem #(T: type bool[500], MAX: 128) +Instantiating CrossDomain #(T: type bool[500][129]) +Concrete Typechecking CrossDomain #(T: type bool[500][129]) +Checking array accesses CrossDomain #(T: type bool[500][129]) +Checking array accesses DualPortMem #(T: type bool[500], MAX: 128) Instantiating example_FIFO Concrete Typechecking example_FIFO -Instantiating FIFO -Concrete Typechecking FIFO -Instantiating CrossDomain -Concrete Typechecking CrossDomain -Latency Counting CrossDomain -Checking array accesses CrossDomain -Instantiating CrossDomain -Concrete Typechecking CrossDomain -Latency Counting CrossDomain -Checking array accesses CrossDomain -Instantiating LatencyOffset -Concrete Typechecking LatencyOffset -Latency Counting LatencyOffset -Checking array accesses LatencyOffset -Latency Counting FIFO -Checking array accesses FIFO -Latency Counting example_FIFO -Checking array accesses example_FIFO Not Instantiating use_Iterator due to flattening errors Instantiating UseSlice Concrete Typechecking UseSlice -Instantiating Slice -Concrete Typechecking Slice -Latency Counting Slice -Checking array accesses Slice -Latency Counting UseSlice -Checking array accesses UseSlice Instantiating UseBuiltinConstants -Concrete Typechecking UseBuiltinConstants -Latency Counting UseBuiltinConstants -Checking array accesses UseBuiltinConstants Instantiating FailingAssert Instantiating latency_counting_disjoint_blocks Concrete Typechecking latency_counting_disjoint_blocks -Latency Counting latency_counting_disjoint_blocks -Checking array accesses latency_counting_disjoint_blocks Instantiating latency_counting_disjoint_blocks_merge_error Concrete Typechecking latency_counting_disjoint_blocks_merge_error -Latency Counting latency_counting_disjoint_blocks_merge_error -Checking array accesses latency_counting_disjoint_blocks_merge_error Not Instantiating use_infer_me due to flattening errors Instantiating infer_from_local_context Concrete Typechecking infer_from_local_context -Instantiating infer_me -Concrete Typechecking infer_me -Latency Counting infer_me -Checking array accesses infer_me -Latency Counting infer_from_local_context +Instantiating infer_me #(A: 5) +Concrete Typechecking infer_me #(A: 5) +Checking array accesses infer_me #(A: 5) Checking array accesses infer_from_local_context Instantiating instantiate_fifo Concrete Typechecking instantiate_fifo -Instantiating FIFO -Concrete Typechecking FIFO -Instantiating CrossDomain -Concrete Typechecking CrossDomain -Latency Counting CrossDomain -Checking array accesses CrossDomain -Instantiating LatencyOffset -Concrete Typechecking LatencyOffset -Latency Counting LatencyOffset -Checking array accesses LatencyOffset -Latency Counting FIFO -Checking array accesses FIFO -Latency Counting instantiate_fifo -Checking array accesses instantiate_fifo Instantiating inference_edge_case Concrete Typechecking inference_edge_case -Latency Counting inference_edge_case -Checking array accesses inference_edge_case Instantiating specified_latencies_not_ports_edge_case Concrete Typechecking specified_latencies_not_ports_edge_case -Latency Counting specified_latencies_not_ports_edge_case Checking array accesses specified_latencies_not_ports_edge_case Instantiating testArrayWrite Concrete Typechecking testArrayWrite -Latency Counting testArrayWrite -Checking array accesses testArrayWrite Instantiating instantiate_infer_me_with_poison_output Concrete Typechecking instantiate_infer_me_with_poison_output -Latency Counting instantiate_infer_me_with_poison_output -Checking array accesses instantiate_infer_me_with_poison_output Not Instantiating use_MultiStateLoop due to flattening errors Instantiating CombineArray Concrete Typechecking CombineArray -Latency Counting CombineArray -Checking array accesses CombineArray Instantiating useUnknownLatency Concrete Typechecking useUnknownLatency -Latency Counting useUnknownLatency -Checking array accesses useUnknownLatency Instantiating use_infer_me_conflicting_directions Concrete Typechecking use_infer_me_conflicting_directions -Latency Counting use_infer_me_conflicting_directions -Checking array accesses use_infer_me_conflicting_directions Instantiating use_infer_me_with_delta Concrete Typechecking use_infer_me_with_delta -Instantiating infer_me_with_delta -Concrete Typechecking infer_me_with_delta -Latency Counting infer_me_with_delta -Checking array accesses infer_me_with_delta -Latency Counting use_infer_me_with_delta +Instantiating infer_me_with_delta #(V: -31) +Concrete Typechecking infer_me_with_delta #(V: -31) +Checking array accesses infer_me_with_delta #(V: -31) Checking array accesses use_infer_me_with_delta Instantiating use_infer_me_with_negative_delta Concrete Typechecking use_infer_me_with_negative_delta -Instantiating infer_me_with_negative_delta -Concrete Typechecking infer_me_with_negative_delta -Latency Counting infer_me_with_negative_delta -Checking array accesses infer_me_with_negative_delta -Latency Counting use_infer_me_with_negative_delta +Instantiating infer_me_with_negative_delta #(V: 31) +Concrete Typechecking infer_me_with_negative_delta #(V: 31) +Checking array accesses infer_me_with_negative_delta #(V: 31) Checking array accesses use_infer_me_with_negative_delta Instantiating use_infer_me_inputs_only Concrete Typechecking use_infer_me_inputs_only -Latency Counting use_infer_me_inputs_only -Checking array accesses use_infer_me_inputs_only Instantiating use_ranks +Instantiating testInts +Concrete Typechecking testInts +Checking array accesses testInts +Instantiating use_FIFO +Concrete Typechecking use_FIFO +Instantiating FIFO #(T: type int #(MIN: 3, MAX: 3), DEPTH: 53, READY_SLACK: 3) +Concrete Typechecking FIFO #(T: type int #(MIN: 3, MAX: 3), DEPTH: 53, READY_SLACK: 3) +Instantiating CrossDomain #(T: type int #(MIN: 0, MAX: 52)) +Concrete Typechecking CrossDomain #(T: type int #(MIN: 0, MAX: 52)) +Checking array accesses CrossDomain #(T: type int #(MIN: 0, MAX: 52)) +Instantiating CrossDomain #(T: type int #(MIN: 3, MAX: 3)[53]) +Concrete Typechecking CrossDomain #(T: type int #(MIN: 3, MAX: 3)[53]) +Checking array accesses CrossDomain #(T: type int #(MIN: 3, MAX: 3)[53]) +Instantiating LatencyOffset #(T: type bool, OFFSET: -4) +Concrete Typechecking LatencyOffset #(T: type bool, OFFSET: -4) +Checking array accesses LatencyOffset #(T: type bool, OFFSET: -4) +Checking array accesses FIFO #(T: type int #(MIN: 3, MAX: 3), DEPTH: 53, READY_SLACK: 3) +Checking array accesses use_FIFO diff --git a/tinyTestFile.sus b/tinyTestFile.sus index 4ad87e0a..b736cee5 100644 --- a/tinyTestFile.sus +++ b/tinyTestFile.sus @@ -1,8 +1,3 @@ // USE THIS FILE TO TEST SMALL SAMPLES OF SUS CODE IN ISOLATION. // DO NOT COMMIT // To use with VSCode debugger, name the module "TEST", and in the code use `if crate::debug::is_enabled("TEST") {}` to enable breakpoint code - - -module TEST { - assert #(C: 15 + 3 == 19) -}