Ray Rahke
03/03/2024, 6:51 PMAny
to mean "The arguments of the class constructor are not relevant. Any constructor works independent of parameters, we just care about if it creates an object of type `InstanceType`"Youssef Shoaib [MOD]
03/03/2024, 6:56 PMAny
in this situation will never work because a function that takes Any
is more specific than a function that takes Char
. What you actually would want is a function that takes Nothing
, which also means that you can't call it.
Secondly, you're using KFunction1
, so it'll only work for functions of 1 argument. What you actually want is KFunction
, which doesn't have a specified arityAdam S
03/03/2024, 6:56 PMAny
arg
https://pl.kotl.in/uRz_XPAzoRay Rahke
03/03/2024, 7:20 PMRay Rahke
03/03/2024, 7:21 PMRay Rahke
03/03/2024, 7:22 PMRay Rahke
03/03/2024, 7:22 PMYoussef Shoaib [MOD]
03/03/2024, 7:22 PMKFunction<InstanceType>
will do it I believeRay Rahke
03/03/2024, 7:22 PMYoussef Shoaib [MOD]
03/03/2024, 7:22 PMKCallable<InstanceType>
even, which generalises to properties too