Files
kotlin-fork/compiler/testData/diagnostics/tests/classLiteral/nonClassesOnLHS.kt
T
Alexander Udalov 693c753988 Support for new double colon expressions in type checker
Despite the fact that the LHS of a double colon expression is now KtExpression
instead of KtUserType, we must still consider it a type for callable references
to work. Extract and reuse relevant parts of QualifiedExpressionResolver and
TypeResolver to support this behavior
2016-05-26 22:22:41 +03:00

21 lines
586 B
Kotlin
Vendored

// !DIAGNOSTICS: -UNUSED_VARIABLE
class A
val a1 = <!CLASS_LITERAL_LHS_NOT_A_CLASS!>A?::class<!>
val a2 = <!CLASS_LITERAL_LHS_NOT_A_CLASS!>A??::class<!>
val l1 = <!CLASS_LITERAL_LHS_NOT_A_CLASS!>List<String>?::class<!>
val l2 = <!CLASS_LITERAL_LHS_NOT_A_CLASS!>List?::class<!>
fun <T : Any> foo() {
val t1 = <!CLASS_LITERAL_LHS_NOT_A_CLASS!>T::class<!>
val t2 = <!CLASS_LITERAL_LHS_NOT_A_CLASS!>T?::class<!>
}
inline fun <reified T : Any> bar() {
val t3 = <!CLASS_LITERAL_LHS_NOT_A_CLASS!>T?::class<!>
}
val m = Map<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!><String><!>::class