In the second method you include a type parameter definition ([T] which immediately follows the method name). This declares a type parameter named T (you can name it however you want) which can then be used in the method's input arguments, output type, and implementation.
The first method is missing this definition - it attempts to use a type named T without declaring such a type: the method name (callAlpha) is not followed by a similar type parameter definition and therefore the method body (call[T](Constants.Alpha)(_: String)(_: T -> T)) cannot use it.
The fix can be simple - define T for the first method too:
def callAlpha[T] = call[T](Constants.Alpha)(_: String)(_: T => T)
type ->[A, B] = ...ortrait ->[A, B] { ... }somewhere in scope, or was this supposed to beT => T?