I'm trying to call the max function: max(x: T, y: T)
. However I keep getting the following error when I type max(2,3)
:
error: cannot call value of non-function type
Int
var a = max(2, 3)
I am a beginner, and I have never encountered a function signature that uses a type "T
". SO threads relating to using the max function call it in the manner I am (like max(2,3)
) so I am not sure where I am going wrong.
I am looking for an explanation on the "T
" and how to call functions that support generic types and how to make the max
function return 3 when comparing integers 2 and 3.