Skip to content

Commit

Permalink
[Truffle] Allow methods to exist on only one of TrueClassNodes or Fal…
Browse files Browse the repository at this point in the history
…seClassNodes.

Prior to this, both classes needed to contain the same exact set of methods or the methods in the set difference would result in an UnsupportedOperationException.
nirvdrum committed Nov 26, 2014
1 parent ad1da0b commit 2502d3f
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
@@ -120,18 +120,14 @@ private Object doUnboxedObject(
lookup(callerClass, getContext().getCoreLibrary().box(false), methodName.toString(),
ignoreVisibility, dispatchAction);

if (falseMethod == null) {
throw new UnsupportedOperationException();
}

final Assumption trueUnmodifiedAssumption =
getContext().getCoreLibrary().getTrueClass().getUnmodifiedAssumption();

final RubyMethod trueMethod =
lookup(callerClass, getContext().getCoreLibrary().box(true), methodName.toString(),
ignoreVisibility, dispatchAction);

if (trueMethod == null) {
if ((falseMethod == null) && (trueMethod == null)) {
throw new UnsupportedOperationException();
}

0 comments on commit 2502d3f

Please sign in to comment.