@@ -3129,6 +3129,50 @@ mod hir_opt_tests {
31293129 " ) ;
31303130 }
31313131
3132+ #[ test]
3133+ fn test_call_with_pos_optional_and_maybe_too_many_args ( ) {
3134+ eval ( "
3135+ def target(a = 1, b = 2, c = 3, d = 4, e = 5, f:) = [a, b, c, d, e, f]
3136+ def test = [target(f: 6), target(10, 20, 30, f: 6), target(10, 20, 30, 40, 50, f: 60)]
3137+ test
3138+ test
3139+ " ) ;
3140+ assert_snapshot ! ( hir_string( "test" ) , @r"
3141+ fn test@<compiled>:3:
3142+ bb0():
3143+ EntryPoint interpreter
3144+ v1:BasicObject = LoadSelf
3145+ Jump bb2(v1)
3146+ bb1(v4:BasicObject):
3147+ EntryPoint JIT(0)
3148+ Jump bb2(v4)
3149+ bb2(v6:BasicObject):
3150+ v11:Fixnum[6] = Const Value(6)
3151+ PatchPoint NoSingletonClass(Object@0x1000)
3152+ PatchPoint MethodRedefined(Object@0x1000, target@0x1008, cme:0x1010)
3153+ v48:HeapObject[class_exact*:Object@VALUE(0x1000)] = GuardType v6, HeapObject[class_exact*:Object@VALUE(0x1000)]
3154+ v50:BasicObject = SendWithoutBlockDirect v48, :target (0x1038), v11
3155+ v16:Fixnum[10] = Const Value(10)
3156+ v18:Fixnum[20] = Const Value(20)
3157+ v20:Fixnum[30] = Const Value(30)
3158+ v22:Fixnum[6] = Const Value(6)
3159+ PatchPoint NoSingletonClass(Object@0x1000)
3160+ PatchPoint MethodRedefined(Object@0x1000, target@0x1008, cme:0x1010)
3161+ v53:HeapObject[class_exact*:Object@VALUE(0x1000)] = GuardType v6, HeapObject[class_exact*:Object@VALUE(0x1000)]
3162+ v55:BasicObject = SendWithoutBlockDirect v53, :target (0x1038), v16, v18, v20, v22
3163+ v27:Fixnum[10] = Const Value(10)
3164+ v29:Fixnum[20] = Const Value(20)
3165+ v31:Fixnum[30] = Const Value(30)
3166+ v33:Fixnum[40] = Const Value(40)
3167+ v35:Fixnum[50] = Const Value(50)
3168+ v37:Fixnum[60] = Const Value(60)
3169+ v39:BasicObject = SendWithoutBlock v6, :target, v27, v29, v31, v33, v35, v37 # SendFallbackReason: Too many arguments for LIR
3170+ v41:ArrayExact = NewArray v50, v55, v39
3171+ CheckInterrupts
3172+ Return v41
3173+ " ) ;
3174+ }
3175+
31323176 #[ test]
31333177 fn test_send_call_to_iseq_with_optional_kw ( ) {
31343178 eval ( "
0 commit comments