I executed this code block in a IntelliJ worksheet (Community Edition EAP 15#143.379.11 with Scala plugin 1.9.4 on JDK 1.8.0_66) ,
class Plant
class Fruit extends Plant
class Apple extends Fruit
class Box[T <: Fruit](var item: T) {
def get: T = item
def replace(item: T): Unit = this.item = item
}
val appleBox = new Box(new Apple)
println(appleBox.get) // error
and IntelliJ reported this error during worksheet compilation and stopped,
Error:(22, -59) side-effecting nullary methods are discouraged: suggest defining as `def get$$instance$$res0()` instead
println(appleBox.get);//
^
How do I disable this error or change it to warning and let me continue? I am using IntelliJ . Thanks