-- Error: ------------------------------------------------ 1 |val f = { x: Int => x } | ^ |parentheses are required around the parameter of a lamb |This construct can be rewritten automatically under -re 25 / 66
64-Bit Ser Type in expressions for evaluation. Or try :help. scala> trait A | | class B extends A | | trait X { | def foo: A | } | | class Y extends X { | override def foo = new B // ここの型を省略するかどうか | } | | val y = new Y | | y.foo // Scala 3 ではB ではなくA 型でかえる。Scala 2 ではB 49 / 66
Java OpenJDK 64-Bit Ser Type in expressions for evaluation. Or try :help. scala> trait A[B] { type B } -- [E161] Naming Error: ---------------------------------- 1 |trait A[B] { type B } | ^^^^^^ | B is already defined as type B 1 error found 64 / 66