Report declaration emit errors

Fixes #628
this seems wrong.  A more appropriate pattern would be:

```
var savedWriter = writer;
allDiagnostics ...
writer = savedWriter;
```