Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mutually recursive schema-key definitions lead to StackOverflowError #43

Open
rublag opened this issue Nov 18, 2022 · 0 comments
Open

Comments

@rublag
Copy link
Contributor

rublag commented Nov 18, 2022

Mutually recursive schema-key definitions lead to StackOverflowError.
Example:

(do                                                                                                                                                                                          
  (require '[zen.core :as zen])                                                                                                                                                              
  (def ztx (zen/new-context))                                                                                                                                                                
  (def mns                                                                                                                                                                                   
    '{ns mns                                                                                                                                                                                 
                                                                                                                                                                                             
      a {:zen/tags #{zen/schema zen/tag}                                                                                                                                                     
         :schema-key {:key :a}                                                                                                                                                               
         :type zen/map                                                                                                                                                                       
         :keys {:a {:type zen/symbol}}}                                                                                                                                                      
                                                                                                                                                                                             
      b {:zen/tags #{zen/schema zen/tag}                                                                                                                                                     
         :schema-key {:key :b}                                                                                                                                                               
         :type zen/map                                                                                                                                                                       
         :keys {:b {:type zen/symbol}}}                                                                                                                                                      
                                                                                                                                                                                             
      c {:zen/tags #{a}                                                                                                                                                                      
         :a b                                                                                                                                                                                
         :b a}})                                                                                                                                                                             
  (zen/load-ns ztx mns))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant