You do not declare what Tis a type parameter in a method. You need to do this by adding [T]values ββin front of the parameter list:
def myFunction[T](input1:String, input2:String, returnType: T): T = ...
(Also, what for the parameter returnTypefor? You do not need this if your only intent was to declare a return type).
source
share