我写在Java和斯卡拉(使用互操作)一个程序,它不断给我这个编译错误至极没有意义....斯卡拉非法继承错误是没有意义的
说明资源路径位置类型 非法继承;继承不同类型的特征IEvaluationFunction实例:core.interfaces.IEvaluationFunction [core.representation.ILinearRepresentation [Double]]和core.interfaces.IEvaluationFunction [core.representation.ILinearRepresentation [Double]] IConstructors.scala/ScalaMixins - Parjecoliv1/src/aop第36行Scala问题
它说它继承不同类型的实例,但它们是相同的。他们都:
core.interfaces.IEvaluationFunction [core.representation.ILinearRepresentation [双]
有人可以帮我解决或理解这一点?
该代码:
这是它给出错误的地方。代码在Scala中。
def createFermentationEvaluation(fermentationProcess:FermProcess,
interpolationInterval:Int):FermentationEvaluation = {
return new FermentationEvaluation(fermentationProcess,interpolationInterval)
with EvaluationFunctionAspect[ILinearRepresentation[Double]]
}
这里是接口和类,它使用:
public class FermentationEvaluation
extends EvaluationFunction<ILinearRepresentation<Double>>
trait EvaluationFunctionAspect[T <:IRepresentation]
extends IEvaluationFunction[T] {...}
public abstract class EvaluationFunction<T extends IRepresentation>
implements IEvaluationFunction<T>,java.io.Serializable {...}
public interface IRepresentation {...}
public interface ILinearRepresentation<E> extends IRepresentation {...}
我并没有包括任何的身体,因为它似乎是一个继承的问题。
请用标志'-explaintypes'进行编译。 – 2014-10-30 04:54:30