在我的部分:
data Query a = SetImageUrl Int String a主要(app)组件:
eval :: Query ~> H.ParentDSL State Query ChildQuery ChildSlot Void m
eval = case _ of
HandleItemChange groupId (LIS.ActiveChanged selected) next -> do
let apReq = AP.SetImageUrl groupId (imageUrl selected)
_ <- H.query' CP.cp2 AvatarPictureSlot (H.request apReq)
pure next编译器说:
[1/1 InfiniteType] src/App.purs:85:57
85 _ <- H.query' CP.cp2 AvatarPictureSlot (H.request apReq)
^^^^^
An infinite type was inferred for an expression:
t0 -> t0
while trying to match type t0 -> t0
with type t0
while checking that expression apReq
has type (t0 -> t0) -> t1 t0
in value declaration app
where t0 is an unknown type
t1 is an unknown type我认为插槽和子路径是可以的,因为render函数编译和工作正常。
如何修复这个错误?我检查了几次指南,但是我没有看到任何不同,编译器消息对我来说是非常没有帮助的。
发布于 2018-11-11 13:46:56
github的解决方案:
_ <- H.query' CP.cp2 AvatarPictureSlot (H.action apReq)对于不返回任何内容的查询,应该使用H.action而不是H.request。
https://stackoverflow.com/questions/53237962
复制相似问题