Do not report a warning on an inline function with a reified parameter
#KT-6273 Fixed
This commit is contained in:
+10
@@ -128,11 +128,21 @@ public class InlineAnalyzerExtension implements FunctionAnalyzerExtension.Analyz
|
||||
hasInlinable |= checkInlinableParameter(receiverParameter, receiver, functionDescriptor, trace);
|
||||
}
|
||||
|
||||
hasInlinable |= containsReifiedTypeParameters(functionDescriptor);
|
||||
|
||||
if (!hasInlinable) {
|
||||
trace.report(Errors.NOTHING_TO_INLINE.on(function, functionDescriptor));
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean containsReifiedTypeParameters(@NotNull FunctionDescriptor descriptor) {
|
||||
for (TypeParameterDescriptor typeParameterDescriptor : descriptor.getTypeParameters()) {
|
||||
if (typeParameterDescriptor.isReified()) return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean checkInlinableParameter(
|
||||
@NotNull CallableDescriptor parameter,
|
||||
@NotNull JetElement expression,
|
||||
|
||||
Reference in New Issue
Block a user