0

I have a project with scala and java. For scala compilation scala-maven-plugin is used.

So during the build there are some messages like that:

[INFO] --- scala-maven-plugin:3.1.6:testCompile (scala-test-compile) @ project_name ---
...    
[ERROR] Nothing <: com.some.SomeType?
[INFO] true
...

What does it mean? The source of scala class is below:

package com.some

package object model {

  type SomeType = List[String]

  object SomeType {
    def apply(msg: String): SomeType = List(msg)
  }

  type SecondType[I] = AnyRef {
    def id: I
    def version: Long
  }

  type AnotherSecondType = SecondType[Another] {
    def id: Another
    def version: Long
  }

}

P.S. Also, there are other such message pairs for other scala classes.

UPDATED Maven build completes successfull, but I have these messages in the log.

Cherry
  • 31,309
  • 66
  • 224
  • 364
  • I do not think you've pasted the right thing. Type `Another` does not exist. By declaring it, compilation works. No question mark needed in that log line, since `Nothing` really is a subtype of everything, so that exposed relationship is correct. And when pasting errors - don't omit so much. – Alexandru Nedelcu Jun 26 '14 at 19:50
  • `Another` and `SecondType` just other scala classes in other packages. – Cherry Jun 30 '14 at 07:39
  • Also I pay your attantion that this message appearace **does not** mean that build crushes. Instead build finishes complete, but I have these messages in the log. – Cherry Jun 30 '14 at 07:41

1 Answers1

0

This looks like you have -explaintypes enabled in your Scala compiler options. Open your pom.xml and check the <plugin><plugins> entry for scala-maven-scala. See if in <configuration><args> you have <arg>-explaintypes</arg>. These messages can sometimes aid in cleaning up type errors in your code but I find them too annoying to keep them on all the time.

Mario Camou
  • 2,303
  • 16
  • 28