Skip to content

Mutually recursive schema-key definitions lead to StackOverflowError #43

@rublag

Description

@rublag

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))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions