BAR
BAR

Reputation: 17151

How to skip error checking when compiling Scala files in IDEA?

The run config option Make, no error check in IntelliJ IDEA does not skip Scala errors that result in ambiguous ClassDefNotFound errors upon running a project.

How do I skip error checking when compiling Scala files?

My end goal is for the program to fail at runtime when the classes with errors are accessed, not before runtime preventing the whole program from running.

Upvotes: 1

Views: 189

Answers (1)

0__
0__

Reputation: 67330

As the name suggests, "Make, no error check" will just pretend compile errors don't matter. Then obviously you end up with an incomplete class path, not containing any classes that produce compiler errors. As a consequence, when you run that project, you should not be surprised to find class-not-found errors.

I don't know how this "feature" interacts with the incremental Scala compiler. I wouldn't expect "Make, no error check" to produce any useful results.

If you want to skip parts of your code that currently don't compile, a good solution is to use the ??? "hole" value, i.e. a placeholder of type Nothing that you can plug into any position where you would have incomplete code. E.g.

def myMethod: String = ??? // implement later

This allows these things to be compiled and will only produce runtime errors when hit during runtime.

Upvotes: 1

Related Questions