Skip to content

Commit

Permalink
Spotless
Browse files Browse the repository at this point in the history
  • Loading branch information
squarejesse committed Oct 10, 2024
1 parent b0958ad commit 5dd1044
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ internal class Argument(
/** Returns a name like `orderCoffee_Decaf_Oat` with each argument value inline. */
internal fun name(
prefix: String,
arguments: List<Argument>
arguments: List<Argument>,
): String {
return arguments.joinToString(
prefix = prefix,
Expand All @@ -52,12 +52,11 @@ internal fun name(

/** Returns null if we can't compute all possible arguments for this parameter. */
internal fun IrPluginContext.allPossibleArguments(
parameter: IrValueParameter
parameter: IrValueParameter,
): List<Argument>? {
val classId = parameter.type.getClass()?.classId ?: return null
val referenceClass = referenceClass(classId)?.owner ?: return null
if (!referenceClass.isEnumClass) return null
val enumEntries = referenceClass.declarations.filterIsInstance<IrEnumEntry>()
return enumEntries.map { Argument(parameter, parameter.type, it) }
}

Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ internal class FunctionSpecializer(
originalParent.addDeclaration(specialization)
}
originalParent.addDeclaration(
createFunctionThatCallsAllSpecializations(originalDispatchReceiver, specializations)
createFunctionThatCallsAllSpecializations(originalDispatchReceiver, specializations),
)
}

Expand Down

0 comments on commit 5dd1044

Please sign in to comment.