Kiwamu Okabe
unread,Mar 31, 2021, 8:31:04 AM3/31/21Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ats-lang-users
Dear all,
I wrote following ATS code:
```ats
#include "share/atspre_define.hats"
#include "share/atspre_staload.hats"
fun concat_rnd_base {i:int | i > 0} (align: ulint i): ulint =
undefined()
fun concat_exec_imgact {i:int} (pagesizes: ulint i): ulint = let
val psize = if pagesizes > 0UL then pagesizes else 1UL
in
concat_rnd_base(psize)
end
implement main0 () = {
}
```
but above code causes following error:
```
$ patscc main.dats
.../main.dats: 302(line=10, offs=21) -- 307(line=10, offs=26):
error(3): unsolved constraint: C3NSTRprop(C3TKmain();
S2Eeqeq(S2Evar(i(8481)); S2Eintinf
(1)))
```
I belive the `psize` depends on `{i:int | i > 0}`.
How to avoid the unsolved constraint error?
Best regards,
--
Kiwamu Okabe at METASEPI DESIGN