mlabs-haskell / mlabs-haskell/lambda-buffers

error: reached the recursion limit while instantiating `json_field`

Open
#251 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug codegen rust
Dominant language
Haskell
Stars
32
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Error

error: reached the recursion limit while instantiating `<{closure@scripts::lbr_prelude::json::lamval::json_field<'_, RoCMinting>::{closu
re#0}::{closure#0}} as FnOnce<(Box<dyn Fn(...) -> ...>,)>>::call_once - shim(vtable)`                                                   
   --> /home/bladyjoker/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lbr-prelude-0.1.3/src/json/lamval.rs:61:24                 
    |                                                                                                                                   
61  |     Box::new(move |x1| Box::new(move |x2| super::json_field(x0, x1, x2)))                                                         
    |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                          
    |                                                                                                                                   
note: `call_once` defined here                                                                                                          
   --> /nix/store/ryfyfy694d097gif9s0dg8kj1aca08c1-rust-default-1.78.0/lib/rustlib/src/rust/library/core/src/ops/function.rs:250:5      
    |                                                                                                                                   
250 |     extern "rust-call" fn call_once(self, args: Args) -> Self::Output;                                                            
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                            
    = note: the full type name has been written to '/home/bladyjoker/mlabs/unbox-infinity/infinity-extras/infinity-proto-conversions/tar

Full type name:

<{closure@scripts::lbr_prelude::json::lamval::json_field<'_, RoCMinting>::{closure#0}::{closure#0}} as FnOnce<(Box<dyn Fn(&scripts::serde_json::Value) -> std::result::Result<RoCMinting, scripts::lbr_prelude::error::Error>>,)>>::call_once - shim(vtable)

Problem schema

https://github.com/mlabs-haskell/unbox-infinity/blob/163b805f21f7a77a3bcd501fa261f1aa9ecf544f/infinity-api/lbf/Infinity/Application/Validation/Prelude.lbf#L42

References

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with lbr-prelude/src/json/lamval.rs at line 61 and the problem schema at infinity-api/lbf/Infinity/Application/Validation/Prelude.lbf line 42. Reproduce the Rust compilation failure for the schema and inspect how json_field is instantiated; done means the schema compiles without reaching Rust's recursion limit.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell, rust
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.