Prohibit constructing projected types via type aliases.

This commit is contained in:
Dmitry Petrov
2016-11-18 15:36:04 +03:00
parent bab9cde280
commit 063bce23d2
15 changed files with 243 additions and 3 deletions
@@ -203,3 +203,8 @@ fun KotlinType.requiresTypeAliasExpansion(): Boolean =
} ?: false
}
fun KotlinType.containsTypeProjectionsInTopLevelArguments(): Boolean {
if (isError) return false
val possiblyInnerType = buildPossiblyInnerType() ?: return false
return possiblyInnerType.arguments.any { it.isStarProjection || it.projectionKind != Variance.INVARIANT }
}