Fix generic signature for SAM adapters and constructors
SAM-related code in codegen was using JavaClassDescriptor directly, which has an erased signature. Create and use a new abstraction SamType which has a full generic signature of a type which was used in the SAM construct
This commit is contained in:
-10
@@ -285,16 +285,6 @@ public class SingleAbstractMethodUtils {
|
||||
return new TypeParameters(typeParameters, typeParametersSubstitutor);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static SimpleFunctionDescriptor getAbstractMethodOfSamType(@NotNull JetType type) {
|
||||
return (SimpleFunctionDescriptor) getAbstractMembers(type).get(0);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static SimpleFunctionDescriptor getAbstractMethodOfSamInterface(@NotNull ClassDescriptor samInterface) {
|
||||
return getAbstractMethodOfSamType(samInterface.getDefaultType());
|
||||
}
|
||||
|
||||
public static boolean isSamInterface(@NotNull JavaClass javaClass) {
|
||||
return getSamInterfaceMethod(javaClass) != null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user