Merge remote-tracking branch 'origin/master'
Conflicts: compiler/frontend/src/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider.java
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
// +JDK
|
||||
// KT-689 Allow to put Java and Kotlin files in the same packages
|
||||
|
||||
// This is a stub test. One should not extend Java packages that come from libraries.
|
||||
namespace java
|
||||
|
||||
val c : lang.Class<*>? = null
|
||||
|
||||
val <T> Array<T>?.length : Int get() = if (this != null) this.size else throw NullPointerException()
|
||||
@@ -0,0 +1,13 @@
|
||||
// KT-716 Type inference failed
|
||||
// +JDK
|
||||
|
||||
fun <T> typeinfo.TypeInfo<T>.getJavaClass() : java.lang.Class<T> {
|
||||
val t : java.lang.Object = this <!CAST_NEVER_SUCCEEDS!>as<!> java.lang.Object
|
||||
return <!UNCHECKED_CAST!>t.getClass() as java.lang.Class<T><!> // inferred type is Object but Serializable was expected
|
||||
}
|
||||
|
||||
fun getJavaClass<T>() = typeinfo.typeinfo<T>.getJavaClass()
|
||||
|
||||
fun main(args : Array<String>) {
|
||||
System.out?.println(getJavaClass<String>)
|
||||
}
|
||||
Reference in New Issue
Block a user