From ae43a00657a6505910010bdf920c9c0f4823a9c0 Mon Sep 17 00:00:00 2001 From: Benoit Germain Date: Tue, 30 Sep 2025 15:06:21 +0200 Subject: Lift restriction on functions and userdata as table keys As demonstrated by the unit tests, there is no problem with using a function or a userdata as a table key, as long as they are transferable --- src/intercopycontext.cpp | 7 ------- 1 file changed, 7 deletions(-) (limited to 'src/intercopycontext.cpp') diff --git a/src/intercopycontext.cpp b/src/intercopycontext.cpp index 7fb2706..61ce08f 100644 --- a/src/intercopycontext.cpp +++ b/src/intercopycontext.cpp @@ -937,10 +937,6 @@ void InterCopyContext::interCopyBoolean() const [[nodiscard]] bool InterCopyContext::interCopyFunction() const { - if (vt == VT::KEY) { - return false; - } - STACK_CHECK_START_REL(L1, 0); STACK_CHECK_START_REL(L2, 0); DEBUGSPEW_CODE(DebugSpew(nullptr) << "FUNCTION " << name << std::endl); @@ -1169,9 +1165,6 @@ InterCopyOneResult InterCopyContext::interCopyUserdata() const { STACK_CHECK_START_REL(L1, 0); STACK_CHECK_START_REL(L2, 0); - if (vt == VT::KEY) { - return InterCopyOneResult::NotCopied; - } // try clonable userdata first if (tryCopyClonable()) { -- cgit v1.2.3-55-g6feb