Skip to content

Commit

Permalink
Ensure isAllTypes is compilation constant
Browse files Browse the repository at this point in the history
  • Loading branch information
JaroslavTulach committed Dec 19, 2024
1 parent 7998ed5 commit 086d024
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package org.enso.interpreter.node.typecheck;

import com.oracle.truffle.api.CompilerAsserts;
import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.nodes.ExplodeLoop;
import com.oracle.truffle.api.nodes.Node;
import java.util.List;
import org.enso.interpreter.node.ExpressionNode;
Expand Down Expand Up @@ -29,11 +31,16 @@ abstract Object executeCheckOrConversion(

abstract String expectedTypeMessage();

@ExplodeLoop
final boolean isAllTypes() {
Node p = this;
CompilerAsserts.compilationConstant(p);
for (; ; ) {
if (p instanceof TypeCheckValueNode vn) {
return vn.isAllTypes();
CompilerAsserts.compilationConstant(vn);
var allTypes = vn.isAllTypes();
CompilerAsserts.compilationConstant(allTypes);
return allTypes;
}
p = p.getParent();
}
Expand Down

0 comments on commit 086d024

Please sign in to comment.