Clojuredart:class ...没有实例方法'呼叫'

发布于 2025-02-07 04:51:29 字数 586 浏览 3 评论 0原文

我遇到了这个错误。 我有一个尺寸的对象,我想获得其高度和宽度。在我的clojuredart代码中,我做到了:

(.height size)

在Dart中给出了:

(size.height() as double)

我该如何访问此属性,我知道这不是函数/方法?

顺便说一句,我有那些警告:

Stern warning: can't resolve member height on target type dynamic of library dart:core at line: 25, column: 42, file: ifs/main.cljd
Stern warning: can't resolve member width on target type dynamic of library dart:core at line: 25, column: 57, file: ifs/main.cljd

I have encountered this error.
I have a Size object, and I want to get its height and width. In my clojureDart code, I did:

(.height size)

which gave in Dart:

(size.height() as double)

How can I access this property, which I know isn't a function/method ?

Btw I had those warnings:

Stern warning: can't resolve member height on target type dynamic of library dart:core at line: 25, column: 42, file: ifs/main.cljd
Stern warning: can't resolve member width on target type dynamic of library dart:core at line: 25, column: 57, file: ifs/main.cljd

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

清旖 2025-02-14 04:51:31

好的,我应该指定我的变量大小是哪种类型。
这样:

(defn transform [pic n ^m/Size size]
  ...
  (.height size))

没有警告或错误!

Ok, I should have specify what type my variable size was.
Like this :

(defn transform [pic n ^m/Size size]
  ...
  (.height size))

No warnings nor error!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文