-
-
Notifications
You must be signed in to change notification settings - Fork 100
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
Type cast error on latest blessed sha #319
Comments
the warnings are red herrings and are fixed on main |
How is |
@valerauko provided form is not enough to repro. Can you share more? At least how |
@cgrand here's a full main.cljd. This works on previous sha but results in error on latest. (ns repro.main
(:require ["package:flutter/material.dart" :as m]
[cljd.flutter :as f]))
(defn loading
([]
(loading (m/Color. 0xff3c434d)))
([^m/Color color]
(f/widget
m/Center
m/CircularProgressIndicator
.valueColor
(m/AlwaysStoppedAnimation. color))))
(defn main []
(f/run
m/MaterialApp
.home
(f/widget
m/Center
(loading)))) |
@valerauko e05433c is the culprit! I wasn't suspecting that. Will fix asap. |
For now, not upgrading to latest sha is the "workaround". It works fine on the previous blessed sha and I didn't see any critical changes that would require latest sha, so I can wait for the fix to be released~ |
The afore-mentioned commit is sound. The expansion of f/widget changed and introduced an extra let. (deftest infer-type-args
(let [e (MapEntry (str "a") (count "a"))]
(is (instance? #/(MapEntry String int) e)))) fails currently, saying e is an instance of |
Hmm but in my case, |
the problem is not with |
I worked around this by changing the offending code as follows (defn loading
([]
(loading (m/Color. 0xff3c434d)))
([^m/Color color]
(f/widget
m/Center
(m/CircularProgressIndicator
.valueColor (m/AlwaysStoppedAnimation. color))))) (eg manually added parens around the CircularProgressIndicator so it wouldn't rely on the f/widget expansion) |
Obvious workaround in hindsight. |
Describe the bug
The offending widget is as follows
Does your problem persist after
clj -M:cljd clean && flutter clean
?Yes
To Reproduce
After
cljd upgrade
the UI is full of the above exceptionExpected behavior
No type cast error
Additional info
Not sure if related but there are also two dynamic warnings
The text was updated successfully, but these errors were encountered: