Run the Scala application in the Scala IDE with compilation errors

Is there a way to run a Scala or unit test application in Scala IDE 2.0.2 (Eclipse 3.7) if there are (unrelated!) Compilation errors in the project?

This is not a problem in Java, but the Scala IDE keeps telling me:

The project contains compilation errors (therefore no binaries were created).

All I want to do is run a little test during the big refactoring process, but I can’t fix all the compilation errors right now. And I don't want to start commenting on things, because these compilation errors are good reminders of the tasks that still need to be done.

+7
source share
2 answers

The Scala IDE does not currently support this behavior, but it would be nice if it were possible.

To keep abreast of this, I created a ticket :

JDT allows you to execute Java code, despite compilation problems in the sources. Internally, the JDT replaces the defective code with an exception that is thrown if the corresponding code is executed. But if the defective code is never called at runtime, nothing bad happens. It would be nice if the SDT supports this behavior.

+4
source

If you are using Scala 2.10, a good option is to use the recently introduced notation ??? . This way your code will be compiled even if the function is not yet implemented.

Of course, there is a better way, but this one will still be better than commenting on the code.

As suggested by Jesper, can you still implement ??? if you are working with previous versions of Scala:

 def ??? : Nothing = throw new Error("Not implemented") 
+1
source

All Articles