<@U3DE1TXKP> any reason you need to specify the ty...
# announcements
a
@robstoll any reason you need to specify the type?
r
Unfortunately yes, I saw that it works if I do not have to
c
You don't. This works for me:
Copy code
fun main(args: Array<String>) {
    1 doStuff 1.2
}

infix fun <T> Int.doStuff(t: T) { println(t) }
r
I am using it in a generic function, something like
fun <T> foo(a: T){ 1 test<T> a }
ok, bad example as well 😄 let me check the usage
my function is actually defined likes this:
infix inline fun <reified TSub : Any> IAssertionPlant<Any>.isA(noinline assertionCreator: IAssertionPlant<TSub>.() -> Unit)
That's why I need to provide a type for
TSub
r
can you put that into a code block in slack. its hard to read like that
r
It is already in a code block, I'll put the parameter on a new line:
Copy code
infix inline fun <reified TSub : Any> IAssertionPlant<Any>.isA( 
    noinline assertionCreator: IAssertionPlant<TSub>.() -> Unit
)
r
shouldn’t it be IAssertionPlant<Tsub>
?
r
in case you mean
IAssertionPlant<Any>
, then nope
isA
is basically a down-cast assertion which allows you to tell that
val a: Any = 1; assert(a).isA<Int>{}
for instance