bug1241.scala:5: error: class type required but AnyRef{def hello(): Unit} found val x4 = new T { def hello() { println("4") } } // error! ^ bug1241.scala:5: error: AnyRef{def hello(): Unit} does not have a constructor val x4 = new T { def hello() { println("4") } } // error! ^ two errors found