Tensegritics / ClojureDart

Clojure dialect for Flutter and Dart
1.44k stars 91 forks source link

better error messages need for circular dependencies #209

Open vinurs opened 1 year ago

vinurs commented 1 year ago

Better error messages are needed for circular dependencies in the ‘cljd’ namespace. The current error message doesn’t provide enough information to locate the problem.

(ns app.a
  (:require
   ["dart:core" :refer [print]]
   ["package:flutter/material.dart" :as m]
   [app.b]
   [cljd.flutter :as f]))

A and B namespaces have mutual references

(ns app.b
  (:require
   ["dart:core" :refer [print]]
   ["package:flutter/material.dart" :as m]
   [app.a]
   [cljd.flutter :as f]))

then cljd exit with

Compiling to Dart... @06:46
  app.main
Execution error (StackOverflowError) at cljd.compiler/host-load-input (compiler.cljc:4059).
null

Full report at:
/var/folders/5r/g9bcl2wd68j8v611zphm76jr0000gn/T/clojure-17752425902906940630.edn