package som.primitives;

import som.interpreter.nodes.nary.UnaryExpressionNode;
import som.vm.constants.Classes;
import som.vmobjects.SClass;

import com.oracle.truffle.api.dsl.GenerateNodeFactory;
import com.oracle.truffle.api.dsl.Specialization;


public abstract class DoublePrims  {

  @GenerateNodeFactory
  @Primitive("doubleRound:")
  public abstract static class RoundPrim extends UnaryExpressionNode {
    @Specialization
    public final long doDouble(final double receiver) {
      return Math.round(receiver);
    }
  }

  @GenerateNodeFactory
  @Primitive("doublePositiveInfinity:")
  public abstract static class PositiveInfinityPrim extends UnaryExpressionNode {
    protected final boolean receiverIsDoubleClass(final SClass receiver) {
      return receiver == Classes.doubleClass;
    }

    @Specialization(guards = "receiverIsDoubleClass(receiver)")
    public final double doSClass(final SClass receiver) {
      return Double.POSITIVE_INFINITY;
    }
  }
}

@@ -76,70 +76,8 @@
 ode;
-%0Aimport som.vm.constants.Classes;%0Aimport som.vmobjects.SClass;
 %0A%0Aim
@@ -617,195 +617,23 @@
     
-protected final boolean receiverIsDoubleClass(final SClass receiver) %7B%0A      return receiver == Classes.doubleClass;%0A    %7D%0A%0A    @Specialization(guards = %22receiverIsDoubleClass(receiver)%22)
+@Specialization
 %0A   
@@ -668,22 +668,22 @@
 s(final 
-SClass
+Object
  receive

Remove guard, isn't a primitive on the class anymore