@@ -39,7 +39,9 @@ public ProcCallTargets(
39
39
RootCallTarget callTargetForProc ,
40
40
RootCallTarget callTargetForLambda ,
41
41
Supplier <RootCallTarget > altCallTargetCompiler ) {
42
+ // both can be set for lambda {} if #lambda is not Kernel#lambda
42
43
assert callTargetForProc != null || callTargetForLambda != null ;
44
+
43
45
assert callTargetForProc == null || validProcRootNode (callTargetForProc );
44
46
assert callTargetForLambda == null || validLambdaRootNode (callTargetForLambda );
45
47
@@ -49,7 +51,7 @@ public ProcCallTargets(
49
51
}
50
52
51
53
public ProcCallTargets (RootCallTarget callTargetForLambda ) {
52
- this (callTargetForLambda , callTargetForLambda , null );
54
+ this (null , callTargetForLambda , null );
53
55
}
54
56
55
57
public RootCallTarget getCallTargetForProc () {
@@ -80,9 +82,7 @@ private void copySplit(RootCallTarget src, RootCallTarget dst) {
80
82
81
83
private boolean validProcRootNode (RootCallTarget callTarget ) {
82
84
final RootNode rootNode = callTarget .getRootNode ();
83
- assert rootNode instanceof RubyProcRootNode ||
84
- // RubyLambdaRootNode is used for the ProcCallTargets(RootCallTarget callTargetForLambda) constructor
85
- rootNode instanceof RubyLambdaRootNode : rootNode + " " + rootNode .getClass ();
85
+ assert rootNode instanceof RubyProcRootNode : rootNode + " " + rootNode .getClass ();
86
86
return true ;
87
87
}
88
88
0 commit comments