Is there a way in Scala to see if a class was defined as an object?
def isObject(c: Class[_]): Boolean = ??? object X class Y val x = X val y = new Y isObject(x.getClass) == true isObject(y.getClass) == false
Aucun commentaire:
Enregistrer un commentaire