[Ur] code bug
Adam Chlipala
adamc at csail.mit.edu
Mon Sep 30 16:38:09 EDT 2013
On 09/30/2013 12:21 PM, Sergey Mironov wrote:
> Consider following code:
>
> fun noDml (q:dml) : transaction {} =
> e<- tryDml q;
> return {}
>
> task initialize = fn {} =>
> noDml (INSERT INTO page(Id, Caption) VALUES (0, "Top"));
> noDml (INSERT INTO page(Id, Caption) VALUES (1, "Top"));
> return {}
>
> When compiling, urweb issues the following error:
>
> dev:[grwlf at greyblade:~/proj/urdesign]$ LANG=C make
> building stamp1
> urweb -dbms sqlite AppMM
> /tmp/filestFy18/webapp.c:371:37: error: unknown type name 'uw_Basis_dml'
>
Ah, this was just a case of a bad error message. I meant for the
compiler to complain that you haven't used a 'database' directive to
declare the database connection of this application, so it is not legal
to use SQL actions. There was a bug in the analysis for detecting when
SQL is used in program code, and your experience with small program
variants "fixing" the problem is just based on the particularities of
that bug. It's fixed now, in a changeset pushed to the public repo.
More information about the Ur
mailing list