它产生的错误是:
Funct.scala:5: 'val' expected but identifier found.
[error] class Funct[In,Out](function: In => Out, description: String, implicit m: Manifest[In => Out]) {
有问题的代码是:
import scala.reflect.Manifest;
class Funct[In,Out](function: In => Out, description: String, implicit m: Manifest[In => Out]) {
def isType[K](implicit man: Manifest[K]) = {
m <:< man
}
def Apply(input: In): Out = {
function.Apply(input)
}
def toString() = {
description + m
}
}
我根本看不出问题出在哪里。