Skip to content

Commit 08128a6

Browse files
committed
Fix logic which should only apply for metaclasses in Module#undef_method
1 parent a1e95f9 commit 08128a6

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/main/java/org/truffleruby/core/module/ModuleFields.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,8 +448,7 @@ public void undefMethod(RubyContext context, Node currentNode, String methodName
448448
final InternalMethod method = ModuleOperations.lookupMethodUncached(rubyModuleObject, methodName, null);
449449
if (method == null || method.isUndefined()) {
450450
final DynamicObject moduleForError;
451-
452-
if (Layouts.CLASS.isClass(rubyModuleObject) && Layouts.CLASS.getIsSingleton(rubyModuleObject)) {
451+
if (RubyGuards.isMetaClass(rubyModuleObject)) {
453452
moduleForError = Layouts.CLASS.getAttached(rubyModuleObject);
454453
} else {
455454
moduleForError = rubyModuleObject;

0 commit comments

Comments
 (0)