Scala warnings, IntelliJ and compiler flags

前端 未结 3 1683
悲哀的现实
悲哀的现实 2021-02-20 04:26

I\'m currently giving the IntelliJ Scala plugin a spin and one thing is bugging me a wee-bit. I get 3 warnings when compiling.

Warning: scala: Recompiling 4 file         


        
3条回答
  •  无人及你
    2021-02-20 05:00

    I would like to add few words about warnings and errors reported by IntelliJ IDEa.

    JetBrains uses it's own scala analyzer to identify and report errors. Sometimes it reports fake errors or warnings. I think this is because scala is much more complicated language from compilers point of view then much of other languages. Even if all official scala specification was implemented there are some cases which have been omited (read: There always are some bugs). If you find something reported as error/warning by your IntelliJ IDEa which is ok for scalac compiler you can always try to report it as a bug (IntelliJ IDEa supports reporting bugs). Guys from JetBrains will fix it.

    More over some scala libraries use macros that are compiler extentions which adds some extra compiler behaviour. If IDE did know their specification it wouldn't identify these non standard codes as errors. It's better to be aware of that. I think the same touches Eclipse scala IDE.

    Summarizing all above: Do not trust all warnings and errors that IntelliJ or other IDE is telling you unless it compiles well using scalac.

提交回复
热议问题