Tensegritics / ClojureDart

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

Dart compiler error when using type annotation inside defrecord #244

Open f3zhead opened 1 year ago

f3zhead commented 1 year ago

Describe the bug When I try writing the code

(defrecord Model [^int counter])

and then running clj -M:cljd flutter, I get a Dart compiler error: lib/cljd-out/acme/main.dart:235:45: Error: The argument type 'int' can't be assigned to the parameter type 'V'. final dc.List<V> fl$5=(dc.List<V>.filled(1, counter, ));

The problem persists after clj -M:cljd clean && flutter clean.

To Reproduce Steps to reproduce the behavior:

  1. Use the project setup described in the ClojureDart README (I got the problem on the latest main, commit f2709454569ca0bc7f666f475fb09293fbb1eb31)

  2. add the line

    (defrecord Model [^int counter])

    anywhere in src/acme/main.cljd.

  3. run clj -M:cljd flutter

Expected behavior No compiler errors.

Additional context I'm trying to use the Elm Architecture in flutter with dartea.

Also thank you all very much for making ClojureDart!