-
Notifications
You must be signed in to change notification settings - Fork 55
Error messages
Kiwamu Okabe edited this page Jan 1, 2016
·
7 revisions
Perhaps the most common error for most people new to ATS will be typechecking errors. For this reason, all new users are encouraged to read some demonstrations and examples in the typechecking errors article.
Error messages are evolving in ATS2. There are five primary classes of error messages: parsing errors, linker errors, runtime errors, compiler errors, and the most common -- typechecking errors. For error messages known to have been used in the past, especially in ATS1, please see the old wiki.
You can pretty-print the error using PostiATS-Utilities.
$ git clone https://github.com/Hibou57/PostiATS-Utilities.git
$ export PATH=$PATH:`pwd`/PostiATS-Utilities
$ patsopt -d DATS/main.dats
/home/kiwamu/src/arduino-ats/demo/lcd_greeting/DATS/main.dats: 1016(line=20, offs=26) -- 1016(line=20, offs=26): error(3): unsolved constraint: C3NSTRprop(C3TKmain(); S2Eapp(S2Ecst(<=); S2Eapp(S2Ecst(+); S2EVar(1969->S2Evar(i(5685))), S2EVar(1970->S2Eintinf(16))), S2EVar(1968->S2Evar(n(5684)))))
typechecking has failed: there are some unsolved constraints: please inspect the above reported error message(s) for information.
exit(ATS): uncaught exception: _2home_2kiwamu_2src_2ATS_2dPostiats_2src_2pats_error_2esats__FatalErrorExn(1025)
$ patsopt -d DATS/main.dats |& pats-filter
DATS/main.dats:20:26: unsolved constraint: [1]
[1]: ((S2EVar(1969 -> i) + S2EVar(1970 -> 16)) <= S2EVar(1968 -> n))
typechecking has failed: there are some unsolved constraints: please inspect the above reported error message(s) for information.
exit(ATS): uncaught exception: _2home_2kiwamu_2src_2ATS_2dPostiats_2src_2pats_error_2esats__FatalErrorExn(1025)