Tensegritics / Tensegritics/ClojureDart

better error messages need for circular dependencies

Open
#209 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Clojure
Stars
1.6k
Forks
119
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

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

Reproduce the mutual app.a and app.b namespace references using the example and inspect cljd.compiler/host-load-input at compiler.cljc:4059. Trace where the StackOverflowError is reported and make the failure identify the circular namespaces instead. Done means the provided example produces an actionable circular-dependency error rather than a null report.

Written by the indexing model from the issue text.

Assessment

Tech stack
clojure, dart, flutter
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.