Skip to content

`uint_bits_to_fit`: Inferred an any meta-type with traits

Code to reproduce

pipeline(N) recursive_fft<#uint N, #uint FloatWidth, #uint FloatFracBits>(
    clk: clock, 
    twiddle_port: Port<{uint_bits_to_fit(N)}, int<1>>
) {
    gen if N == 1 {

    } else {

    }
   // inst({N / 2}) 
   // inst({N / 2}) 
}

Reported error

bug: Inferred an any meta-type with traits
   ┌─ src/main.spade:14:24

14 │     twiddle_port: Port<{uint_bits_to_fit(N)}, Complex<FloatWidth, FloatFracBits>>
   │                        ^^^^^^^^^^^^^^^^^^^^^

   = note: This is an internal bug in the compiler.
           We would appreciate if you opened an issue in the repository:
           https://gitlab.com/spade-lang/spade/-/issues/new?issuable_template=Internal%20bug
   = note: Triggered at spade-typeinference/src/lib.rs:2330

Error: aborting due to previous error

Location:
    spade-compiler/src/main.rs:158:17
[ERROR] Failed to build spade code
Error:
   0: Failed to build spade code

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   1: backtrace::backtrace::trace::hef1bce4d256eda1e
      at <unknown source file>:<unknown line>
   2: backtrace::capture::Backtrace::new::hd313162f573eba0a
      at <unknown source file>:<unknown line>
   3: color_eyre::config::EyreHook::into_eyre_hook::{{closure}}::h2daca97e27cd41ea
      at <unknown source file>:<unknown line>
   4: eyre::error::<impl eyre::Report>::from_adhoc::h92644674689a1b25
      at <unknown source file>:<unknown line>
   5: swim::spade::build_spade::h068fbe8d87293e0e
      at <unknown source file>:<unknown line>
   6: swim::builtin_command::{{closure}}::h3459c2538b5750f5
      at <unknown source file>:<unknown line>
   7: tokio::runtime::park::CachedParkThread::block_on::h0bfaa55587f0d61a
      at <unknown source file>:<unknown line>
   8: swim::main::h360f4cb5cc1aa522
      at <unknown source file>:<unknown line>
   9: std::sys::backtrace::__rust_begin_short_backtrace::h49de4bf07ae87fc5
      at <unknown source file>:<unknown line>
  10: std::rt::lang_start::{{closure}}::h21af7b1931b0f010
      at <unknown source file>:<unknown line>
  11: std::rt::lang_start_internal::h5f91760815528aa2
      at <unknown source file>:<unknown line>
  12: _main<unknown>
      at <unknown source file>:<unknown line>