https://kotlinlang.org logo
#announcements
Title
# announcements
c

cedric

12/07/2017, 6:42 PM
Given
data class Foo(var s: Int? = null)
, is it possible to invoke the default constructor by reflection without requiring
@JvmOverloads
? Without it, I see that this class has two constructors, one with a last parameter
DefaultConstructorMarker
but it doesn’t look like I can invoke it.
k

karelpeeters

12/07/2017, 7:45 PM
That's funny, both the REPL and the debugger in IDEA have trouble with
Foo::class.constructors
, they say it has type
ArrayList
but when I do
Foo::class.constructors[0]
they complain that the
get
overloads for
Map
don't work.
7 Views