简体   繁体   中英

Scala plugin for IntelliJ IDEA 10 not detecting simple errors?

I know I must be missing something, but can't figure out what. When I create a scala project, following the scala-plugin instructions, not a single syntax error is detected. For example:

object MyApp {
  val aNumber: Int = "hello"
}

does not detect any error. If I right-click and ask it to compile, then I get the expected type mismatch error from the scala compiler. This is just a silly example, no syntax errors are being flagged. For regular Java projects it works fine, so it must be scala specific.

I have a clean install of IDEA 10 CE on a OSX 10.6 and Scala 2.8.1 final. I have set up the jdk in the project settings as well as the scala home when creating the project. I have the latest version of the plugin (12/2010).

Any hint on what I'm missing?

You have to enable error highlighting. Turn on Settings/Code Style/Scala/Other settings/Enable experimental error highlighting

Works here too (IntelliJ 10.0.1, Scala 2.8.1, OpenJDK, Ubuntu 10.10 64bit).

If you want more type checking you can also tick "Enable experimental error highlighting (possibly shows many wrong red code)" in the Settings, but this shouldn't make a difference in your case, although it works perfectly in my case for a large code base.

intelliJ IDEA 10.0.1 + scala 2.8.1 on Ubuntu 10.10 64bit.

It shows a type mismatch error

In project structure > modules > [your project name] > dependencies tab, do you have scala-compiler-[some version] listed?

See the Exploring the Project Structure here

For 2019.1 CE on Mac OS:

Preferences | Build, Execution, Deployment | Compiler | Scala Compiler

Checked the option:

Features->Experimental Features

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM