robstoll
02/14/2018, 12:47 PMkevinmost
02/14/2018, 1:11 PMprintln(clazz.simpleName == null)
give you the expected result?spand
02/14/2018, 1:14 PMspand
02/14/2018, 1:16 PM::class.objectInstance != null
should workEgor Trutenko
02/14/2018, 1:24 PMclazz.getCanonicalName() == null
, because Class
of Java has no name for anonymous classes.robstoll
02/14/2018, 1:28 PMKClass
, so ::class.objectInstance!=null
does not work, or do you mean calling that on a Class?spand
02/14/2018, 1:29 PMrobstoll
02/14/2018, 1:29 PMrobstoll
02/14/2018, 1:30 PMprintln(clazz.simpleName == null)
is falserobstoll
02/14/2018, 1:30 PMprintln(clazz.simpleName)
outputs main$clazz$1
spand
02/14/2018, 1:30 PMClass
object?robstoll
02/14/2018, 1:30 PMrobstoll
02/14/2018, 1:30 PMrobstoll
02/14/2018, 1:30 PMval clazz = object: A{}::class.java
spand
02/14/2018, 1:31 PMclazz.kotlin.objectInstance != null
robstoll
02/14/2018, 1:31 PMclazz
is passed in as parameterrobstoll
02/14/2018, 1:32 PMclazz.kotlin.objectInstance != null
works, thanks, wasn't aware of that this property exists 🙂spand
02/14/2018, 1:32 PMrobstoll
02/20/2018, 11:20 AMobject B : A
spand
02/20/2018, 11:39 AM