I have the following ```class Function1<A : Num...
# announcements
e
I have the following
Copy code
class Function1<A : Number, R : Number>(val func: (a: A) -> R) {
    operator fun invoke(a: A): R = func(a)
}
why
::invoke
seems to require a parameter of type
Nothing
here:
Copy code
when(val f = t.function) {
    is Function1<*, *> -> f.invoke(stack.pop()) // Type mismatch: required Nothing
}
Because of the
<*, *>
? I cant specify anything else because of type erasure this works though
Copy code
is Function1<*, *> -> (f as Function1<Number, Number>)(stack.pop())
m
if your function doesn't know what type it is; you can't call the result of the function without it being Nothing. What are you testing with "is Function<*, *>" exactly?
e
basically is the number of parameters passed to the
f
lambda