TypeInfo should be covariant. Consider the common case in Java when something wants, say, an annotation class. They write Class<? extends Annotation>. We can write just TypeInfo<Annotation>

This commit is contained in:
Andrey Breslav
2011-11-09 15:21:17 +03:00
parent b1df4a0045
commit a4768eda98
+2 -2
View File
@@ -1,13 +1,13 @@
namespace jet
namespace typeinfo {
class TypeInfo<T> {
class TypeInfo<out T> {
fun isSubtypeOf(other : TypeInfo<*>) : Boolean
fun isInstance(obj : Any?) : Boolean
}
fun typeinfo<T>() : TypeInfo<T>
fun typeinfo<T>(expression : T) : TypeInfo<out T>
fun typeinfo<T>(expression : T) : TypeInfo<T>
}
namespace io {