dan.the.man
11/26/2018, 7:11 PMAny
not work for any generic? I have code that's
Expected : <http://Request.POST|Request.POST><Any, O>
Actual: <http://Request.POST|Request.POST><I, O>
and that's causing me some issuesJake
11/26/2018, 7:12 PMT
instead. I'll check into that.dan.the.man
11/26/2018, 7:13 PMJake
11/26/2018, 7:16 PMAny
allows for more than one type where a generic of type T
or I
or whatever you choose constrains it to any one type.dan.the.man
11/26/2018, 7:19 PMAny
the equivilent to Java's Object
Where everything extends it?I
should be a subclass of itI : Any
it's failingJake
11/26/2018, 7:27 PMI != Any
because an array of type I
would be an array of one type explicitly. i.e. arrayOf<String>("a","b","c")
where Any
could be arrayOf<Any>(1, "Blue", SomeObject, ...)
dan.the.man
11/26/2018, 7:28 PMI
is a subclass of Any
so it should workJake
11/26/2018, 7:28 PMI
into an Any
parameter not Any
to an I
parameterdan.the.man
11/26/2018, 7:29 PMJake
11/26/2018, 7:29 PMexpected
vs actual
dan.the.man
11/26/2018, 7:34 PMJake
11/26/2018, 7:40 PMas Any
but your comment : Any
is making me wonder what's going on.val genericVal = getGeneric()
val data = getData()
<http://Request.Post|Request.Post><genericVal as Any, data>()
<http://Request.Post|Request.Post><genericVal : Any, data>()
ienoobong
11/27/2018, 5:42 AMAny
in your case is the type parameter, equivalent to T
or anything you want to call it. Can you post the method signature of `POSTahulyk
11/27/2018, 9:33 AMrkeazor
11/27/2018, 6:03 PM