TypeUtils.containsSpecialType() fixed to account for flexible types

This commit is contained in:
Andrey Breslav
2014-10-06 19:42:23 +04:00
parent a737352b5d
commit f5aed51fd0
2 changed files with 8 additions and 0 deletions
@@ -0,0 +1,3 @@
package
internal fun test(): kotlin.Unit
@@ -533,6 +533,11 @@ public class TypeUtils {
) {
if (type == null) return false;
if (isSpecialType.invoke(type)) return true;
Flexibility flexibility = type.getCapability(Flexibility.class);
if (flexibility != null
&& (containsSpecialType(flexibility.getLowerBound(), isSpecialType) || containsSpecialType(flexibility.getUpperBound(), isSpecialType))) {
return true;
}
for (TypeProjection projection : type.getArguments()) {
if (containsSpecialType(projection.getType(), isSpecialType)) return true;
}