Skip to content

Conversation

@karl-police
Copy link
Contributor

@karl-police karl-police commented Jul 23, 2025

Implementation for luau-lang/rfcs#131 incase it gets merged

This is variation 1.

Variation 2 is here: #1927

In this variation I replaced the functions. And the feature is locked behind FFlagDebugLuauRenameClassToExtern, it's prefixed with Debug, so it doesn't get enabled by --fflags=true, which allows us to transition to get rid of every existing reference of "class".

The reason why I replace functions in this variation, is because I thought that this is the optimal way, and won't add an extra instruction everytime you'd call :is

@karl-police
Copy link
Contributor Author

Me when Unit Tests fail here, but not my end.

@karl-police karl-police changed the title Implement RFC, rename "class" to "extern" Implement RFC, rename "class" to "extern" locked behind a flag Jul 23, 2025
@karl-police
Copy link
Contributor Author

karl-police commented Jul 23, 2025

If this fails as well, I probably have to use declare class syntax for the Unit Test

@karl-police karl-police changed the title Implement RFC, rename "class" to "extern" locked behind a flag Implement RFC, rename "class" to "extern" locked behind a debug flag Jul 23, 2025
@karl-police
Copy link
Contributor Author

karl-police commented Jul 23, 2025

Works, but I think the tenary operator is doing the opposite thing?

This passed the Unit Tests, soo...

@karl-police karl-police marked this pull request as draft July 23, 2025 15:28
@karl-police
Copy link
Contributor Author

Alright, I did

static std::string getTag_DEPRECATED(lua_State* L, TypeFunctionTypeId ty);
static std::string getTag_NEW(lua_State* L, TypeFunctionTypeId ty);

// Original function is named "getTag"
using GetTagFunc = std::string (*)(lua_State*, TypeFunctionTypeId);
static GetTagFunc getTag = getTag_DEPRECATED;

TypeFunctionRuntime::TypeFunctionRuntime(NotNull<InternalErrorReporter> ice, NotNull<TypeCheckLimits> limits)
    : ice(ice)
    , limits(limits)
    , state(nullptr, dummyStateClose)
{
    if (FFlag::DebugLuauRenameClassToExtern)
    {
        getTag = getTag_NEW;
    }
}

and that worked

@karl-police karl-police marked this pull request as ready for review July 23, 2025 15:39
@karl-police karl-police changed the title Implement RFC, rename "class" to "extern" locked behind a debug flag Implement RFC, rename "class" to "extern" locked behind a debug flag - by replacing function pointers Jul 23, 2025
@aatxe
Copy link
Collaborator

aatxe commented Aug 21, 2025

This is not the appropriate way to flag this, the other PR is correct.

@aatxe aatxe closed this Aug 21, 2025
@karl-police karl-police deleted the patch-1 branch August 29, 2025 13:18
@karl-police karl-police restored the patch-1 branch August 29, 2025 13:18
@karl-police karl-police deleted the patch-1 branch August 29, 2025 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants