Interesting...I see exactly what's going on here. There are two kinds of interesting operations:
- A compile: converts your script/class into a class file and places it into the output folder. In this case, the scripts in script folders are not actually copied to the output folder even though they are checked for compile errors. When there is an incremental compile of Test1, the compiler tries to resolve the import Test2 but can't since there is no corresponding class file in the output folder. Hence the error. On a full build where both Test1 and Test2 are compiled together, the resolution is slightly different. Resolution happens from source and since the source of Test2 exists, its reference in Test1 can be resolved and hence no error in this case.
- A reconcile: this happens while typing. It is an almost compile, except that no class files are written and resolution happens against source code (this is how it is possible to see unsaved changes in other files). It is used to find errors while you type and to get the information during content assist (and other things like this). In this case, resolution happens against other sources, so there are no errors found and content assist, underlines, etc work properly.
The problem is that during an incremental compile, we are finding the error simply because the referred file does not exist in the output folder. The errors are being recorded even though the reconcile finds no errors.
Two possible solutions:
- Don't record errors on scripts during compile
- Don't send scripts to the compiler, but do send them to the reconciler.
I'm closing this bug and opening a new one that correctly describes the problem you are seeing. Thanks for being patient and working through this with me.