@@ -442,19 +442,18 @@ function methoddef!(@nospecialize(recurse), signatures, frame::Frame, @nospecial
442
442
framecode, pcin = frame. framecode, pc
443
443
if ismethod3 (stmt)
444
444
pc3 = pc
445
- sigt, pc = signature (recurse, frame, stmt, pc)
446
- if sigt === nothing && define
447
- step_expr! (recurse, frame, stmt, true )
448
- end
445
+ arg1 = stmt. args[1 ]
449
446
sigt, pc = signature (recurse, frame, stmt, pc)
450
447
meth = whichtt (sigt)
451
- if (meth === nothing || ! (meth. sig <: sigt && sigt <: meth.sig )) && define
448
+ if isa (meth, Method) && (meth. sig <: sigt && sigt <: meth.sig )
449
+ pc = next_or_nothing! (frame)
450
+ elseif define
452
451
pc = step_expr! (recurse, frame, stmt, true )
453
452
meth = whichtt (sigt)
454
453
end
455
454
if isa (meth, Method)
456
455
push! (signatures, meth. sig)
457
- elseif stmt . args[ 1 ] === false
456
+ elseif arg1 === false || arg1 === nothing
458
457
# If it's anonymous and not defined, define it
459
458
pc = step_expr! (recurse, frame, stmt, true )
460
459
meth = whichtt (sigt)
@@ -471,7 +470,7 @@ function methoddef!(@nospecialize(recurse), signatures, frame::Frame, @nospecial
471
470
end
472
471
end
473
472
frame. pc = pc
474
- return ( define ? pc : next_or_nothing! (frame) ) , pc3
473
+ return pc , pc3
475
474
end
476
475
ismethod1 (stmt) || error (" expected method opening, got " , stmt)
477
476
name = stmt. args[1 ]
0 commit comments