I use scala code taken from scala cursors on coursera:
package src.functional.week4 abstract class Boolean { def ifThenElse[T](t: => T, e: => T): T def && (x: => Boolean): Boolean = ifThenElse(x, false) }
The line def && (x: => Boolean): Boolean = ifThenElse(x, false) gives this compile-time error:
type mismatch; found: scala.Boolean (false) required: src.functional.week4.Boolean
Here is a snippet of code from the video:

Do I need to change the code to compile it?
When I create a new object "false" using
object false extends Boolean { def ifThenElse[T](t: => T, e: => t) = e }
I get an error message:
Multiple tokens on this line - ID is expected, but "false" is found.
I define an object in the same class as the "abstract Boolean class". I cannot create a new object of type false because the Eclipse environment does not allow this.
source share