Skip to content
Permalink
Browse files
[Truffle] Bignum do not have a singleton class.
* Duplicating the logic of hasNoSingleton() in SingletonClassNode is not worth it.
  • Loading branch information
eregon committed Dec 29, 2014
1 parent 8e34ffa commit bf361f9aaa63dd394405eedf125becf98e9d953b
@@ -62,12 +62,6 @@ protected Object singletonClass(double value) {
throw new RaiseException(getContext().getCoreLibrary().typeErrorCantDefineSingleton(this));
}

@Specialization
protected Object singletonClass(RubyBignum value) {
CompilerDirectives.transferToInterpreter();
throw new RaiseException(getContext().getCoreLibrary().typeErrorCantDefineSingleton(this));
}

@Specialization
protected RubyClass singletonClass(RubyBasicObject object) {
return object.getSingletonClass(this);
@@ -25,6 +25,11 @@ public RubyBignum(RubyClass rubyClass, BigInteger value) {
this.value = value;
}

@Override
public boolean hasNoSingleton() {
return true;
}

@CompilerDirectives.TruffleBoundary
public RubyBignum negate() {
return create(value.negate());

0 comments on commit bf361f9

Please sign in to comment.