I'm trying to define a generic add function to numeric values:
def add[A](x:A, y:A): A = {
x + y
}
console:16: error: type mismatch;
found : A
required: String
x + y
^
What's the compiler complaining about? Some of the stuff I've googled does not quite make sense to me at this moment.
+
method. – Jörg W Mittag