make generated code actually compile, and add a test for that