codon
codon copied to clipboard
Codon cannot find a symbol that is declared in the previous statement
I have a flask application and I want to give it a try building it with Codon. When building the application via codon build -release -exe app.py I get the following error:
Assert failed: cannot find 'update_fts' [fts.py:84:1]
Expression: f
Source: /github/workspace/codon/parser/visitors/simplify/ctx.cpp:100
Aborted
However, in the code there are these statements:
update_fts = DDL('''CREATE TRIGGER work_item_update AFTER INSERT ON work_item
BEGIN
INSERT INTO work_item_fts (id, type, state, title, description)
VALUES (new.id, new.type, new.state, new.title, new.description);
END;''')
db.event.listen(WorkItem.__table__, 'after_create', CreateFtsTable(WorkItem))
db.event.listen(WorkItem.__table__, 'after_create', update_fts)
db.event.listen(WorkItem.__table__, 'after_create', get_fts_references)
I guess is worth highlighting also that the statement db.event.listen(WorkItem.__table__, 'after_create', update_fts) is in line 75, not 81.
Am I doing something wrong, or this is a bug?