Typecheck instructions are supported for reified T

This commit is contained in:
Denis Zharkov
2014-10-06 13:46:23 +04:00
committed by Andrey Breslav
parent 416ac7917b
commit f3c49c605f
10 changed files with 154 additions and 24 deletions
@@ -724,6 +724,11 @@ public class TypeUtils {
return getTypeParameterDescriptorOrNull(type) != null;
}
public static boolean isNonReifiedTypeParemeter(@NotNull JetType type) {
TypeParameterDescriptor typeParameterDescriptor = getTypeParameterDescriptorOrNull(type);
return typeParameterDescriptor != null && !typeParameterDescriptor.isReified();
}
@Nullable
public static TypeParameterDescriptor getTypeParameterDescriptorOrNull(@NotNull JetType type) {
if (type.getConstructor().getDeclarationDescriptor() instanceof TypeParameterDescriptor) {
@@ -110,6 +110,14 @@ public class Intrinsics {
throwUndefinedForReified();
}
public static void reifyCheckcast(int parameterTypeIndex) {
throwUndefinedForReified();
}
public static void reifyInstanceof(int parameterTypeIndex) {
throwUndefinedForReified();
}
public static <T extends Throwable> T sanitizeStackTrace(T throwable) {
StackTraceElement[] stackTrace = throwable.getStackTrace();
ArrayList<StackTraceElement> list = new ArrayList<StackTraceElement>(stackTrace.length);