Hello. This is just a pitch, no implementation. SE-0253: Callable values of user-defined nominal types called out the implicit conversion of callable values to functions in its future directions.
A value cannot be implicitly converted to a function when the destination function type matches the type of the
callAsFunction
method. SincecallAsFunction
methods are normal methods, you can refer to them directly via.callAsFunction
and get a function.
>Implicit conversions impact the entire type system and require runtime support to work with dynamic casts; thus, further exploration is necessary for a formal proposal. This base proposal is self-contained; incremental proposals involving conversio