Skip to content
Prev Previous commit
Add args checking
  • Loading branch information
tamarinvs19 committed Dec 21, 2023
commit c1a0dc2b2a6d85113cd3b2952170decbf167450d
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ class PythonCallableTypeDescription(

fun removeNonPositionalArgs(type: UtType): FunctionType {
val functionType = castToCompatibleTypeApi(type)
require(functionType.parameters.all { it is TypeParameter })
val argsCount = argumentKinds.count { it == ArgKind.ARG_POS }
return createPythonCallableType(
functionType.parameters.size,
Expand All @@ -238,6 +239,7 @@ class PythonCallableTypeDescription(

fun removeNotRequiredArgs(type: UtType): FunctionType {
val functionType = castToCompatibleTypeApi(type)
require(functionType.parameters.all { it is TypeParameter })
return createPythonCallableType(
functionType.parameters.size,
argumentKinds.filter { isRequired(it) },
Expand Down