Hello Christiaan, thank you very much for your quick response. I appreciate it very much.
In no particular order, I am using debian unstable on a 64b AMD platform and ghc with clash 1.8.1 is 9.4.7. In this particular module
there are no primitives of my own, but there are elsewhere in another module (but I have now ifdefed them out, they were only for reporting) and I have no doubt that none
of my own primitives can have been brought in inadvertently, not least because of the ifdefing. But I'll certainly use OPAQUE instead of NOINLINE when I ifdef them back in.
I have had a look at the clash source code now and the error message is a catch at the bottom of a case switch and that indicates some pattern is missed. The line is
> _ -> error $ $(curLoc) ++ "mkDcApplication undefined for: " ++ show (dstHType,dc,args,argHWTys)
and the case switch was "case (hWTysFiltered,argExprsFiltered) of"
The error report shows the function args, not the case argument. The cases seem to cover Signed, Unsigned etc, so I think it is certainly
some type construct that has been missed but that code works under clash 1.6.4 so perhaps one could look for a change
in that function since the 1.6.4 release? The function is "mkDcApplication declType [dstHType] bndr dc args", and the function arguments are more or less what is reported in the error
message. (I would like it if the error message showed what case has been missed).
I have added the complete error message as an attachment here.
Yes, there are a few "~" in the type declarations and I have noticed that 1.8.1 seems weaker than 1.6.4 at type inference. (For instance I used
to be able to write (n-1)+1 ~ n in 1.6.4 to tell clash that there is something to which one adds 1 to get n and it was not necessary to add 1<=n, but
now it is necessary). With that clue I will try removing need for "thinking" on clash's part to resolve the types there. I hadn't realized it
may be the typing. It may be just one of those corner case things that will go away with any change.
But definitely 1.6.4 copes and the ghc with 1.6.4 is 9.0.2 . (Both setups are available in different sandboxes on the same machine)
Regards
PTB