Approximate projections in SAM type when creating SAM adapter

Use the same approach as Java 8 applies to function types
(see non-wildcard parametrization in §9.9 of JLS)

 #KT-6918 Fixed
This commit is contained in:
Denis Zharkov
2016-01-22 14:42:08 +03:00
parent d87b13931d
commit a5c13ce8cf
14 changed files with 390 additions and 38 deletions
@@ -144,3 +144,6 @@ fun KotlinType.getImmediateSuperclassNotAny(): KotlinType? {
TypeUtils.createSubstitutedSupertype(this, it, TypeSubstitutor.create(this))
}
}
fun KotlinType.asTypeProjection(): TypeProjection = TypeProjectionImpl(this)
fun KotlinType.containsSpecialType(predicate: (KotlinType) -> Boolean) = TypeUtils.containsSpecialType(this, predicate)