Scala软件包问题

Scala软件包问题,scala,intellij-idea,import,package,Scala,Intellij Idea,Import,Package,我有一个包含单词类型(名词,动词,形容词…)的Words包,但尽管我导入了单词。并且我的IDE很好地找到了每个类,但我有以下错误: Error:(11, 40) type mismatch; found : Word (in Words) required: Word (in <empty>) val adj: Word = WordFactory.produce("big") 如果我澄清val测试:Words.Word我的测试失败: Adjective(big,big

我有一个包含单词类型(
名词
动词
形容词
…)的
Words
包,但尽管我导入了
单词。
并且我的IDE很好地找到了每个类,但我有以下错误:

Error:(11, 40) type mismatch;
found   : Word (in Words) 
required: Word (in <empty>) 
  val adj: Word = WordFactory.produce("big")
如果我澄清
val测试:Words.Word
我的测试失败:

Adjective(big,big,m,sp) did not equal Adjective(big,big,m,sp)
ScalaTestFailureLocation: WordFactoryTests at (WordFactoryTests.scala:13)
Expected :Adjective(big,big,m,sp)
Actual   :Adjective(big,big,m,sp)
形容词
是一个case类,因此对于相同的参数,它不能不同。
作为参考,我还有其他测试(测试其他case类,如
Noun
),它们是相同的,但运行良好

编辑:
问题似乎与scalatest无关,即使在main中,我也有错误(带有

这是我的文件
Word.scala

package Words

abstract class Word() {
  val correctWriting: String
  val lemma: String
  var currentWriting: String = correctWriting

  def isCounterfeited: Boolean = this.currentWriting != this.correctWriting

  def counterfeit()
}
package Words

case class Adjective(correctWriting: String, lemma: String, gender: String, number: String) extends Word {
  override def counterfeit: Unit = Counterfeiters.Adjective.counterfeit(this)
}
形容词.scala

package Words

abstract class Word() {
  val correctWriting: String
  val lemma: String
  var currentWriting: String = correctWriting

  def isCounterfeited: Boolean = this.currentWriting != this.correctWriting

  def counterfeit()
}
package Words

case class Adjective(correctWriting: String, lemma: String, gender: String, number: String) extends Word {
  override def counterfeit: Unit = Counterfeiters.Adjective.counterfeit(this)
}

完整的代码已打开。

最后我重命名了我的项目,它解决了这个问题。奇怪的IDE东西,我以前在没有包的情况下工作,包中的重组破坏了一些东西。

我想你也会面临同样的问题,试着清理你的IDE吧

最后我重新命名了我的项目,它解决了这个问题。奇怪的IDE东西,我以前在没有包的情况下工作,包中的重组破坏了一些东西。

我想你也会面临同样的问题,试着清理你的IDE吧

我认为Scalatest等式是一个复杂的主题,我不确定==是否使用case类比较。你能试着用===来代替吗?不幸的是,
====
并没有改变任何东西,不管怎样,还是很好的尝试。我可以看一看另一个测试套件,目前我正在使用
FunSuite
。如果没有看到更多的代码,恐怕很难给出任何建议。你能至少张贴形容词的来源吗?尝试将问题源减少到最低限度,以便您可以将其发布到此处。完成后,我没有减少代码,因为它已经很短。关闭,但尚未出现-代码尚未产生错误。
WordFactory
在哪里,或者如何生成错误?什么是
造假者
?我认为Scalatest等式是一个复杂的主题,我不确定==是否使用case类比较。你能试着用===来代替吗?不幸的是,
====
并没有改变任何东西,不管怎样,还是很好的尝试。我可以看一看另一个测试套件,目前我正在使用
FunSuite
。如果没有看到更多的代码,恐怕很难给出任何建议。你能至少张贴形容词的来源吗?尝试将问题源减少到最低限度,以便您可以将其发布到此处。完成后,我没有减少代码,因为它已经很短。关闭,但尚未出现-代码尚未产生错误。
WordFactory
在哪里,或者如何生成错误?什么是制假者?