Evaluate templates in isolation
JonatanWaern opened this issue · 1 comments
In DMLC, templates are only evaluated as they are part of other objects. Meaning unused templates get largely unanalyzed.
When writing templates, it would be handy to have templates evaluate all or part of themselves locally. This should of course not be a full evaluation of a template as if it was an object (abstract methods and parameters are ok). but inheritance order, type problems, and naming conflicts could all be found in isolation.
Similarly, files that are not imported from a device file are currently not semantically analyzed either. But it should be possible to find internal errors of those files, and goto def/ref etc. within them and to files they import.
Special handling will be needed for errors detected within files/templates analyzed in only this manner. In particular errors found that could be fixed when concretely instantiating the template or importing the file, should be modified to a corresponding warning instead.
Further noted: files that are not eventually imported from a file with a device declaration should also be analyzed in "isolation" (as if they were imported from a file containing only a device decl)