illegal cyclic inheritance involving trait Iterable_2种解决方式

简介: illegal cyclic inheritance involving trait Iterable_2种解决方式

一、报错内容

/Users/liyangda/Code/DemoProject/demo-scala/src/scala/old04/T4.scala:11:20
illegal cyclic inheritance involving trait Iterable
    val value= List(1, 2, 3, 4, 5, 6, 7, 8)

二、问题解决

1、方式一:降低scala版本

可以选择降低Scala的版本,可以解决一定的问题。

2、更改maven打包配置

将maven打包的方式,改为Scala的打包方式,初始化创建的时候,都是maven的打包,也就是默认Java的,还是需要更换为Scala的打包方式。

<build>
    <finalName>SparkCoreTest</finalName>
    <plugins>
        <plugin>
            <groupId>net.alchim31.maven</groupId>
            <artifactId>scala-maven-plugin</artifactId>
            <version>3.4.6</version>
            <executions>
                <execution>
                    <goals>
                        <goal>compile</goal>
                        <goal>testCompile</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>
目录
相关文章
|
2月前
|
编译器
|
2月前
|
分布式计算 Java Scala
Scala:面向对象、Object、抽象类、内部类、特质Trait(二)
Scala:面向对象、Object、抽象类、内部类、特质Trait(二)
74 0
|
11月前
|
算法 Python
如何实现Python中的多重继承(Multiple Inheritance)以及方法解析顺序(MRO)
如何实现Python中的多重继承(Multiple Inheritance)以及方法解析顺序(MRO)
229 0
|
分布式计算 Java 编译器
关于jvm范型和scala implicit隐式参数以及classTag[T] typeTag[T]的一点思考
关于jvm范型和scala implicit隐式参数以及classTag[T] typeTag[T]的一点思考
106 0
多重继承(Multiple Inheritance)
多重继承(Multiple Inheritance)
125 0
typescript38-class的构造函数实例方法继承(implement)
typescript38-class的构造函数实例方法继承(implement)
67 0
typescript38-class的构造函数实例方法继承(implement)
|
Android开发 Kotlin
【错误记录】Kotlin 编译报错 ( Class ‘Xxx‘ is not abstract and does not implement abstract member )
【错误记录】Kotlin 编译报错 ( Class ‘Xxx‘ is not abstract and does not implement abstract member )
657 0
【错误记录】Kotlin 编译报错 ( Class ‘Xxx‘ is not abstract and does not implement abstract member )
|
Android开发 Kotlin
【错误记录】Kotlin 编译报错 ( Not nullable value required to call an ‘iterator()‘ method on for-loop range )
【错误记录】Kotlin 编译报错 ( Not nullable value required to call an ‘iterator()‘ method on for-loop range )
238 0
【错误记录】Kotlin 编译报错 ( Not nullable value required to call an ‘iterator()‘ method on for-loop range )
成功解决AttributeError: 'NoneType' object has no attribute '__array_interface__'
成功解决AttributeError: 'NoneType' object has no attribute '__array_interface__'
成功解决AttributeError: 'NoneType' object has no attribute '__array_interface__'
|
Scala 索引 开发工具